我想获得应用程序,它具有一定的参考上下文/承载我的图书馆在运行时,一个班我的媒体库的项目中。可能吗?如果是的话,怎么办?
感谢
更新 我不希望我的用户通过上下文参数,以我的图书馆项目,因为它可能是我的库项目将通过JNI调用,我不知道我怎样才能上下文JNI,并把它传递到Java层。
解决方案这可能吗?
是的。
如果是,如何?
在将它作为一个参数。
我不希望我的用户通过上下文参数,以我的图书馆项目,因为它可能是我的库项目将通过JNI调用,我不知道我怎样才能上下文JNI,并把它传递到Java层
然后搞清楚怎么[你]可以获得上下文JNI,并把它传递到Java层。我猜想,你会通过它像任何其他对象。作为@Blundell指出,你真的没有任何其他选择。
![5分钟短文 Android证书生成,签名,验证,虽然难,但学一次就够了 Apks](https://p.xsw88.cn/allimgs/daicuo/20230903/5911.png)
I would like to get the context of application which has reference/hosted my library at run-time inside one class of my library project. Is it possible? If yes, how?
Thanks
Update I don't want my user to pass context in parameter to my library project because it is possible that my library project will be called through JNI and I have no idea how I can get context in JNI and pass it to Java layer.
解决方案Is it possible?
Yes.
If yes, how?
Pass it in as a parameter.
I don't want my user to pass context in parameter to my library project because it is possible that my library project will be called through JNI and I have no idea how I can get context in JNI and pass it to Java layer.
Then figure out "how [you] can get context in JNI and pass it to Java layer". I would imagine that you would pass it like any other object. As @Blundell noted, you do not really have any other option.
相关推荐
最新文章