June 10, 2009
5:46 am
Google Android: 6 lines of Python-based ‘barcode scanner’
If you own a Google Android-based phone, you don’t need a bar code scanner. Instead, you can use the following six lines of code written in Python to use your Android phone as barcode scanner:
import android
droid = android.Android()
code = droid.scanBarcode()
isbn = int(code['result']['SCAN_RESULT'])
url = “http://books.google.com?q=%d” % isbn
droid.startActivity(’android.intent.action.VIEW’, url)
Not only can you scan bar codes, you can use text-to-speech, make phone calls, send text messages, read sensor data, and find your location--all from easy scripts. Check out Android Scripting Environment (ASE).
Source:→ Matt Cutts
Loading

Leave a comment »