Android C ++ Source Code

I am a new Android developer and I would like to create an application using only C / C ++ code for Android, but I found that the documentation is very limited. I can create an Android C / C ++ project in eclipse, but it uses a lot of java code.

I am using NativeActivity (new for 2.3) and I need help setting up my project. Does anyone know how to do this?

http://developer.android.com/reference/android/app/NativeActivity.html

+4
source share
2 answers

Just delete all the generated Java code. You do not need this if you want a purely native activity. The only thing you need to do is configure the Android manifest file, as shown in the documentation. In particular, you will need:

<!-- Tell NativeActivity the name of or .so --> <meta-data android:name="android.app.lib_name" android:value="native-activity" /> 

And you will need to modify jni / Android.mk so that it creates jni with the name lib_name.

+3
source

Yuo can take a look at the Lighthouse project for android, which allows you to use Qt code (and therefore C ++) instead of java. You still need 1 line of Java code to run the Qt application.

0
source

Source: https://habr.com/ru/post/1337828/


All Articles