我尝试着将一款游戏移植到Android上,但它是基于C语言,而Android也支持Java,但我相信一定有一种方法能够将C应用带到Android上,有人知道如何实现这一目标吗?
当前回答
自2009年以来,这一问题有了进展。 用于Android的Qt(c++框架) 视频开始。
其他回答
从这一点来看,似乎是有可能的:
http://openhandsetmagazine.com/2007/11/running-c-native-applications-on-android-the-final-point/(现在只能通过WayBack Machine购买)
"the fact is only Java language is supported doesn’t mean that you cannot develop applications in other languages. This have been proved by many developers, hackers and experts in application development for mobile. The guys at Elements Interactive B.V., the company behind Edgelib library, succeeded to run native C++ applications on the Android platform, even that at this time there is still many issues on display and sound … etc. This include the S-Tris2 game and a 3D animation demo of Edgelib."
这篇博客文章可能是一个好的开始:http://benno.id.au/blog/2007/11/13/android-native-apps 不幸的是,很多重要的东西都“留给读者做练习”。
您可以下载c4droid,然后安装GCC插件并安装到SD上。从shell,我只是遍历到GCC二进制文件所在的目录,然后调用它,使其成为板上可执行文件。
查找/ -name GCC
/mnt/sdcard/Android/data/com.n0n3m4.droidc/files/gcc/bin/arm-linux-androideabi-gcc
猫>测试
#include<stdio.h>
int main(){
printf("hello arm!\n");
return 0;
}
./arm-linux-androideabi-gcc test.c -o test
/测试。
你好手臂!
自2009年以来,这一问题有了进展。 用于Android的Qt(c++框架) 视频开始。
看看谷歌ndk组,它看起来很有前途,ndk的第一个版本将在2009年上半年发布。
更新: 它发布于http://android-developers.blogspot.com/2009/06/introducing-android-15-ndk-release-1.html
推荐文章
- 警告:API ' variable . getjavacompile()'已过时,已被' variable . getjavacompileprovider()'取代
- 安装APK时出现错误
- decltype(auto)的一些用途是什么?
- 碎片中的onCreateOptionsMenu
- Shared_ptr转换为数组:应该使用它吗?
- 使用C返回一个数组
- Printf与std::字符串?
- 禁用复制构造函数
- TextView粗体通过XML文件?
- 如何使线性布局的孩子之间的空间?
- 只接受特定类型的c++模板
- c#和Java中的泛型有什么不同?和模板在c++ ?
- DSL元素android.dataBinding。enabled'已过时,已被'android.buildFeatures.dataBinding'取代
- ConstraintLayout:以编程方式更改约束
- PANIC: AVD系统路径损坏。检查ANDROID_SDK_ROOT值