Thursday, September 12, 2013

Python On Android

For Python Lovers out there, this might interest you. Many people have frowned over having to read through all the documentations for App development on Android. This will provide you a fast way to get what you want to run on your Android phone. Although it does not have full functionality of the development pack it will allow you to do simple automation that you might want to do.

Step 1.
You will need to install both Python for Android and SLA4 onto your Android phone. However, they are considered "unknown application" so you have to allow unknown application to install on your phone by checking the option at setting->security.

I shall not go through the installation as it is rather straight forward.

Step 2.
Next you are ready to code in Python!! Just start SLA4A application and you will see a list of sample scripts there.


The API for Python on Android can be found here and you can find some tutorial here. Also do note that similar to Python on PC, you will also be able to install packages and use it when it is available.

A few interesting things you will be able to do with this...

  1. Take photo/video
  2. Location discovery
  3. Bluetooth connectivity
  4. SMS
  5. Whatsapp (I have not tried this myself)

A sample example I did here is to use location discovery to get the coordinate of the current location. Using this coordinates, I launch Google Map and it will display your location.

No comments:

Post a Comment