Scanning in separate process not working
See original GitHub issueUsing the library (ranging notifier) inside android service, running in a separate process (android:process
tag in manifest) yields no results nor throwing any exception or error. Removing the android:process
tag from the services makes the same code work.
Note: I’m not trying to run the service in one process and get the result in main process. Everything regarding AltBeacon is solely in the service (and service’s process).
Expected behavior - I can get results for nearby beacons or get an error if the configuration is wrong
Actual behavior - getting no readings at all nor error that something is awry
Steps to reproduce this behavior - create a service running in a separate process and implement beacon ranging (for example similar to Ranging Example Code here https://altbeacon.github.io/android-beacon-library/samples.html)
Mobile device model and OS version Samsung Galagy S8 running Oreo
Android Beacon Library version 2.16.1
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to Fix Scanner Not Working in Windows 10 - Driver Easy
Solution 1: Repair Corrupted System Files · 1) Hold Down Windows logo and press R key at the same time to invoke the...
Read more >How to Fix Scanner Not Working in Windows 10 [Quick FIX]
How to Fix Scanner Not Working in Windows 10 [Quick FIX]If your HP, Canon, Epson, or any other Scanner is not working on...
Read more >Troubleshoot scanner issues when scanning using Acrobat
1. Verify that the scanner works by scanning in another application. ... Verify that the scanner works properly by scanning into another ...
Read more >Troubleshooting Document Processing scans, including OCR
The PaperCut OCR Service could not convert the scan job by {username} on {deviceName} to a searchable format. This error can occur for...
Read more >Automated Scanner Troubleshooting Utility - HP Support
Resolve HP scanning issues using our HP Print and Scan diagnostic tool or automated HP Virtual Agent or follow manual troubleshooting steps provided...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, thanks for additional info. Actually I’ve made some progress.
It more or less works with
beaconManager.setEnableScheduledScanJobs(false)
and withoverridden in manifest.
Only funny thing I see is that even when the app and service is in foreground (running in foreground mode) I’m receiving scans every 5 minutes which is what I set for background scans
beaconManager.setBackgroundBetweenScanPeriod(300000L)
. So it looks to me that it is somehow “operating in backround mode” all the time.When you have a service running in a separate process things get strange. Because there are two processes, that means there are two copies of every singleton object. That means two BeaconManager instances and two Application instances. I had to build the library so that is OK. The library detects if the scanning process is separate, and then knows whether the BeaconManager is the one in the main process or the scanning process. Settings are marshalled between the the BeaconManager instance on the main process and the one on the secondary scanning process.
In the reference implementation, both instances of the Application class implement BootstrapNotifier (they must be the same!) but the background scanning variant never starts up RegionBootstrap so it never gets the callbacks. (Confusing, but it works!)
I probably need a deeper explanation of where you set up RegionBootstrap and BackgroundPowerSaver to be helpful. I have not tested other setups.