Skip to content

Commit c881469

Browse files
authored
Merge pull request #33 from GeoTecINIT/isolate-human-act-perm
Make human activity recognition permission optional
2 parents 6ef790a + 9b0d378 commit c881469

File tree

4 files changed

+27
-12
lines changed

4 files changed

+27
-12
lines changed

README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,39 @@ android {
4242

4343
#### Permissions
4444

45+
##### Geolocation
46+
4547
In order to use geolocation on Android, you'll need to add the following permission(s) to your app's `AndroidManifest.xml` inside the `App_Resources/Android/src/main` dir:
4648

4749
```xml
48-
<!-- Always include this permission -->
49-
<!-- This permission is for "approximate" location data -->
50-
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
50+
<!-- Always include this permission if your app needs location access -->
51+
<!-- This permission is for "approximate" location data -->
52+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
5153

52-
<!-- Include only if your app benefits from precise location access. -->
53-
<!-- This permission is for "precise" location data -->
54-
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
54+
<!-- Include only if your app benefits from precise location access. -->
55+
<!-- This permission is for "precise" location data -->
56+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
5557

56-
<!-- Required only when requesting background location access on
57-
Android 10 (API level 29) and higher. -->
58-
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
58+
<!-- Required only when requesting background location access on Android 10 (API level 29) and higher. -->
59+
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
5960
```
6061

6162
More information can be found in the [Android docs here](https://developer.android.com/training/location/permissions).
6263

6364
> Source: [https://github.com/NativeScript/nativescript-geolocation](https://github.com/NativeScript/nativescript-geolocation)
6465
66+
##### Human activity detection
67+
68+
In order to receive human activity changes on Android, you'll need to add the following permission(s) to your app's `AndroidManifest.xml` inside the `App_Resources/Android/src/main` dir:
69+
70+
```xml
71+
<!-- The following two permissions are required if your app wants to receive human activity changes -->
72+
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION"/>
73+
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/>
74+
```
75+
76+
More information can be found in the [Android docs here](https://developer.android.com/about/versions/10/privacy/changes#physical-activity-recognition).
77+
6578
## Installation
6679

6780
Run the following command in your project's root folder.

demo/app/App_Resources/Android/src/main/AndroidManifest.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
android:largeScreens="true"
1111
android:xlargeScreens="true"/>
1212

13-
<!-- Always include this permission -->
13+
<!-- Always include this permission if your app needs location access -->
1414
<!-- This permission is for "approximate" location data -->
1515
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
1616

@@ -22,6 +22,10 @@
2222
Android 10 (API level 29) and higher. -->
2323
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
2424

25+
<!-- The following two permissions are required if your app wants to receive human activity changes -->
26+
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION"/>
27+
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/>
28+
2529
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
2630
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
2731
<uses-permission android:name="android.permission.INTERNET"/>

src-native/android/contextapis/src/main/AndroidManifest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
package="es.uji.geotec.contextapis">
33

44
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
5-
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION"/>
6-
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/>
75

86
<application>
97
<receiver
-44 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)