Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Public BTadmin As BluetoothAdmin
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
'Enable Bluetooth ---------------
BTadmin.Initialize("BTadmin")
If BTadmin.IsEnabled = False Then
If BTadmin.Enable = False Then
ToastMessageShow("Error enabling Bluetooth adapter.", True)
Else
ToastMessageShow("Enabling Bluetooth adapter...", False)
End If
End If
End Sub
Private Sub BTadmin_StateChanged (NewState As Int, OldState As Int)
Log("BT state changed: " & NewState)
If NewState = BTadmin.STATE_ON Then ToastMessageShow(" Bluetooth adapter Enabled", False)
End Sub