Friday, June 11, 2010

[android-developers] Re: Disable Bluetooth discoverable mode

Have you figured out how to start the discoverable mode without having
to request the user to press YES? I am having a similar problem as
you. I wanted to have my app to be able to use the bluetooth and be
discoverable automatically and without turning off after a certain
amount of time.

Have you tried mBluetoothAdapter.cancelDiscovery() or have some way to
check the remaining time?

On May 31, 5:58 pm, Venator85 <venato...@gmail.com> wrote:
> Hi, I found in theAndroiddocumentation how to turnBluetooth
> discoverability mode on:
>
> Intent discoverableIntent = new
> Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
> discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION,
> 300);
> startActivity(discoverableIntent);
> This will make the devicediscoverablefor 300 seconds.
>
> My question is: how to turn discoverability OFF before this timeout
> occurs? I'd like to replicate the corresponding setting in Settings|
> Wireless and networks|Bluetoothsettings applet, that allows
> discoverability to be turned on and off with a click.
>
> Any help?
>
> Thanks ;)

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment