W4118 OPERATING SYSTEMS I

Fall 2013 -- Junfeng Yang

Install Android SDK and NDK

To complete the assignments, you need to install Android SDK and NDK.

With Android SDK, you can build Android applications. The tools contained in the Android SDK are necessary for us to communicate with the device.

With Android NDK, you can build native libraries for your Androd applications. Native code usually runs faster than the Java byte code. We will use NDK to build native programs in the assignments.

1. Install Android SDK

Go to http://developer.android.com/sdk/index.html, download "SDK Tools only" for Linux. Extract it, and run tools/android. Select "Platform tools" and click install.

An alternative method is downloading HW2's Makefile and run "make sdk".

2. Install Android NDK

Go to http://developer.android.com/tools/sdk/ndk/index.html, download the Android NDK for your platform, usually Linux 64-bit (x86). Extract it.

An alternative method is downloading HW2's Makefile and run "make ndk".

3. Install 32bit support library

If you are running under a 64bit system, you need 32bit support libraries to run the sdk tools.

For Ubuntu/Debian/Linux Mint, run

    sudo apt-get install ia32-libs
For Fedora/CentOS/SUSE, run
    sudo yum install glibc.i686 libstdc++.i686 libgcc.i686
For Arch Linux, run
    sudo pacman -S lib32-glibc lib32-gcc-libs

4. Add SDK and NDK to your PATH

When you run a command, your shell finds the command in the directories specified in the environment variable PATH. If you add the directories containing tools to PATH, you can type just the command name to run the tool. For example, you may type "adb" to run the Android Debugging Bridge tool. If you don't do this, you need to specify the full path every time, which is inconvenient.

Suppose you put SDK and NDK in /home/w4118/. After extraction, you should get SDK in android-sdk-linux and NDK in android-ndk-r9. Add this line to your ~/.bashrc:

    export PATH=$HOME/android-sdk-linux/platform-tools:$HOME/android-sdk-linux/tools:$HOME/android-ndk-r9:$PATH 
If you put them at somewhere else, please change the $HOME part to your directory.

5. Verify that SDK and NDK are correctly installed

Run
    adb 
to verify that adb is now in PATH. You should see the help information printed by adb. Perform similar checks with fastboot and ndk-build.