Estimote / Android-Fleet-Management-SDK

Estimote Fleet Management SDK for Android
https://developer.estimote.com
MIT License
836 stars 451 forks source link

beacon not detected in Android >= 7.0 #216

Closed manishpatelgt closed 7 years ago

manishpatelgt commented 7 years ago

I am using Estimote SDK 1.0.3 in one of my app. For testing purpose I have developed one app for Ranging but it's not detecting any beacon in Android 7.1.2

It's working fine in Android 5.1.1 and Android 6.1.2 or 6.0.1

pawelDylag commented 7 years ago

Hello @manishpatelgt

May I ask you to provide us with the details below?

  1. Your phone model
  2. Your scanning settings (foreground/background scan periods, beaconManager setup, etc)
  3. Some debug logs just after starting ranging.

Having all those informations we will proceed further :)

manishpatelgt commented 7 years ago

Ya Sure.

  1. Phone Model: Google Pixel XL

  2. Only for foreground. I tried with background too beaconManager.setForegroundScanPeriod(TimeUnit.SECONDS.toMillis(1), 0);

  3. It never go inside onBeaconsDiscovered(...) So can't see further logs.

I will try to debug again and give you more details if you want @pawelDylag

pawelDylag commented 7 years ago

@manishpatelgt

To verify that, I relaunched our test suite on Pixel XL phone with Android 7.1.2 - it seems to work fine.

May I ask you for your beacon setup? Are you using SecureUUID? Does your app (on Pixel phone) have location permission granted? You can also enable our debug logs with method: EstimoteSDK.enableDebugLogging(true)

manishpatelgt commented 7 years ago

@pawelDylag is that anything wrong with beaconManager.setForegroundScanPeriod(TimeUnit.SECONDS.toMillis(1), 0); ?

No I am not using SecureUUID and Location permission granted in my device.

Let me turn ON enableDebugLogging and try again.

loc02998375 commented 7 years ago

Are you using Estimote v1 beacon? I got 1.0.3 to work with v2 beacon just fine but not v1.

manishpatelgt commented 7 years ago

@loc02998375 Actually my boss purchased this so I don't know. Is there any way I can check version ?

Not sure if that's the version but I have cross checked in Cloud. I found all beacons have

Firmware Version : 4.9.4 Hardware Version : G1.8

Is that latest version ?

rajeshkanna777 commented 7 years ago

Am also using android 7.0 when device is goes deep sleep or doze mode beacon scanning stopped how to handle this, i want keep scanning beacon when device in doze mode .

giluna commented 7 years ago

@pawelDylag I'm facing the same problem as @manishpatelgt. I'm using LG G6 with Android 7.0 Here are few notes that might help with the QA:

  1. Ranging does work for Estimote default region but not for my custom region.
  2. Estimote SDK 1.0.0/1.0.1 do recognize my custom region.
  3. Same behavior for both Location Beacon (OS 4.9.3) and Proximity Beacon (OS 3.2.0).

Please fix. Gil.

ghost commented 7 years ago

@giluna @manishpatelgt Can you please let me know how you connect or start monitoring your beacon? I have tested in Android 6.0 and 7.0 and it works fine... Please check few points: All the permissions are properly as per the Estimote SDK requirement. https://github.com/Estimote/Android-SDK

pawelDylag commented 7 years ago

Hey!

We have released version 1.0.9 with slightly changed scanning mechanism on Nougat devices and fixed support for old D3.X beacons :)

manishpatelgt commented 7 years ago

@pawelDylag I am so happy to hear that. Thanks

doudasek commented 7 years ago

Hi!

@pawelDylag Thanks for new version. I have found strange behaviour while testing version 1.0.10 (the same for 1.0.9). I have Nexus 5X with Android 7.1.2 and testing with D3.4 beacons. When I tested it on my old Lenovo A6000 with Android 4.4.4, it seems ok.

It discovers first item after 7 seconds from calling startRanging() and the upcoming events comes every 5 seconds and the callback is called twice.

I use beaconManager.setForegroundScanPeriod(500, 0) but it only works on the Lenovo phone again.

See log:

07-26 13:37:03.759 29516-29516/ startRanging() called
07-26 13:37:10.429 29516-29516/ onBeaconsDiscovered() called with
07-26 13:37:10.459 29516-29516/ onBeaconsDiscovered() called with
07-26 13:37:15.482 29516-29516/ onBeaconsDiscovered() called with
07-26 13:37:15.520 29516-29516/ onBeaconsDiscovered() called with
pawelDylag commented 7 years ago

Hey @doudasek

This behaviour depends on phone model. We moved our internal scheduling mechanism to rely on Android BLE stack responses. So basically, since Nougat all reported times are inexact and dependent on the phone model. This allows our SDK to be fully compatible with Android system improvements and puts priority on battery efficiency. We are still working on that and current SDK version is the first iteration of this idea. We found our old solution not fully compatible, it caused lots of errors in scanning stack. We rather want our SDK to report scans in inexact time than to throw errors and not scan at all. Besides, we are working on something completely new for scanning advertised packets - stay tuned :)

sebasecheverry commented 7 years ago

Hi, i have a problem with the sdk on android. We are using an android versión 5.02 and android version 7. they work different but not correctly. It doesn't scan consistently all the devices and it usually only scans one. sometimes it scans all 3 with the same code. We don't know whats happening.

pawelDylag commented 7 years ago

I encourage you to try our new ProximitySDK 🚀 - it is dedicated for creating proximity interactions with our beacons - its main focus is to deliver the reliable enter/exit experience according to a different zones of beacons, based on our own data-science, and Estimote Monitoring packet. It works extremely well with Android 5.0-8.0 devices (full support for Nougat, and Oreo included), and also allows you to configure it to keep scanning in the background.

Here is the official repository page -> https://github.com/Estimote/Android-Proximity-SDK

Also, we keep posting updates about the progress of our development on this thread at our forums. I encourage you to track it in order to be super up-to-date :)

Please, check the mentioned new SDK - the current SDK will soon be deprecated, and we will support only critical issues for some time.

playground commented 6 years ago

hi @pawelDylag I'm experiencing the same issue with the beacons Firmware Version 4.9.4 Hardware Version F3.3

My Pixel 2 XL is not picking up any of the EddyStone URL beacons.