Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Flash, for example, I can place an xml file along with the binary, then if I modify some variable the game will change for everyone.

How to achieve something like that in Android? I know that for every change I make to the game, the player would need to download a new update.

But the main goal I'm looking for, is modifying a game stats without the need for recompile the entire APK.

I'm working with Haxe+OpenFL.

share|improve this question

You can either store the settings in a database connected to your application or save them on the SD card.

The integrated databases are assigned to a certain application and only this application cann access them. So you can save them there even though only the application can change them.

The other way would be to use the SD card (or other external memory) and save them there. Access to the SD card is possible for each application so anyone could change the settings then.

To create or change the settings create a service in your application that queries this settings from an external server.

share|improve this answer
How does that work with the update system on Android? If I change something in the database, then update the app on the store, does the user get that update? – Veehmot Aug 5 '13 at 14:57
The database is local to the device. So you can change this from the app itself (without going over the shop). You simply have to inform your app about this (e.g. by asking a server at the start of the app). – Uwe Plonus Aug 6 '13 at 5:27

You can use a SQLite database, but it has to be on your SD card or on your device. Here is the reference for SQLite on Android:

However you may be able to download the file to your SD card, check out this URL where someone downloaded an image to their SD card:

share|improve this answer

I'm loading a local file from SD card (Android 4.3) like that:

// loading local file
#if android
loadTextFromURL( "/sdcard/PROjekty/testHaxe.txt" );
#if flash
loadTextFromURL( "file:///C:/O/PROjekty/testHaxe.txt" );
#if windows
loadTextFromURL( "C:/O/PROjekty/testHaxe.txt" );

// loading file over http
loadTextFromURL( "" );

public function loadTextFromURL( address:String ):Void {
    var newLoader:URLLoader = new URLLoader();
    newLoader.dataFormat = URLLoaderDataFormat.TEXT;
    newLoader.addEventListener( Event.COMPLETE , textLoaded );

    newLoader.load( new URLRequest( address ) );

public function textLoaded( evt:Event ):Void {
    var text:String = cast(, URLLoader).data;

    trace( text ); Event.COMPLETE , textLoaded );

You'll need to find out how to get path to SD card dynamically. I mean on every device model or system version the path can be different.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.