views:

55

answers:

2

How would I code my android app to remember the values entered by the user between uses?

As an example, say I have an EditText "input1" and a spinner "input2" which give results in a textview named "output1".

Currently when I close and reopen the app, all entered values and calculations are lost and reset. How can I fix this?

+2  A: 

You can use SQLite or the raw file system. The Notepad tutorial shows basic usage of SQLite.

RickNotFred
Having some trouble understanding how it all works... Am I supposed to be treating the entered values as preferences, files, a database, or what?I'm new to Java so I apologize if this is obvious.
Sean
It's your choice. As Bahadir suggests, perhaps the easiest and lightest-weight approach is to use preferences. However, if you are new to Java it might make sense to begin learning Java first. One place you can start is http://www.javapassion.com/ but there are lots of others. Next, I would run through the stock Android tutorials, then start your own app.
RickNotFred
+4  A: 

You have three options. See all here

In your case, file IO and database will be overkill. I recommend using the Preferences API.

Bahadır