Hi it may seem as a stupid question. But I did not find any answer for this, so posted here.
I am creating an indoor application which continually scans Bluetooth dongles located at different places in places like malls or libraries. As I take my hands in the mall with Android phone, the closest dongle I can connect with (I'm stupid, but I want to do something else). For this, I should be able to continuously scan for Bluetooth devices.
Please tell me how I can Android Android scans Bluetooth devices available from time to time.
I think it was very easy, but before I did not hit it, here the answer has been given,
Personal Bluetooth Adapter mBtAdapter; MBtAdapter.startDiscovery (); Private Final Broadcast Receiver MRECRE = New Broadcast Receiver () {@ Override Public Records on Receive (Context Reference, Intent of Intent) {String Action = Intent. Gate Action (); // When Discovery gets a device (Bluetooth device. Action_found angle (action)} {/ some do something} and if (bluetooth adapter.action.descovair_finence.ngle (action)) {log, "Enter the to the finid "); MBtAdapter.startDiscovery (); } This way we should start searching again at ACTION_DISCOVERY_FINISHED which will continuously scan for devices every 12 seconds.
Comments
Post a Comment