BLE always works from Companion, "Sometimes" works if APK

51 views
Skip to first unread message

Frank R. Nichols

unread,
May 7, 2019, 1:10:42 PM5/7/19
to MIT App Inventor Forum
I've built my UI as I designed it - all is well.
Always connects to my BLE server if Companion 
Funny thing, though, if I build APK
It won't find my device, ever.
Reload APK, still no joy.
BUT
If I launch a "Generic" BLE scanner from the playstore, then exit that scanner...
Relaunch my APK works every time - and all is well.

BLE device is sending Heart Rate Monitor profile
BLE device and my 'droid phone are less than 12" apart
It's a matter of "finding" the BLE device with another app first, closing that app, then launching My app always connects just fine.

I'm using the 2016 'workaround' where I drop BluetoothClient1 into the designer, but never use it in Blocks
AND
the recent "Permissions" fix (on Screen1.Initialize ask for ACCESS_COARSE_LOCATION).

I'm wondering if anyone has similar experience and found a fix or workaround or can tell me what I'm forgetting to invoke in my code.

Thanks

Chris Ward

unread,
May 7, 2019, 3:35:45 PM5/7/19
to MIT App Inventor Forum
Hi again Frank

Let's see your latest Project File.

BodyMindPower

unread,
May 9, 2019, 9:57:41 AM5/9/19
to MIT App Inventor Forum
Hi Frank,

If I launch a "Generic" BLE scanner from the playstore, then exit that scanner...
Relaunch my APK works every time - and all is well.

check, if  the "Generic" BLE scanner has activated the location sensor ...

I have found something really strange:
If you enable the location sensor in the device settings before searching for BLE devices, BLE devices will be found with the Galaxy Note 8 (maybe also with Galaxy S9). Apparently a bug. But try it ...

Anke

Reply all
Reply to author
Forward
0 new messages