4 ms·
Doing any native development (C, C++) on Android is a hassle, because all of the android lifecycle events, os calls, etc. are through Java (JNI). That sounds li
by xsmasher 12y ago
Doing any native development (C, C++) on Android is a hassle, because all of the android lifecycle events, os calls, etc. are through Java (JNI). That sounds like exactly the hassle he's talking about.
There are some applications that don't require native development (if you don't care about speed or portability) but this isn't one of them.
- kllrnohj 12y ago> because all of the android lifecycle events, os calls, etc. are through Java (JNI). NativeActivity: http://developer.android.com/reference/android/app/NativeActivity.html http://developer.android.com/reference/android/app/NativeAct... No need for any Java/JNI whatsoever.
- pjmlp 12y agoWhich just shows your NDK experience. Outside of frame buffer, OpenGL, sensors and sound APIs, everything else is only available via JNI. Even the Play Games API only got a C++ wrapper after lots of pressure from the gaming community. At first, Google just posted a DevBytes video how to build a basic JNI wrapper for it.
- kllrnohj 12y agoNo, there's also controller input, touch, asset manager, and a handful of other stuff. <insert snide personal attack here> If you are writing a game, everything you need is available through NativeActivity without JNI.
- pjmlp 12y agoHave you ever bothered to look at the code for the NativeActivity? NativeActivity is a Java Activity that calls into C code via JNI. This C code then makes use of UNIX IPC to send the said events back and forth to the C/C++ code that runs in a separate thread. Every time Android OS calls into the Activity there is JNI involved. This only gets worse, if the developer plans to do a portable application, and not just a plain game. Just because you don't write the JNI code yourself, it doesn't mean it isn't there.