Closed CoreFloDev closed 9 years ago
Take a look at our Notification template for Android:
https://cloud.estimote.com/#/apps/add/notification
It shows how to request the appropriate permissions, the code to do that is in the MainActivity class.
Coming Soon™: we'll be updating Android tutorials and might add some helper methods to the SDK to request these permissions without you having to write all that code.
I've handled that problem in my smaller, personal project called ReactiveBeacons. Problem is described here: https://code.google.com/p/android/issues/detail?id=190372. It looks that BLE scan in Android 6 requires Location permissions in order to start scan.
To fix this problem, you have to do the following things:
ACCESS_FINE_LOCATION
permission to your ManifestACCESS_COARSE_LOCATION
permission to your ManifestYou can also handle permissions with the new permission model introduced in API 23 (Android 6). If you want to do it in old-fashioned (pre-Marshmallow) way, you can simply add permissions to the Manifest and set targetApi to 22 (Lollipop).
Please note that you will not see any beacons until you enable Location in your phone as well as Bluetooth.
It is more complicated than that. I'm already working on permissions and let me draw bigger picture.
On Android M it is as you had written when your app is targeting SDK 23. Although you need one of location permissions, no need to have both.
If your app is targeting <23 and is run on Android L or earlier, you need to acquire one of the location permissions only for background scanning.
See source code of Android M: https://android.googlesource.com/platform/packages/apps/Bluetooth/+/master/src/com/android/bluetooth/Utils.java#277
I did the same like pwittchen said. First, I add
uses-permissionandroid:name="android.permission.ACCESS_FINE_LOCATION"
uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
at AndroidManifest.xml and I clicked build.gradle, my targetSdkVersion is 24, and minSdkVersion 21. So I changed the targetSdkVersion from 24 to 22. The code worked succesful.
Hi,
It seems that there is some missing permissions on the SDK for Mashmallow. I tried the same application on two devices one on 6.0 and the other on 5.1.
On the 5.1, everything is working fine, the SDK and the estimote application to configure the beacon.
On the 6.0, the estimote application is working but when I use the SDK, I get this error from a BeaconManager.MonitoringListener() :
Am i missing something or it is an error from the SDK ?