I am writing an app that requires the option to keep Bluetooth on, allows the device to be discoverable for a period of time, and when an activity has been completed by the user manually turn off discoverable but keep Bluetooth active.
Since the user activity may take a variable amount of time simply setting the number of seconds discoverable isn't really feasible.
I can make it happen by using this:
Dim TimeDiscoverable As Int
TimeDiscoverable = 1
ToastMessageShow("Time discoverable: " & TimeDiscoverable, True)
Dim i As Intent
i.Initialize("android.bluetooth.adapter.action.REQUEST_DISCOVERABLE", "")
i.PutExtra("android.bluetooth.adapter.extra.DISCOVERABLE_DURATION", TimeDiscoverable)
StartActivity(i)
SerialAdapter.Listen
which is a bit clunky...is there a way to do this?
:sign0104:
Since the user activity may take a variable amount of time simply setting the number of seconds discoverable isn't really feasible.
I can make it happen by using this:
Dim TimeDiscoverable As Int
TimeDiscoverable = 1
ToastMessageShow("Time discoverable: " & TimeDiscoverable, True)
Dim i As Intent
i.Initialize("android.bluetooth.adapter.action.REQUEST_DISCOVERABLE", "")
i.PutExtra("android.bluetooth.adapter.extra.DISCOVERABLE_DURATION", TimeDiscoverable)
StartActivity(i)
SerialAdapter.Listen
which is a bit clunky...is there a way to do this?
:sign0104: