Question

I wonder if I could store data with PhoneGap and Appcellerator both locally and remotely (postgresql in my web application)?

Cause it's gonna be a realtime app that has to sync data between the mobile and remote backend server.

Was it helpful?

Solution

yes you can, with PhoneGap, I am not familiar with Appcellerator.

With PhoneGap you can store to local database

http://phonegap.pbworks.com/Adding-SQL-Database-support-to-your-iPhone-App

Or you can store to the file system

http://phonegap.pbworks.com/JavaScript-API#file

Complete Documentation http://docs.phonegap.com/

OTHER TIPS

In order to do remote data storage, you don't typically rely on the PhoneGap or Appcellerator inherent data storage mechanisms, but more on your remote server's abilities. You can take advantage of the local data storage for offline use.

I would set up my mobile app so that it does the following:

  • Checks to see if it's networked/online
  • If offline, reads/writes data to a local db on the device
  • If online, reads/writes data to a remote server via an HTTP call and provides/retrieves a JSON object from the HTTP server's API/DB

This introduces other issues around syncing that you'll need to begin to think about.

That's the basics anyway, and I think it answers your question. Let me know if you need more detail.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top