8 ms·
I developed an app for Android using the NDK (so I programmed it in C, not Java)[https://market.android.com/details?id=com.burnsmod.djpad https://market.android
by gravitronic 15y ago
I developed an app for Android using the NDK (so I programmed it in C, not Java)[https://market.android.com/details?id=com.burnsmod.djpad https://market.android.com/details?id=com.burnsmod.djpad]. What I found is that Android version fragmentation was much less impactful than differences between different phone models.
For example, /mnt/sdcard might be the internal storage. Or an SD Card. Where's the other mount point? You have to parse /proc/mounts to figure it out. How do you know which are which? I ended up writing a ton of rules like mount the point if (isEXT || isFAT || isFUSE && (not in a list of system mount points like /data)). There's no API (at least on the NDK side).
- rogerbinns 15y agoYou could have made some initialisation calls in Java to get the various values from Environment and similar and then passed them on to your native code.
- gravitronic 15y agoThanks. I will look this up for future versions. Annoying to have to bridge it myself but better than my current solution (which is actually the suggested solution when looking on stack exchange at this exact issue :/ )
- rogerbinns 15y agoAlthough it is technically possible to implement the entire app in native code, you will find it far easier to use some Java as well.
- gravitronic 15y agoUsing the ports of SDL my app runs the same codebase for WebOS, Android, RIM Playbook and soon Apple iOS. While I already have a few Android-specific shims I'm trying to remain as platform-independent as possible to ease porting.
- deleted 15y ago[deleted]