It's exiting to learn to make app on Android with python. But when I check <Head First Python>, I found there was a lot of programming to download, to install, and a lot of set-up, a lot of configure...To make long story short, I record here every steps and the exception I encountered in each step for reference.
step 1: Set up development environment.
Item : Android emulator, a cross-platform provided by Google for you to develop without any hardware.
- Download the "Software Development Kit"(SDK).
- Add an android platform using "SDK Manager", to mimic the real phone setup.
- All the details about setup can be easily found in http://developer.android.com/sdk/index.html, like where to find SDK Manager and how to install platform or package within it http://developer.android.com/sdk/installing/adding-packages.html. The website provides a comprhensive and awsome guidence to follow !
- After downloading the platform, a line "Done. Nothing was installed." came up. The solution I found is to right click "SDK manager.exe" and select "Run as Administrator". It does work !
- The last problem is that when clicking "SDK manager.exe" and it just pop up and exit soon. But just check it looks well and HAVE NO IDEA how it happen.
- Create an "Android Virtual Device"(AVD).
- Select a "Device" option with low image resolution, or it will fail to start emulator for less memory.
- Download "SL4A" into emulator and install Android Scripting.
- Download "python for android" into emulator and add to SL4A.
- If fail to download apk into emulator, just try to reboost the emulator.
- Transfer a script to the emulator using adb , to test Python on Android.
- If raised "error: device offline" after input command line "adb devices" in terminal window, try to reboost the emulator.