never_had_a_name
never_had_a_name

Reputation: 93286

PhoneGap and Appcelerator store data locally and remotely?

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.

Upvotes: 3

Views: 4043

Answers (2)

k00k
k00k

Reputation: 17583

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.

Upvotes: 3

Aaron Saunders
Aaron Saunders

Reputation: 33345

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/

Upvotes: 3

Related Questions