Forum Xamarin.Android

Equivalent values for Android bluetooth constants

KeesPaulKeesPaul NLMember ✭✭

In Android one can use the following code to check for the state change of bluetooth returned in a broadcast receiver message:

if (BluetoothAdapter.ACTION_STATE_CHANGED.equals(action)) {
if (intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1) == BluetoothAdapter.STATE_OFF)
....
Where can I find the equivalent constants for Xamarin Android? Or should this be handled differently, and how?

Best Answer

Answers

  • GrahamMcKechnieGrahamMcKechnie AUMember ✭✭✭

    Use the object browser to browse BluetoothAdapter in the namespace Android.Bluetooth

  • KeesPaulKeesPaul NLMember ✭✭

    Browsing the namespace Android.Bluetooth I did find (before):
    public const string ExtraState = "android.bluetooth.adapter.extra.STATE";
    but the problem is:
    I can not find the equivalent for Android.Bluetooth.BluetoothAdapter.STATE_OFF, STATE_TURNING_OFF etc.
    Should I define these myself? What am I missing?

  • KeesPaulKeesPaul NLMember ✭✭

    Thanks this will do indeed. Thanks.

Sign In or Register to comment.