Writing my game in libgdx, I arrived at the point when I need to save the player stats and the info of the levels. However, in libgdx it's not allowed to write the file inside folder of the application, only external (on the SD) is allowed. The point is that I don't want the file to be seen by anyone, or if they can see it, how can I convert it to a binary file so it's not human readable? I just want to hide the file.
|
Libgdx has built in decoding and encoding functionality. Gustavo Steigert has written a nice article about this on his blog: http://steigert.blogspot.be/2012/03/5-libgdx-tutorial-files.html. Scroll down a bit to the section "2. Persist Profile operation". In this blogpost, he explains that by using the class com.badlogic.gdx.utils.Base64Coder you can encode and decode files in the Base64-format. Leaving the unreadable and unmodifiable for end users. |
|||||
|
|
Again, try asking here.. http://www.badlogicgames.com/forum/ Basically, you may want to read up on how Android handles directories in your app. There is a file handle class in libgdx that should work for you. If you just want it saved in a protected place, use the internal process and it should be local to your app directory and not visible. It doesn't have to be on an sd card. Read the android docs and ask on the badlogic forum if you still need help and don't get any answers here |
|||||||||
|
|
I resolved it with callbacks, with that I can use Android methods, that way I can write to the internal memory. |
|||||||||||||||
|
