Suppose you are based without a dedicated development board practiced hand. Your Android phone is also capable of developing most C applications. Compile C after installing the compiler.
This article only writes a Hello world execution process.
The advantage is : No Eclipse, no need for Android Source code, no need to android.mk. The NDK is not required . A C Program Ape will be able to use Android very well , need a compiler and an adb to put the program into The Android system.
1. Installationadb
sudo apt-get install android-tools-adb
2. Installing the cross-tool chain
sudo apt-get install Gcc-arm-linux-gnueabi
3.compilingHello Worldprogram
ARM-LINUX-GNUEABI-GCC hello.c-static
Note : This is a static link. Otherwise, the library file will not be found.
4.will bea.outpush toAndroidon
ADB push a.out/data/
5.ExecutionHello World
ADB shell/data/a.out
Results:
$ adb shell/data/a.out
Hello world!
$
End: Here is just a Hello world, In fact very many programs can be developed in this area , for example framebuffer c11> or something. To play with the Android There are a lot of things that need to be familiar with various tools. Assume that only one aspect is used. Be able to use the other as little as possible.
C programs that are easy to develop on Android