I have developed my first Android app and I’m thinking about sending it to my friends who owns Android phones (I am using Nokia 5230 :p)
I have made the release version of the app using the Export wizard of Eclipse.
In my app, during startup, it would get some settings via SharedPreferences – (MODE_Private). And these settings are overwritten when user presses a button(later on, with the user entered settings).
So, my question is, when I send this release version of my app, would it contain the settings that I have presently stored ?
At the moment, I don’t need the settings (that I saved while testing in my AVD) to be included in the release apk file.
-
If included by default(while creating the release version), how do I detach it. I mean what to do so that it won’t be included.
-
If it is not included by default, I would also like to know how to include it with the release version, say for my future reference (I mean, I might need this approach in my next app)
The settings are obtained like this way:
SharedPreferences settings =
getSharedPreferences("myABCapp", MODE_PRIVATE);
String strUser = settings.getString("username", "");
//...
Settings are overwritten(saved at runtime) by user in this way:
//...
SharedPreferences settings =
getSharedPreferences("myABCapp", MODE_PRIVATE);
SharedPreferences.Editor prefEditor = settings.edit();
prefEditor.putString("username", strNewUsername);
//...
prefEditor.commit();
Thanks in advance 🙂
No.
You have to detect first launch and create your initial settings in SharedPrefs, from within your app.
You can replicate what a new user will see by Settings/Applications/Manage Applications//Clear Data … and then launch your app
PVS