L1. LAB 1: GETTING FAMILIAR WITH ANDROID SOFTWARE TOOLS 25
In order to find the SDK path, launch Android Studio and find the SDK location:
File > Project Structure > SDK Location: “Android SDK location”
e path for the SDK and platform tools directories is:
PATH: PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Once NDK is downloaded, set the NDK location to: home/dev folder (/dev) .
It is worth noting that the Android NDK or SDK folders should not be appear inside
each other.
Set the ANDROID_NDK_HOME environment variable to the directory where the NDK is
installed; for example:
export ANDROID_NDK_HOME=~/dev/android-ndk-r14b
en the NDK directory should be added to PATH:
export PATH=$PATH:$ANDROID_NDK_HOME
e SDK is usually installed in the library. In order to find the folder, use cd ~/Library ,
and then open ~/Library/ in the terminal to find full path of SDK.
To check, write the following command in the terminal:
nano~/.bash_profile
en, in the nano~/bash_profile, write these commands (see Figure 2.17):
export ANDROID_HOME={YOUR_PATH}
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export ANDROID_NDK_HOME=[NDK_PATH]/android-ndk-[version]
export PATH=$PATH:$ANDROID_NDK_HOME
L1 LAB 1:
GETTING FAMILIAR WITH ANDROID SOFTWARE
TOOLS
is lab covers a simple app on the Android smartphone platform by constructing a “Hello
world!” program. Android Studio and NDK tools are used for code development, emulation,
and code debugging. All the codes needed for this and other labs can be extracted from the
package mentioned in Chapter 1. Start by launching Android Studio, and if not already done,
set up an Android Virtual Device (AVD) for use with the Android emulator.
• Begin by creating a new Android project using the Quick Start menu found on the Android
Studio home screen.