-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iBeacon Scan stops when using two Services #59
Comments
I fixed this problem and library is good to use. Please give it a try and tell me how it works. |
ahhh, wrong issues. sorry |
Do you see any errors in device logs? But from what I see is that you need to connect to BeaconManager first (as it is services underneath). See https://github.com/Estimote/Android-SDK#usage-and-demos and pay attention to #connect method invocation before startRanging method. |
I changed it in the way you mentioned:
But it is the same behavior. BLE Scan doesn't start.
|
Can you enable debug logging by: Side question: if you download Estimote app from Play Store, do you see your beacons? |
Yes I can see my beacons with the estimote app. I'will also receive beacons, when I don't start my own service, which handles gcm stuff. Log when debugging is en abled.
When I add the `àndroid:process=:my_process`` tag to the estimote service it scans for beacons until the app dies. The problem is that a different SharedPreferences in the RangingListener and in the app, so it is no solution for me. |
Fix for remote process (android:process=:my_process) I have just submitted. From logs it looks like it starts ranging. Can you pass null as proximity id (that is new Region("id", null, null, null)? Do you have any services in remote processes? |
Logs with null:
Nope there is no service which runs in seperated process, right now. |
Problem lies here that you start ranging at 22:07:00.063 and stops at 22:07:00.423 so there is no chance that you can find any beacons. For some reason you are stopping ranging or disconnecting from service. Can you check that? |
Well I think the problem is start different service in the same process. As I mentioned before, when I don't start my process the scanning works well. |
Recommended way is to hold only one instance of BeaconManager and communicate with that instance. Can you do that? |
I only have one instance of the BeaconManager. My own Service does something completely different, which has nothing to do with beacons. I uploaded my code to github https://github.com/ganddev/Shoplytics hopefully it's much easier to talk about the problem. |
Can you check if BeaconScanService is not getting onDestroy invoked too quickly? |
Sorry, I uploaded to much code. BeaconScanService is not started in that version. so onDestroy is not called. Now I moved everything back so BeaconScanService is started. BLE Scan now works but the problem is there is no good/ safe way to access sharedpreferences between to processes. |
Hi
I'm trying to use GCM and iBeacon in one app. For the registration to GCM I use a service and start it as following in the onCreate of the activity:
After that I want to scan for iBeacons, with the BeaconManager.
The problem is that the app doesn't start BLE scan for iBeacons. When I don't start the GCM Service, everything works fine. Is it a bug in the SDK or do I something wrong?
The text was updated successfully, but these errors were encountered: