input - Remember and autofill last known data -


i'm makeing phonegap app android. have input field user can enter text , want text saved still there when opening app next time, still allowed changed , new text remembered instead.

example:

first time open app --> enter text "cat" --> close app ---> second time opening app, text "cat" field in --> user change "cat" "dog" --> close app -->open app third time text "dog" filled in. 

so how approached this? thing found looking around google autocomplete on/off, dose not give effect want. possible?

the app simple html think of if normal website. how effect?

cheers jimmy

you check out localstorage. allows set key/value pairs store , call upon @ later date. pseudocode this.

app starts
check if localstorage available, if continue
check if value textbox in localstorage(will nothing yet)
if value there
set text
else
user enters text
store text localstorage key representative of text box
user closes app

app opens
check if localstorage available, if continue
check if value textbox in localstorage(should set)
if value there
set text

check out link here http://www.html5rocks.com/en/features/storage#description


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -