Sub Activity_Create(FirstTime As Boolean)
Dim btdisponibile As Boolean = stampante.RunMethod("isAvailable", Null)
If btdisponibile Then
stampante.RunMethod("connect", Array(MacBluetooth))
stampante.RunMethod("sendMessage", Array("Test", "GBK"))
........
End If
End Sub
Sub stampante As JavaObject
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim handler As JavaObject
handler.InitializeNewInstance("android.os.Handler", Null)
handler.CreateEventFromUI("android.os.Handler.Callback", "Callback" , Null)
Dim ir As JavaObject
Return ir.InitializeNewInstance("com.zj.btsdk.BluetoothService", Array(ctxt, handler))
End Sub
Sub Callback_Event (MethodName As String, Args() As Object) As Object
Log(MethodName)
Log(Args(0))
Return Null
End Sub