Android NDK - write only in C/C++

后端 未结 2 1875
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-07 05:21

Is there a possible way to write a whole NDK app with C/C++ without a Java \"starter\" class like in hello-jni sample project (HelloJni.java) - somehow create a HelloJni.c which

2条回答
  •  不要未来只要你来
    2021-02-07 05:45

    Since all UI, graphics and other interesting classes are in Java you will have to use Java one way or another.

    By another I mean interfacing with all Java classes through JNI. There is a library for that: https://github.com/DmitrySkiba/itoa-jnipp. Check HelloJNIpp sample - it shows that it is indeed possible to write Android apps completely in C++, the only catch is that you will need to implement all needed wrappers first (some are in samples/common folder).

    However, I recommend using Java. Its simple and elegant, has great libraries and tools.

提交回复
热议问题