diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2023-12-11 15:31:44 +0100 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2023-12-11 15:32:33 +0100 |
commit | 1749bd5e7fa959a022472defb8ba78c689c994af (patch) | |
tree | b591bf4d58c83065033cc845b56d6883782b7938 /android/app | |
parent | f0600c5ec4ffa5a84f6a08c07ec341a22e0430de (diff) | |
download | cyberbadge_mobile-1749bd5e7fa959a022472defb8ba78c689c994af.tar.gz cyberbadge_mobile-1749bd5e7fa959a022472defb8ba78c689c994af.zip |
Add initial ble-service.
Diffstat (limited to 'android/app')
-rw-r--r-- | android/app/src/debug/AndroidManifest.xml | 42 | ||||
-rw-r--r-- | android/app/src/main/AndroidManifest.xml | 53 |
2 files changed, 84 insertions, 11 deletions
diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index eb98c01..b7c3a3c 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml | |||
@@ -1,6 +1,46 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:tools="http://schemas.android.com/tools"> | 3 | xmlns:tools="http://schemas.android.com/tools"> |
4 | |||
5 | <uses-permission android:name="android.permission.INTERNET" /> | ||
6 | |||
7 | <!-- | ||
8 | HACK: this permission should not be needed on android 12+ devices anymore, | ||
9 | but in fact some manufacturers still need it for BLE to properly work : | ||
10 | https://stackoverflow.com/a/72370969 | ||
11 | --> | ||
12 | <uses-permission android:name="android.permission.BLUETOOTH" tools:remove="android:maxSdkVersion" /> | ||
13 | <!-- | ||
14 | should normally only be needed on android < 12 if you want to: | ||
15 | - activate bluetooth programmatically | ||
16 | - discover local BLE devices | ||
17 | see: https://developer.android.com/guide/topics/connectivity/bluetooth/permissions#discover-local-devices. | ||
18 | Same as above, may still be wrongly needed by some manufacturers on android 12+. | ||
19 | --> | ||
20 | <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" tools:remove="android:maxSdkVersion" /> | ||
21 | |||
22 | <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="28"/> | ||
23 | <uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30"/> | ||
24 | |||
25 | <!-- Only when targeting Android 12 or higher --> | ||
26 | <!-- | ||
27 | Please make sure you read the following documentation | ||
28 | to have a better understanding of the new permissions. | ||
29 | https://developer.android.com/guide/topics/connectivity/bluetooth/permissions#assert-never-for-location | ||
30 | --> | ||
31 | |||
32 | <!-- Needed if your app search for Bluetooth devices. --> | ||
33 | <!-- | ||
34 | If your app doesn't use Bluetooth scan results to derive physical location information, | ||
35 | you can strongly assert that your app doesn't derive physical location. | ||
36 | --> | ||
37 | <uses-permission android:name="android.permission.BLUETOOTH_SCAN" | ||
38 | android:usesPermissionFlags="neverForLocation" /> | ||
39 | <!-- Needed if you want to interact with a BLE device. --> | ||
40 | <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> | ||
41 | <!-- Needed if your app makes the current device discoverable to other Bluetooth devices. --> | ||
42 | <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" /> | ||
43 | |||
4 | 44 | ||
5 | <application | 45 | <application |
6 | android:usesCleartextTraffic="true" | 46 | android:usesCleartextTraffic="true" |
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 4122f36..e1c8b57 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml | |||
@@ -1,25 +1,58 @@ | |||
1 | <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | 1 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
2 | xmlns:tools="http://schemas.android.com/tools"> | ||
2 | 3 | ||
3 | <uses-permission android:name="android.permission.INTERNET" /> | 4 | <uses-permission android:name="android.permission.INTERNET" /> |
4 | 5 | ||
5 | <application | 6 | <uses-permission android:name="android.permission.BLUETOOTH" tools:remove="android:maxSdkVersion" /> |
7 | <!-- | ||
8 | should normally only be needed on android < 12 if you want to: | ||
9 | - activate bluetooth programmatically | ||
10 | - discover local BLE devices | ||
11 | see: https://developer.android.com/guide/topics/connectivity/bluetooth/permissions#discover-local-devices. | ||
12 | Same as above, may still be wrongly needed by some manufacturers on android 12+. | ||
13 | --> | ||
14 | <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" tools:remove="android:maxSdkVersion" /> | ||
15 | |||
16 | <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="28"/> | ||
17 | <uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30"/> | ||
18 | |||
19 | <!-- Only when targeting Android 12 or higher --> | ||
20 | <!-- | ||
21 | Please make sure you read the following documentation | ||
22 | to have a better understanding of the new permissions. | ||
23 | https://developer.android.com/guide/topics/connectivity/bluetooth/permissions#assert-never-for-location | ||
24 | --> | ||
25 | |||
26 | <!-- Needed if your app search for Bluetooth devices. --> | ||
27 | <!-- | ||
28 | If your app doesn't use Bluetooth scan results to derive physical location information, | ||
29 | you can strongly assert that your app doesn't derive physical location. | ||
30 | --> | ||
31 | <uses-permission android:name="android.permission.BLUETOOTH_SCAN" | ||
32 | android:usesPermissionFlags="neverForLocation" /> | ||
33 | <!-- Needed if you want to interact with a BLE device. --> | ||
34 | <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> | ||
35 | <!-- Needed if your app makes the current device discoverable to other Bluetooth devices. --> | ||
36 | <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" /> | ||
37 | |||
38 | <application | ||
6 | android:name=".MainApplication" | 39 | android:name=".MainApplication" |
7 | android:label="@string/app_name" | 40 | android:label="@string/app_name" |
8 | android:icon="@mipmap/ic_launcher" | 41 | android:icon="@mipmap/ic_launcher" |
9 | android:roundIcon="@mipmap/ic_launcher_round" | 42 | android:roundIcon="@mipmap/ic_launcher_round" |
10 | android:allowBackup="false" | 43 | android:allowBackup="false" |
11 | android:theme="@style/AppTheme"> | 44 | android:theme="@style/AppTheme"> |
12 | <activity | 45 | <activity |
13 | android:name=".MainActivity" | 46 | android:name=".MainActivity" |
14 | android:label="@string/app_name" | 47 | android:label="@string/app_name" |
15 | android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" | 48 | android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" |
16 | android:launchMode="singleTask" | 49 | android:launchMode="singleTask" |
17 | android:windowSoftInputMode="adjustResize" | 50 | android:windowSoftInputMode="adjustResize" |
18 | android:exported="true"> | 51 | android:exported="true"> |
19 | <intent-filter> | 52 | <intent-filter> |
20 | <action android:name="android.intent.action.MAIN" /> | 53 | <action android:name="android.intent.action.MAIN" /> |
21 | <category android:name="android.intent.category.LAUNCHER" /> | 54 | <category android:name="android.intent.category.LAUNCHER" /> |
22 | </intent-filter> | 55 | </intent-filter> |
23 | </activity> | 56 | </activity> |
24 | </application> | 57 | </application> |
25 | </manifest> | 58 | </manifest> |