如何开发一个使用Android源代码的C文件的应用程序

时间:2020-12-16 00:23:28

I want to develop an Android application that uses a c file from Android source code. I know I can use NDK for using C/C++ files. But, I don't know whether I can use a c file from Android source or not. I want to use it because I want to use a function of it. Is it possible to use system functions with java application?

我想开发一个使用Android源代码的c文件的Android应用程序。我知道我可以使用NDK来使用C / C ++文件。但是,我不知道我是否可以使用Android源码中的c文件。我想使用它,因为我想使用它的功能。是否可以将系统函数与java应用程序一起使用?

1 个解决方案

#1


0  

As far as incorporating C code directly in Android Dalvik code, I'm not sure that's possible without compiling through the NDK and including it as a library. This may help, in particular the 3rd demo (about 36 mins in) which shows implementing an algorithm in C and calling it from Android Dalvik code.

至于直接在Android Dalvik代码中合并C代码,我不确定如果不编译NDK并将其作为库包含它是可能的。这可能有所帮助,特别是第三个演示(大约36分钟),它显示了在C中实现算法并从Android Dalvik代码调用它。

http://www.google.com/events/io/2009/sessions/HowToCodeThee.html

#1


0  

As far as incorporating C code directly in Android Dalvik code, I'm not sure that's possible without compiling through the NDK and including it as a library. This may help, in particular the 3rd demo (about 36 mins in) which shows implementing an algorithm in C and calling it from Android Dalvik code.

至于直接在Android Dalvik代码中合并C代码,我不确定如果不编译NDK并将其作为库包含它是可能的。这可能有所帮助,特别是第三个演示(大约36分钟),它显示了在C中实现算法并从Android Dalvik代码调用它。

http://www.google.com/events/io/2009/sessions/HowToCodeThee.html