Assigning Default Values To App in Android -


i'm implementing generic app different things retrieve data web services, have assign unique id every different kind of app.

for example, if teacher has installed app, should assigned "teacher" fetch teacher's stuffed data, if student has installed app, should assigned "student"

what i'm trying every single time before app runs, should have information type of person either "teacher" or "student"

kindly me out question mat not elaborated tried.

you can store status of user in form of persistent storage. take at

http://developer.android.com/guide/topics/data/data-storage.html

this allow utilize internal/external storage.

example shared preferences :

to save user use:

sharedpreferences prefs = this.getsharedpreferences(       "com.example.app", context.mode_private); prefs.edit().putstring("user", "teacher").commit(); 

to retrieve user use:

string res = prefs.getstring("user", default_user);  

Comments

Popular posts from this blog

php - Add the correct number of days for each month -

java.util.scanner - How to read and add only numbers to array from a text file -