If you wanted to use the Android to do a little python scripting, then you can use the PythonAndroidAPI through the Android Scripting Environment (ASE).
Matt Cutts shows a six-line proof of concept barcode scanner sent to him by Vijayakrishna Griddaluru, republished below. Also, Included are two more examples of android-scripting.
Sample BarCode Scanner
import android
droid = android.Android()
code [...]
