Hey, folks. I'm preparing to release a Gideros port of an app previously released coded in native Java for Android. Some users of the old version may have a lot of data, stored in SharedPreferences in the usual way for a Java Android app. With the new Gideros version, I'm storing user data in files in the documents folder, the usual way for a Gideros app. I need a way to move stored data from the former to the latter, as a one-time step, so existing users don't lose their data when they install this update. So I'm looking into how to either:
A- Drop some native Java into the exported Eclipse project for Android to read the SharedPreferences and write the data into the Gideros documents folder for the app
B- Get the Lua code in the Gideros app to read from the SharedPreferences directly
I'm guessing that B would require writing a plugin, so A seems like the simplest option.
Does anyone have any experience reading from SharedPreferences via Lua, or writing to the Gideros document folder from native Java? Do you have any helpful insights on doing either?
Background - The app in question is a fishing guide called My Fishing Advisor. The old version of the app is also on iOS, but that version is so out of date that it doesn't store enough data to be worth trying to move it over. The Android version has had updates that allow users to store details about their fishing spots, and that's the data I want to preserve. The app has a feature to backup data to the cloud, but using that feature is optional. If I switch to a different method of storing the data without importing from the old to the new, many users would lose a lot of data that's important to them. One of the main reasons I've ported the app to Lua and Gideros is to have a common code base so I can keep the iOS version caught up with the Android version in the future.