dimanche 17 mai 2015

Basic4Android BlueTooth Monitoring?

This might be a bit of a long shot, but here goes.

I use a Basic4android app I have created to connect to an external Bluetooth Barcode Scanner, The Unitech MS910. I can connect and receive the scanned barcodes in my app with no issues.

The MS910 has a button that you press in order to start the scanner scanning, I have noticed in a couple of other android applications that they are able to open the keyboard on the android phone by double clicking the button on the scanner and this is the functionality I would like to be able to include in my application.

The scanner connects to the app via a Serial Connection, which raises an event when new Text/Data is avalible on the connection, the problem is as just clicking the button does create any text and this event is not raised.

Having done lots of searching for an answer I have found that events from Bluetooth can be accessed via intents, as an example, to capture the connected event, I add the Following to the manifest :

AddPermission(android.permission.BLUETOOTH)

AddReceiverText(**s1**, <intent-filter>
 <action android:name="android.bluetooth.device.action.ACL_CONNECTED"/>
 </intent-filter>)

Using a Service called s1, I can get the event as follows

Sub Service_Start (StartingIntent As Intent)
   Log(StartingIntent)
   Log(StartingIntent.ExtrasToString)
End Sub

I think the button click may also fire an event ?, but I'm not sure what the text would need to be in the manifest or what the would be.

So I was wondering if anybody out there has any idea what I'm talking about, and could point me in the right direction.

Regards & Thanks

Potman

Aucun commentaire:

Enregistrer un commentaire