Comments (2)
Yes, you can stop scanning with a foreground service simply by calling beaconManager.stopRanging(region)
and beaconManager.stopMonitoring(region)
for all regions being ranged and monitored. Doing so will cause the foreground service to exit. After you have done that, you can call disableForegroundServiceScanning()
and the start ranging and monitoring again.
Because the APIs to stop a service on Android are asynchronous, it will take a non-zero amount of time for the service to stop. Unfortunately there is no callback, so your best bet is to insert a delay of 100ms or so between stopping ranging/monitoring and restarting.
I will leave this issue open as a reminder to update the documentation to include the above.
from android-beacon-library.
Great! Thank you so much for your quick response!
from android-beacon-library.
Related Issues (20)
- App stops scanning right after screen is locked and starts giving the results right after unlocked HOT 1
- Android beacon library - multiple regions monitoring - unable remove regions HOT 2
- startForeground Exception when app is not in foreground HOT 3
- StartupBroadcastReceiver throws NullPointerException HOT 2
- No beacons after locked screen HOT 19
- Cannot parse iBeacons HOT 3
- BeaconService.startForegroundIfConfigured HOT 12
- TargetSdk 34 (android 14) Beacon foreground service no longer working due to new Google restriction HOT 1
- Do we have sample app to implement the library including the operation running in Background HOT 4
- Only a maximum of 2 beacons can be received at a time HOT 1
- java.io.FileNotFoundException android-distance.json HOT 3
- android-distance.json database not found
- Crash when parsing _lengthy_ beacon data fields HOT 3
- Custom Distance calculator is being overwritten HOT 6
- Samsung devices not detecting beacons by intent after first screen off
- Can we use this with tauri mobile? HOT 3
- Main thread can be blocked sometimes
- Android 14 didDetermineStateForRegion no beacon is detected or scanned HOT 2
- https://s3.amazonaws.com/android-beacon-library/android-distance.json,This network requests security questions.
- ScanJob restarts scanning every time on navigation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-beacon-library.