4 ms·
It is possible to write native code for Android using Native Development Kit. Typical NDK use would be to develop a library that is then called into by java cod
by kees99 1y ago
It is possible to write native code for Android using Native Development Kit. Typical NDK use would be to develop a library that is then called into by java code. But one can make whole app with it, 100% java-free:
https://github.com/cnlohr/rawdrawandroid https://github.com/cnlohr/rawdrawandroid
- Imustaskforhelp 1y agoYes I am also interested in something like this 100% java-free but instead of C I'd prefer golang I have been thinking more and more about creating golang applications for android simply because of how much I admire f-droid. There are apps that have done this through 2 approaches https://github.com/xlab/android-go?tab=readme-ov-file https://github.com/xlab/android-go?tab=readme-ov-file (Either something like this) Or https://github.com/LeastAuthority/destiny https://github.com/LeastAuthority/destiny which is a dart app but uses golang's backend using https://github.com/LeastAuthority/dart_wormhole_william https://github.com/LeastAuthority/dart_wormhole_william TLDR: they create dart bindings to go code and run it on android... I know sooo many good golang applications on linux that I wish more people of android could access it and in an even nice way via something like f-droid so I am definitely contemplating what might be the best way for something like this... For rust applications, I think that tauri might make the most sense, but I am just curious as to what you guys think is the best way for a beginner to create a golang/rust android application without worrying *too much*
- pjmlp 1y agoIt is never Java free outside games, because all relevant Android APIs are hidden behind JNI calls, implemented in Java. Also NDK is designed to produce shared libraries that are then loaded into the Java host process for the application, if not manually written, one gets the generic activity (NativeActivity or GameActivity) written by the Android team, expecting specific symbols on the shared library mapping to the native method declarations. https://developer.android.com/reference/android/app/NativeActivity https://developer.android.com/reference/android/app/NativeAc... https://developer.android.com/games/agdk/game-activity https://developer.android.com/games/agdk/game-activity So while someone's own APK might be Java free, there will be Java on the process execution runtime.