Skip to content

Commit 21bdc8b

Browse files
committed
Readme updated
1 parent 4c888d7 commit 21bdc8b

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

moustache/README.mo

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ This is much less battery friendly than when the original method is used, but wo
2222
a lot of development time if such feature should be implemented anyway. Please read below
2323
for more details.
2424

25+
Note, that for unfiltered scans, scanning is stopped on screen off to save power. Scanning is
26+
resumed when screen is turned on again. To avoid this, use scanning with desired ScanFilter.
27+
2528
## Usage
2629

2730
The compat library may be found on Maven Central repository. Add it to your project by adding the
@@ -31,6 +34,8 @@ following dependency:
3134
implementation 'no.nordicsemi.android.support.v18:scanner:{{VERSION}}'
3235
```
3336

37+
If you are not targeting API 31 (Android 12), use version 1.5.1.
38+
3439
Projects not migrated to Android Jetpack should use version 1.3.1, which is feature-equal to 1.4.0.
3540

3641
As JCenter has shut down, starting from version 1.4.4 the library is available only on Maven Central.
@@ -57,10 +62,21 @@ already enabled desugaring. But if this causes problems for you, please use vers
5762

5863
Following [this](https://developer.android.com/reference/android/bluetooth/le/BluetoothLeScanner#startScan(android.bluetooth.le.ScanCallback)) link:
5964

60-
> An app must have [ACCESS_COARSE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION) permission in order to get results. An App targeting Android Q or later must have [ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION) permission in order to get results.
61-
For apps targeting [Build.VERSION_CODES#R](https://developer.android.com/reference/android/os/Build.VERSION_CODES#R) or lower, this requires the [Manifest.permission#BLUETOOTH_ADMIN](https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_ADMIN) permission which can be gained with a simple `<uses-permission>` manifest tag.
62-
For apps targeting [Build.VERSION_CODES#S](https://developer.android.com/reference/android/os/Build.VERSION_CODES#S) or or higher, this requires the [Manifest.permission#BLUETOOTH_SCAN](https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_SCAN) permission which can be gained with [Activity.requestPermissions(String[], int)](https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)).
63-
In addition, this requires either the [Manifest.permission#ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION) permission or a strong assertion that you will never derive the physical location of the device. You can make this assertion by declaring `usesPermissionFlags="neverForLocation"` on the relevant `<uses-permission>` manifest tag, but it may restrict the types of Bluetooth devices you can interact with.
65+
> An app must have [ACCESS_COARSE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION)
66+
permission in order to get results. An App targeting Android Q or later must have
67+
[ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)
68+
permission in order to get results.
69+
For apps targeting [Build.VERSION_CODES#R](https://developer.android.com/reference/android/os/Build.VERSION_CODES#R)
70+
or lower, this requires the [Manifest.permission#BLUETOOTH_ADMIN](https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_ADMIN)
71+
permission which can be gained with a simple `<uses-permission>` manifest tag.
72+
For apps targeting [Build.VERSION_CODES#S](https://developer.android.com/reference/android/os/Build.VERSION_CODES#S)
73+
or or higher, this requires the [Manifest.permission#BLUETOOTH_SCAN](https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_SCAN)
74+
permission which can be gained with
75+
[Activity.requestPermissions(String[], int)](https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)).
76+
In addition, this requires either the [Manifest.permission#ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)
77+
permission or a strong assertion that you will never derive the physical location of the device.
78+
You can make this assertion by declaring `usesPermissionFlags="neverForLocation"` on the relevant
79+
`<uses-permission>` manifest tag, but it may restrict the types of Bluetooth devices you can interact with.
6480

6581
## API
6682

@@ -178,7 +194,7 @@ the application. No changes are required to make it work.
178194
To use this feature:
179195

180196
```java
181-
Intent intent = new Intent(context, MyReceiver.class); // explicite intent
197+
Intent intent = new Intent(context, MyReceiver.class); // explicit intent
182198
intent.setAction("com.example.ACTION_FOUND");
183199
intent.putExtra("some.extra", value); // optional
184200
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, requestCode, intent, PendingIntent.FLAG_UPDATE_CURRENT);
@@ -193,7 +209,7 @@ To use this feature:
193209
scanner.startScan(filters, settings, context, pendingIntent, requestCode);
194210
```
195211

196-
Add your `MyRecever` to *AndroidManifest*, as the application context might have been released
212+
Add your `MyReceiver` to *AndroidManifest*, as the application context might have been released
197213
and all broadcast receivers registered to it together with it.
198214

199215
To stop scanning call:
@@ -227,6 +243,9 @@ Background scanning on Android 4.3 and 4.4.x will use a lot of power, as all tho
227243
will have to be emulated. It is recommended to scan in background only on Lollipop or newer, or
228244
even Oreo or newer devices and giving the user an option to disable this feature.
229245

246+
Note, that for unfiltered scans, scanning is stopped on screen off to save power. Scanning is
247+
resumed when screen is turned on again. To avoid this, use scanning with desired ScanFilter.
248+
230249
## License
231250

232251
The Scanner Compat library is available under BSD 3-Clause license. See the LICENSE file for more info.

0 commit comments

Comments
 (0)