sorry if I missed this but so far the only way I see to store data would be via INI files (INI object). Are there other ways that I'm missing? I was hoping for support of XML but the two XML extensions aren't supported in the Droid Beta.
Printable View
sorry if I missed this but so far the only way I see to store data would be via INI files (INI object). Are there other ways that I'm missing? I was hoping for support of XML but the two XML extensions aren't supported in the Droid Beta.
I would assume you could save the content of an Edit object, but I cannot get that to work. I don't know where (or if) the file is saved.
A way that definately works is to store data on a webserver if you have one and know how to progam it. Then you would use the GET object to communicate with the server.
Thanks but won't work. I shoulld have been clearer in my post. I want to store the data locally. For example, store user config settings. It doesn't need to be secure (I.e. encrypted). The data being stored is not sensitive. Looks like the INI object may be the route I will have to go.
Yes, ini is perfect for that :)
Just researched INI vs XML. Found out there's a limitation on INI values. Values characters can be no longer than I believe 256 characters. I was going to use the INI to also store info such as definitions. The original app I'm developing (PC version) uses an XML file to store the values, definitions, etc.
That's not true (at least on Android).
Sorry to be a total noob here but could someone give me a quick run down on how to use the ini object?
I've never actually used it, I use associative array on normal MMF2.
How do you create it initially on the device?
What's the command to say set item difficulty to 3.
How would I read that back off the ini for example at start of frame read difficulty and set a global value to it?
Sorry if they sound like dumb questions but my experience with this is 0.
First you have to set the ini file name. If you want to call the file name mygame, then you could do:
At Start of Frame > Set Current File "mygame.ini"
This would create the file mygame.ini in the same directory as your application.
There is no "command." INI files are just plain text such as this:
[Settings]
Difficulty=3
[Settings] is the group. Difficulty is the item and 3 is the value. So you could create whatever you want in your game.. Maybe even put it in a group if a lot of things. At startup, disable the group. Then, set a condition. Compare two general values:
If ItemValue("INI","Difficulty")=3
Enable MyGroup
Replace MyGroup with whatever you want to call your MMF group. This is not to be confused with the INI groups previously-mentioned. In the Multimedia Fusion 2 Help folder is a file called Ini.chm. That is the help file for the INI object. It explains a bit more about the groups, items, etc. I would really like to see support for the INI++ object.
Thanks. I'll give that a go.
Note that the INI object creates a virtual file on Android, not a real one (I believe it's the same with iOS).
What do you mean a virtual file? As in temporary?
I just ran a test on Windows. Sorry for late response. I created a small app (Windows). I tell it how many characters to generate. It generates them in to an Editbox. I then save that generated text to an INI file. Then, I load the value from the INI file and have the app count how many characters. Here's what I've found:
- The app appears to be able to generate as many characters as I want. I have gone as high as 10,000 characters
- The app loads all 10,000 of those characters in to the Editbox.
- When I read the INI file in Notepad++ or other text editor it does show that all 10,000 characters were saved to the INI file.
- When I open/load the saved characters in to the app only 1023 of those characters are loaded in to the Editbox.
So is this a limitation on MMF and how it handles memory? Initially it can generate all 10,000 characters, load all of them in to an edit box immediately after creation. Just that when you try to load them via an INI file in to MMF only 1023 will load. I figured maybe it was an issue with Editboxes so I tried the same experiment but with a Rich Text box. Same thing, only 1023 will load.
I know this was an app created for Windows but am just wondering about this 1023-character limitation and whether this would affect the Android app. That is, having a 1023-character limitation as well. Later on tonight I may test it out out my Android.
It's a limitation of the INI object on Windows. It shouldn't affect Android.
Thanks James. Out of curiosity, though, what exactly is the limitation from? Does Windows simply limit no more than 1023 characters at a time to be read from an INI file?
In the help file for the INI, it says that the limit for the INI is 64kb and 1024 characters