0

I was wondering what is the easiest way to capture data once only when my app is first loaded. I wil be capturing an email address and sending that to an external database which multiple user can access (something like SQL Express).

Due to the use opf phonegap i can only use HTML and JavaScript and therefore am planning on first load having a popup promping for an email address, once this has been submitted flicking a flag (probably store this on the phone iteself - possibly sqlite). Then every time the app is loaded this flag is checked if it is true then they go stratight through to the app otherwise they need to submit there email.

Could someone please explain the easiest way to do this, to sum up its a 1 off data capture of an email address when the app is loaded for the first time.

THanks

Raj
  • 2,558
  • 9
  • 33
  • 51

1 Answers1

0

Set a boolean in localStorage that you check once you receive the deviceready event. If the value is false or missing then you ask for the email, if true skip that step.

Simon MacDonald
  • 23,205
  • 5
  • 56
  • 73
  • Where am I actually passing the value to though? It needs to go to an external database and not stored on the local phone, as this way I cannot access and store that data. Thanks – Raj Feb 13 '12 at 22:51
  • Use Ajax to post the value to your server. – Simon MacDonald Feb 14 '12 at 14:26