call android activity from jni directly from c++ process without java side(直接从没有java端的c ++进程从jni调用android活动)
问题描述
我正在使用 Eclipse 并开发一个具有 Java 编码和 jni C++ 代码的 Android 应用程序.
I'm using Eclipse and developing an Android app which have a Java coding and also jni C++ code.
我正在尝试直接从 jni 启动 Java 活动,而不涉及 Java 端.有办法吗?
I'm trying to start an activity of Java directly from the jni without touching the Java side. Is there a way to do so?
推荐答案
好的,我终于知道怎么做了!这是工作!您唯一需要更改的是将您的包名和类名写入NewStringUTF
例如:NewStringUTF("org.samples.test.MyClass")
ok I found out how to do it finally! it's work!
The only thing you need to change is write your package name and class name in
NewStringUTF
for example: NewStringUTF("org.samples.test.MyClass")
注意:app
是你的 android_app*
您还需要在清单中添加此代码:
you also need to add this code in your manifest:
这篇关于直接从没有java端的c ++进程从jni调用android活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!