Chapter II
Linux drivers require Android apps as well as Android NDK programs to test Linux drivers. Therefore, it is not necessary to configure the Linux driver development environment, but also to configure the development environment for developing Android applications and Android NDK programs.
Required tools: Jdk6 or above, Eclipse 3.4 or later, ADT, CDT, Android SDK, Android NDk, cross-compilation environment, Linux kernel source code, Android source code, Serial tool for debugging the Development Board: Minicom.
Build an Android application development environment:
Install the Android SDK.
Install Eclipse.
Install ADT.
To configure ADT: Window-preferences in Eclipse, click on the left Android node and enter the Android SDK installation directory in the SDK location on the right.
Create AVD: Launch Eclipse, click Launch Android virtual Device Manager. In the Android Virtual Device Manager interface, select "Device Definition" (define devices), the new ADT in addition to create AVD, select the desired device type (here choose 4 inch 480*800) Click Create AVD, Name the AVD, select the device type, Android version, skin, while setting good memory, SDcard, etc., click "OK" to create.
Install the Android NDK development environment:
Download Android NDK.
Install the CDT.
Command-line compiling Android NDK program: Its core idea is actually very simple, is to use the NDK provided by the ARM-LINUX-ANDROIDEABI-GCC instead of Linux under the GCC tool, using the NDK provided by the C header file/library file directory instead of Linux Under the default directory, in fact, when using GCC compile the default sysroot settings for the local "/" directory, equivalent to the following command:
$ gcc-o main.out main.c--sysroot=/
Configure the Android NDK integrated development environment.
Finally, the cross-compilation environment can be installed.
Reading notes Chapter II