I’m experimenting with a rooted Android tablet. I need to run some system applications in C/C++ that can run as native apps with/without using the NDK. This would work like existing command line applications such as toolbox as a native ARM Linux executable.
Is that a possibility?
I’m experimenting with a rooted Android tablet. I need to run some system applications
Share
Yes, you can. And you can do it using the NDK which you make things easier to you , cross-compiling to all platforms supported by Android (ARM variants and x86). You just need to do like you would do to create a shared library for native Java methods. Just make sure you change the makefile to use
BUILD_EXECUTABLEinstead ofBUILD_SHARED_LIBRARYto create an executable. Of course you won’t need the APK folder structure, just the “jni” folder.Tutorial
Create the project folders:
Create the Android.mk makefile in the
jnifolderCreate also your source code in the
jni. In this case, you can see from above makefile, it isteste.c:Now go up to your project folder and run ndk-build from there:
Although it is output to a lib folder it is a executable, as you can inspect with
file