So, I've created a Haxe function (using the OpenFL library) that saves text and image data to the game's folder on desktop targets. A little while ago, however, I was notified in this thread that the function would not work on mobile targets. The same user, thiagojabur, also gave me a solution (scroll down in the same thread). My main problem is that I don't have a mobile device myself that I can test on (I have a Galaxy Tab4, but I haven't gotten it working with my Haxe projects). Rather than send 100 versions to someone who can test it, I've decided to ask my questions here.
The goal is to save the data into a folder with the game's App ID. For instance, if the App ID is com.potato.potatogame
, then the data will be saved (on Android) in the application storage directory, in the folder /Android/data/com.potato.potatogame/
. I believe I can get the first part of the path using openfl.utils.SystemPath.applicationStorageDirectory()
, but I'm stuck on how to get the App ID. Does anyone know of a function which can do so?
Alternatively, I may be misunderstanding a part of the code. From the way thiagojabur used the code, it would seem that SystemPath.userDirectory()
returns "/Android/data/com.potato.potatogame"
on Android. Is this correct, or would I still need to build the path manually?
Any help is appreciated. Thanks in advance!