Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit d45b73d

Browse files
committed
Replace ActivityRecognition with new starter project
Bug: 217264751 Change-Id: I0a654b6adeaeb6fced43e2f0ff1c3f17c6df715c
1 parent a6ef52d commit d45b73d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+904
-939
lines changed

ActivityRecognition/.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
build/
2-
.idea
3-
.gradle
41
*.iml
5-
local.properties
2+
.gradle
3+
/local.properties
4+
/.idea
65
.DS_Store
6+
/build
7+
/captures
8+
.externalNativeBuild
9+
.cxx
10+
local.properties

ActivityRecognition/app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

ActivityRecognition/app/build.gradle

Lines changed: 65 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,84 @@
1-
apply plugin: 'com.android.application'
1+
/*
2+
* Copyright 2022 Google, Inc
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
plugins {
18+
id 'com.android.application'
19+
id 'kotlin-android'
20+
}
221

322
android {
4-
compileSdkVersion 28
23+
compileSdk 31
24+
525
defaultConfig {
626
applicationId "com.google.android.gms.location.sample.activityrecognition"
7-
minSdkVersion 16
8-
targetSdkVersion 28
27+
minSdk 21
28+
targetSdk 31
929
versionCode 1
1030
versionName "1.0"
31+
32+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
33+
vectorDrawables {
34+
useSupportLibrary true
35+
}
1136
}
37+
1238
buildTypes {
1339
release {
1440
minifyEnabled false
15-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
41+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
42+
}
43+
}
44+
compileOptions {
45+
sourceCompatibility JavaVersion.VERSION_1_8
46+
targetCompatibility JavaVersion.VERSION_1_8
47+
}
48+
kotlinOptions {
49+
jvmTarget = '1.8'
50+
useIR = true
51+
}
52+
buildFeatures {
53+
compose true
54+
}
55+
composeOptions {
56+
kotlinCompilerExtensionVersion compose_version
57+
kotlinCompilerVersion '1.5.10'
58+
}
59+
packagingOptions {
60+
resources {
61+
excludes += '/META-INF/{AL2.0,LGPL2.1}'
1662
}
1763
}
1864
}
1965

2066
dependencies {
67+
implementation 'androidx.core:core-ktx:1.7.0'
68+
implementation 'androidx.appcompat:appcompat:1.4.1'
69+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
70+
implementation 'androidx.activity:activity-compose:1.4.0'
2171

22-
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1', {
23-
exclude group: 'com.android.support', module: 'support-annotations'
24-
})
25-
implementation 'androidx.appcompat:appcompat:1.1.0'
26-
testImplementation 'junit:junit:4.12'
72+
implementation 'com.google.android.material:material:1.5.0'
2773

28-
implementation 'com.google.android.material:material:1.0.0'
29-
implementation 'com.google.android.gms:play-services-location:17.0.0'
74+
// Compose
75+
implementation "androidx.compose.ui:ui:$compose_version"
76+
implementation "androidx.compose.material:material:$compose_version"
77+
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
3078

31-
implementation 'com.google.code.gson:gson:2.8.5'
79+
testImplementation 'junit:junit:4.13.2'
80+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
81+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
82+
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
83+
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
3284
}
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
# Add project specific ProGuard rules here.
2-
# By default, the flags in this file are appended to flags specified
3-
# in ${sdk.dir}/tools/proguard/proguard-android.txt
4-
# You can edit the include path and order by changing the proguardFiles
5-
# directive in build.gradle.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
64
#
75
# For more details, see
86
# http://developer.android.com/guide/developing/tools/proguard.html
97

10-
# Add any project specific keep options here:
11-
128
# If your project uses WebView with JS, uncomment the following
139
# and specify the fully qualified class name to the JavaScript interface
1410
# class:
1511
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1612
# public *;
1713
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,43 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
Copyright 2014 Google, Inc.
4-
5-
Licensed under the Apache License, Version 2.0 (the "License");
6-
you may not use this file except in compliance with the License.
7-
You may obtain a copy of the License at
8-
9-
http://www.apache.org/licenses/LICENSE-2.0
10-
11-
Unless required by applicable law or agreed to in writing, software
12-
distributed under the License is distributed on an "AS IS" BASIS,
13-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
See the License for the specific language governing permissions and
15-
limitations under the License.
16-
-->
17-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
~ Copyright 2022 Google, Inc
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ https://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
18+
<manifest
19+
xmlns:android="http://schemas.android.com/apk/res/android"
20+
xmlns:tools="http://schemas.android.com/tools"
1821
package="com.google.android.gms.location.sample.activityrecognition">
1922

20-
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
21-
2223
<application
23-
android:allowBackup="true"
24-
android:icon="@drawable/ic_launcher"
24+
android:allowBackup="false"
25+
android:icon="@mipmap/ic_launcher"
2526
android:label="@string/app_name"
26-
android:theme="@style/Theme.Base">
27-
<meta-data
28-
android:name="com.google.android.gms.version"
29-
android:value="@integer/google_play_services_version" />
30-
27+
android:roundIcon="@mipmap/ic_launcher_round"
28+
android:supportsRtl="true"
29+
android:theme="@style/Theme.ActivityRecognition"
30+
tools:ignore="DataExtractionRules">
3131
<activity
3232
android:name=".MainActivity"
33-
android:label="@string/app_name">
33+
android:exported="true"
34+
android:theme="@style/Theme.ActivityRecognition.NoActionBar">
3435
<intent-filter>
3536
<action android:name="android.intent.action.MAIN" />
3637

3738
<category android:name="android.intent.category.LAUNCHER" />
3839
</intent-filter>
3940
</activity>
40-
41-
<!-- Service that provides activity recognition data. Setting the android:exported attribute
42-
to "false" stops other apps from starting this service, even when using an explicit
43-
intent. -->
44-
<service
45-
android:name=".DetectedActivitiesIntentService"
46-
android:exported="false" />
4741
</application>
42+
4843
</manifest>

ActivityRecognition/app/src/main/java/com/google/android/gms/location/sample/activityrecognition/Constants.java

Lines changed: 0 additions & 63 deletions
This file was deleted.

ActivityRecognition/app/src/main/java/com/google/android/gms/location/sample/activityrecognition/DetectedActivitiesAdapter.java

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy