[英]How to implement delegate/protocol(on iOS) in JNI on Android?
I'm building an aar library on Android, which is with JNI/C++ codes. 我正在用JNI / C ++代码在Android上构建aar库。 What I want to do is to pass an event (when the event happens, I want to pass it out) form C++ to Java application( the application which imports my aar library), and the application can then take care of the event. 我想做的是将一个事件(事件发生时,我想将其传递出去)从C ++传递给Java应用程序(导入我的aar库的应用程序),然后该应用程序可以处理该事件。 I've done the same thing on iOS with delegate/protocol, is there any equivalent that I can implement on JNI for the same purpose? 我在iOS上使用委托/协议做了同样的事情,出于相同的目的,我可以在JNI上实现任何等效功能吗? Thanks a lot! 非常感谢!
I'm unsure exactly what features of iOS delegate you want, but there are a lot of ways to get events out of C++ and into Java via JNI. 我不确定您想要iOS委托的确切功能,但是有很多方法可以通过JNI将事件从C ++传入Java。 For example: 例如:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.