Easy-to-develop C programs on Android

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.