'''NOTE:''' python-for-android just has a major update in last few days. For compatability purpose, our current development is still based on the old version. 

To set up the development environment for MobileInsight2, please refer to the following instructions.

1. Download the src code of the python-for-android environment, an open-source framework which allows using Python to develop Android apps. The project's git repository locates at: https://github.com/kivy/python-for-android/tree/old_toolchain

NOTE: this project is under active development, and its API have changed rapidly in the beginning of Oct, 2015. We haven't update our code to the newest API yet, so please note that all instructions below are based on the "old_toolchain" branch.

2. Follow the official documentations to install python-for-android. However, since the doc of this project is not well-written, we need some extra works to set it up.

(1) Download the Android NDK and SDK versions that are specified on the git repo's [https://github.com/kivy/python-for-android/blob/old_toolchain/README.rst README] page, which is NDK r8c and SDK 14. Also, remember to set up your environment variables.

The Android NDK r8c can be downloaded here:
  
  http://dl.google.com/android/ndk/android-ndk-r8c-darwin-x86.tar.bz2 (for OS X)
  http://dl.google.com/android/ndk/android-ndk-r8c-linux-x86.tar.bz2 (for Linux)

The Android SDK 14 can be configured by Android update service.

(2) Install the necessary prerequisites using apt-get and python-pip. See http://python-for-android.readthedocs.org/en/latest/old_toolchain/toolchain/#prerequisites for details.

(3) Note that a known Cython issue (https://github.com/kivy/buildozer/issues/150) will cause errors in the coming steps. Use "pip install cython==0.20" to install the version we use.

3. Read step 4~8 on the git repo's README page to compile a "distribution", and to build an example app using the distribution.