On Wed, Oct 1, 2014, at 08:18 AM, Michael Rogers wrote: > Interesting idea! With old school Bluetooth you can't make an Android > device discoverable for more than 2 minutes, and it requires user > confirmation each time. But maybe the situation's different with > Bluetooth LE? I haven't looked at the API yet.
Even without LE, it seems improved in recent APIs, up to 3600 seconds. http://stackoverflow.com/questions/3190623/make-bluetooth-on-android-2-1-discoverable-indefinitely See the following link: http://developer.android.com/guide/topics/wireless/bluetooth.html#ConnectingDevices Specifically, the last sentence in the paragraph below: Enabling discoverability If you would like to make the local device discoverable to other devices, call startActivityForResult(Intent, int) with the ACTION_REQUEST_DISCOVERABLE action Intent. This will issue a request to enable discoverable mode through the system settings (without stopping your application). By default, the device will become discoverable for 120 seconds. You can define a different duration by adding the EXTRA_DISCOVERABLE_DURATION Intent extra. The maximum duration an app can set is 3600 seconds, and a value of 0 means the device is always discoverable. So, this should work: Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 0); startActivity(discoverableIntent); _______________________________________________ Guardian-dev mailing list Post: [email protected] List info: https://lists.mayfirst.org/mailman/listinfo/guardian-dev To Unsubscribe Send email to: [email protected] Or visit: https://lists.mayfirst.org/mailman/options/guardian-dev/archive%40mail-archive.com You are subscribed as: [email protected]
