Looking for some pointers to get me started.
In my left hand I have a SGS2 running ICS. I’ve got SL4A up and running and have installed Python 2.6.2
In my right hand I’ve got a generic chinese bluetooth RFID reader. It works, it reads tags (it has a display) and it’s paired with the phone.
I’d like them to play nicely – I want to script something that will keep watching the device and capture the codes as they are transmitted.
I’m no Python expert but I’ve been using it for some time now for building simple I/O jobs on web servers so I can just about find my way around.
Unusually though, I’m having real problems getting going with this – I can’t find any ‘getting started with Bluetooth and SL4A’ resources to get over that first step of establishing a persistent connection and monitoring output.
Any tips?
it seems that what you need is the bluetooth facade. Here are some commands pertaining to bluetooth that might be helpful to you:
To call any of these commands you would do something like
Here is an example of some bluetooth functions, it is included with SL4A, but I added the comments for clarity:
Finally, for a full list of bluetooth commands, check out http://code.google.com/p/android-scripting/wiki/ApiReference and scroll down to the bluetooth facade. Best of luck!