• Hi,
    I would like to listen for a Puck.js message in background using Android. Currently I have the problem that BLE scans for advertisements stop after some time (1-2 minutes). What is the recommended way to read a message send by the Puck.js in a background service?

  • I'm afraid I don't have any real experience of Android's BLE scanning - maybe someone else will be able to jump in here.

    However perhaps just scanning for a few seconds every minute would be enough? I imagine it might cause considerable battery drain scanning all the time.

    To get it 100% reliable I guess you may be able to just connect and keep the connection open rather than using advertising? Newer versions of Espruino (at least 2v01 and above, probably before) are pretty efficient when connected.

    You may also have some success modifying your Puck.js to broadcast an Eddystone packet - I don't know if Android will give your app a little more control over scanning in that case?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Listening for Puck.js message in background using Android?

Posted by Avatar for MobiTech @MobiTech