Say I am using C and C++ and I want to execute a script made in C from within a terminal emulator in android so that it opens an activity, a GUI. Is it possible? and how do I do it?
I wouldn't care using assembly, my tablet's processor is ARMv7. if the answer is somewhere in there.
You start an Android Activity that same way you would in Java, by constructing an appropriate Intent instance and then calling Context.startActivity(). The main difference is that you need to thunk into Java via JNI in order to do so from C or C++.
Look into functions like GetMethodID and CallVoidMethod within the JNIEnv class—using those, you can call a Java function from C++ code. Then you just need a small amount of Java glue code to do what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With