Python + Bluetooth + Android = …

Had some fun writing the base API and client functions for an inventory control software this weekend. I’ve learned a little bit about Bluetooth and working with Python on Android (with the aid of SL4A) along with writing an API in Perl.

So far I have a basic command line client which will return results on a product that is scanned in or the name typed in, and if a product does not exist, one may add that product to the database. I also have the basic API which is written in Perl done. It simply query’s the database and replies to whatever called it with JSON encoded data from the database. To top everything off there is a phone application written in Python with the aid of SL4A, which turns an Android phone into a Bluetooth barcode scanner for the client.

More on this to come this week when I have time.

While I was doing this, I began to work with Python and the Bluez Bluetooth stack, along with interfacing with the Bluetooth stack on Android with Python. As a result, I also made a quick little script which turns the phone into a Bluetooth barcode scanner which emulates a keyboard. Yep, every barcode scanned is “typed” into the computer :D

All the code for both projects are available on Github: