如何编译和运行C Android系统/ C ++程序程序、系统、Android

2023-09-03 22:26:57 作者:我会很好'甚至更好

Q1)我想是我的机器上使用的Windows XP 操作系统上运行的Andr​​oid emulator.I一个简单的C程序。我已经安装了 SDK,JDK,日食为Android开发,并成功的AVD运行Android应用程序。

Q1) I want to run a simple c program on android emulator.I am using windows xp os on my machine. I have installed sdk, jdk, eclipse for android development and succeeded running android application on AVD.

Q2)我只需要知道有没有什么办法来运行 AVD C程序(没有任何Java)。在我的机器我已经安装了手臂,用我所编译的C程序。

Q2) I just need to know is there any way to run a C program(without any java) on AVD. On my machine I have installed arm and using that I have compiled a C program.

第三季)我也想知道是否有可能已编译的二进制推入Android设备或 AVD ,并使用Android设备或终端运行 AVD

Q3) I also want to know is it possible to push the compiled binary into android device or AVD and run using the terminal of the android device or AVD?

推荐答案

您可以用ARM交叉编译器编译C程序:

You can compile your C programs with an ARM cross compiler:

arm-linux-gnueabi-gcc -static -march=armv7 test.c -o test

然后你可以把你的编译好的二进制文件的地方(不要将其推入到SD卡):

Then you can push your compiled binary file to somewhere (don't push it in to the sdcard):

adb push test /data/local/tmp/test