0

I have developed a couple of apps for Android which use BLE. Since Android Marshmallow came out, I have updated my apps to use the Location permission and all is well.

However, I have two apps on my Samsung Galaxy S7 running Android 6.0.1, namely "Blue Gecko" by Silicon Labs and "CySmart" by Cypress, which are able to scan for and connect with BLE devices without asking me for location permission.

Both of these came from the Play store, so I'm thinking they must be "release" builds ("debug" builds assume some permissions for you so you don't have to ask).

How is that possible, and assuming there's an answer to that question, how do I do that with my apps?

Thanks!

-Ted

Ted
  • 76
  • 9
  • 1
    `targetSdkVersion`, perhaps. – CommonsWare Dec 21 '16 at 13:55
  • Hi CommonsWare. Good thought, but I don't think that's it. I had a released app targeting Lollipop that wouldn't scan BLE devices on Marshmallow devices without the permission. Meanwhile I was working on a new app targeting Marshmallow that wouldn't scan without the permission either. – Ted Dec 21 '16 at 14:16
  • Actually, you might be right, CommonsWare. I found this comment on a related question: [link](http://stackoverflow.com/a/39892691/3799262). I will check into that and let you know. – Ted Dec 21 '16 at 14:46
  • It's just a guess on my part. I haven't done much with the Bluetooth APIs yet. In general, when I see "why can App X do Thing Y on New-ish Android Version Z, and my app can't on Z?" questions, I start with `targetSdkVersion`. :-) – CommonsWare Dec 21 '16 at 14:49
  • You were right. I took out the location permission on my app and deployed it on a Marshmallow devices with the target SDK set to 22 and then again with it set to 23. When set to 22, the BLE device connects just fine without the location permission. When set to 23, it silently fails unless I put the permission back in. – Ted Dec 21 '16 at 20:22

0 Answers0