Building Java-free code for Android in C

You may find this repo very interesting:

https://github.com/cnlohr/rawdrawandroid

Disclaimer from the README.md

A little bit of this also has to do to stick it to all those luddites people on the internet who post "that's impossible" or "you're doing it wrong" to Stack Overflow questions... Requesting permissions in the JNI "oh you have to do that in Java" or other dumb stuff like that. I am completely uninterested in your opinions of what is or is not possible. This is computer science. There aren't restrictions. I can do anything I want. It's just bits. You don't own me.

Edited by k2t0f12d on Reason: Initial post
I have such repo too: https://github.com/mmozeiko/android-native-example With bat file for building.

The disadvantage of going this route is that you won't be able to use any Android API functionality that requires inheriting any interface for some functionality. You can call create Java objects and call their methods through JNI just fine. But once you need to pass some kind of callback as inherited interface - you're out of luck, JNI does not cover that. Then you need to write some Java code.
though that can be as simple as a class per interface where each function is a native function with the real meat in JNI. Add a private long for a pointer to the JNI data and you are set

Edited by ratchetfreak on