0
Save images together with other data in XML
I am developing a game in Android Studio. Some of the sprites I use need to have some pre-defined image points when I load them in the game. So, currently, I am saving the image points (using a PC program I wrote), and all other data with them, in xml files. When I load the images, I put them in an array. The xml file contains the index of its image from the array, and that's how it works. But I don't like it. Is there a better way to load both the image and its data together?
3 Respostas
+ 3
Sure, its possible load them from assets
https://developer.android.com/reference/android/content/res/AssetManager
+ 3
You could define your format than store either in a single file then use a custom loader for any of these resources to load
+ 1
I can easily solve this by loading the images using the filename. I had googled whether it is possible before, and read that images are bundled in the APK and that it is impossible to load them from the file path.
For some reason, when I googled it up today, it turned out that it's actually possible...
Is it?