1

I would like to write a program with the minko Game engine.

Is it possible to write in the assets folder at runtime? Is there some kind of key value store provided by the engine?

lammermann
  • 13
  • 5
  • No, it is not possible to write to the `assets` folder at runtime. Store your data on the `sdcard` or have a look at [SharedPreferences](http://developer.android.com/reference/android/content/SharedPreferences.html) – ByteHamster Mar 26 '15 at 17:17
  • Thanks. SharedPreferneces is no option to me since I'm searching for a cross platform solution provided by the above mentioned framework. – lammermann Mar 26 '15 at 17:26

1 Answers1

1

Is it possible to write in the assets folder at runtime?

Yes, technically. You should be able to use classic C/C++ file system operations to write to the folder, just like we read from it.

However, there is no guarantee that data will persist next time you run the application. In HTML5 for instance, it definitely won't. I'm not sure how it would behave on mobile, and I'm pretty sure that's forbidden on the App Store anyway.

Is there some kind of key value store provided by the engine?

No, there is no persistent data storage in Minko. If persistence is not needed, you can use the AssetLibrary to store your assets, or a simple std::map. That would be pure C++, therefore cross-platform.

A key-value storage might be a great addition to the engine. There is already a JSON parser which might be enough for small data. You will need to implement the persistence layer on the platform you target (hard-drive on native desktop, vendor-specific directories on native mobile, Local Storage in HTML5...).

Warren Seine
  • 2,311
  • 2
  • 25
  • 38