Saving Data on Button Click or App Exit

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Saving Data on Button Click or App Exit

Postby VTDroidDev » Fri May 20, 2011 6:53 am

I have an app that needs to store about 30 EditText values. I want to be able to store them when the user presses the save button as well as when the application exits. I also want to restore the values when the app resumes or is created. I would like to be able to store this on internal memory where the user cannot access it freely, if this is possible. I have the EditTexts in an array of EditTexts. I could easily make an array of their string values if needed. Any help on how it would be easiest/best to do so. In the future, I am going to want to be able to save/restore multiple versions of the data so being able to set a filename or something to delineate different saves would be nice.

TIA
VTDroidDev
Freshman
Freshman
 
Posts: 2
Joined: Fri May 20, 2011 6:46 am

Top

Re: Saving Data on Button Click or App Exit

Postby abhijitphatak28 » Thu Jun 02, 2011 6:12 am

First thing is what will be the size of strings you are expecting out of edit text.

You can use Android Internal Storage mechanism to save your data. This data would be private to your application and will not be accessible out side the scope of your application.

More details about Android internal storage will be provided at:
http://developer.android.com/guide/topi ... esInternal

Thanks

Regards
-Abhijit
User avatar
abhijitphatak28
Senior Developer
Senior Developer
 
Posts: 102
Joined: Sat Feb 12, 2011 1:18 pm
Location: Indore

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 5 guests