0

Sorry, tell me please if I understand correctly that in a general sense, this is the case:

-Code written on the basis of NDK + JNI is an application based on Java which can call compiled C ++ code through some JNI interface?

-Code written on the basis of the NativeActivityclass - fully compiled and does not use Java and does not use JNI?

And does the NativeActivityclass have all the same functions as Java SDK? Well, that is, from the NativeActivity class, you can refer to geo sensor,bluetooth module, wifi module, to the screen sensor, in general, to everything that can be accessed from the SDK (except for the graphical interface)? Or do I not understand correctly?

Optimus1
  • 444
  • 2
  • 13
  • 1
    (2) does use Java it's just you are using a Java class supplied with the toolchain to call into the C++ class. There is no real difference between (1) and (2) except the nice Android developers have written a Java to C++ layer for you, instead of you writing it yourself. The source code for both the Java and C++ sides is available as part of the SDK / NDK. – Richard Critten Jun 20 '21 at 09:03
  • @Richard Critten, but, if Java is still used, then why or in what cases will the C ++ code be more arbitrary than just SDK? – Optimus1 Jun 20 '21 at 09:39
  • See https://developer.android.com/reference/android/app/NativeActivity It's a true Java class just like Activity, source is also available (if you downloaded it see the SDK source options in AndroidStudio). – Richard Critten Jun 20 '21 at 10:45

0 Answers0