android-studio - android studio 可以同时使用java 和c++开发android应用吗
怪我咯
怪我咯 2017-04-17 15:59:25
0
3
626

如题。
应用中含有一个界面是一个小游戏,如果用java实现的话,可能会有效率问题,但是如果用C++的话,不知道工具怎么用

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(3)
巴扎黑

Please search for Android JNI related knowledge

Peter_Zhu

Android Studio does not support C++ development well enough, you can use Eclipse

洪涛

I have some preliminary understanding of this aspect, I hope it can be helpful to you. For more information, please go to Baidu/Google and view the official documents.

1.Java’s JNI mechanism: Understanding JNI principles based on JAVA

JNI is an important function in the JAVA standard platform. It makes up for the shortcomings of JAVA's major advantage of being platform-independent. While JAVA is cross-platform, it can also be used with dynamic libraries in other languages ​​​​(such as C, C++) Interact and give other languages ​​a chance to take advantage.

My personal understanding is mainly that the Java level calls the .so (under Linux system) dynamic library compiled by the underlying C/C++. You can view Samples or write a Demo yourself

2.Android NDK: Android NDK development

NDK provides a series of tools to help developers quickly develop C (or C++) dynamic libraries, and can automatically package so and java applications into apk.

Other reference links:
Android NDK official website
Android NDK samples official example (GitHub address)
Detailed explanation of Android Studio ndk-Jni development
Getting started with Android Studio development - citing jar and so files

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template