What tools are needed for 2.1android bottom-up development
Linux-driven development environment, Android application and development environment for Android NDK program, auxiliary tools test Linux driver and debug Development Board
2.2 Installing the JDK
To download the JDK, enter the following command on the Linux terminal to open the profile file to set the PATH environment variable
# getdit/etc/profile (Open profile)
Enter export path=.:/at the end of the file Developer/jdk6/bin: $PATH
After saving the profile file, under Linux terminal, enter one of the following two commands to reload the profile
# source/etc/profile (Source command)
# . /etc/profile (. command)
To view the value of the PATH environment variable: Echo $PATH
JDK6 can be installed directly under Ubuntu without the need to configure the PATH environment variable
2.3 Build Android App development environment
Built under Ubuntu Linux environment
Installing the Android SDK
Download and unzip, execute the script file named Android in the Androi-sdk-linux/tools directory
The Android SDK installation directory/platform-tools and Android SDK installation directory/tool contains many common tools, so to add these two directories to the PATH environment variable, also add code at the end of the profile file. Finally remember to save the profile file and execute the command in the profile
Install Eclipse
Installing and configuring ADT ADT is the plugin that Eclipse uses to develop Android apps
Build the AVD Android SDK for each Android version corresponds to a
2.4 Installing the Android NDK development environment
Android SDK must be installed before installing Android NDK
Download and unzip the Android NDK, locate the Ndk-build script file in the installation directory, compile the NDK program, and add the Android NDK installation directory to the PATH environment variable
Installing the CDT CDT is a plug-in used in eclipse for the development of A/C + + program that can be installed online and offline
Compile the Android NDK program just enter the example directory under the Linux terminal, enter the Ndk-build command to compile, the Android NDK source code in the JNI directory, the compiled target file in the Libs/armeabi directory
Import the <android ndk installation directory >/samples/*** into Eclipse and recompile it to run directly on your phone
Configuring the Android NDK integrated development environment, as long as you modify the contents of the Gl_code.cpp file in Eclipse, you can automatically compile the Gl_code.cpp file before generating the apk file.
2.5 Installing the cross-compilation environment
Cross-compilation environment refers to cross-compiler and related tools, including many executable files and a large number of shared libraries and header files and other resources
You can directly download and install a codesourcery cross-compilation environment, or you can directly use the CD in the book
You can place a cross-compiled path in the PATH environment variable
Test the cross-compilation environment
# arm-none-linux-gnueabi-gcc–static–o * * * ***.C (compiling ***.c file)
# ADB Push * * * * * */data/local (upload files to the/data/local directory of any Android device)
Use the ADB shell command to enter the console of the Android device and enter the/data/local directory to execute #./***
To see if the cross-compilation environment is set up by doing the right thing.
This chapter mainly introduces the configuration of the Android development environment in Ubuntu Linu environment.
Build an Android development environment