Richeek
Richeek

Reputation: 2220

Android strategy to store data

It may sound as if I am rambling (which I am anyways)

So I am thinking to create an android app which basically query my server to fetch some data based on user criterions and display it to the user (think of Yelp for example). User can push data also to the server (like ratings, comments etc.)

I want:

  1. I want the app to be available in offline mode also (i.e. no network connection)

I can do it because:

  1. Server side data will not be refreshed that frequently so no point in redirecting every request to network. For client updates however, (like when users gives a rating) I am not sure what to do. Should I immediately send it to the server or persist it in my local datastore and send it in periodic fashion?

How I am thinking of doing it (this is where I am confused)

  1. Thinking of using phone storage to store data in SqlLite database?
  2. How can I sync local db with cloud datastore? So that whenever connects to network or after a certain timeout period both client and server are in sync?
  3. What should I use for cloud storage? How about Google App Engine?
  4. How do people generally approach it? Looks to me common questions.

Upvotes: 0

Views: 185

Answers (1)

Ojonugwa Jude Ochalifu
Ojonugwa Jude Ochalifu

Reputation: 27256

1. Thinking of using phone storage to store data in SqlLite database? You can do just that, but i advice you read up on the other solutions plus the pros and cons about storage in Android here

2. How can I sync local db with cloud datastore? So that whenever connects to network or after a certain timeout period both client and server are in sync?

You can store the offline db (sqlite) data on a file and then upload (more like "backup") to a server (which can be Google App Engine) when you get Internet connection.Read more on this here

3. What should I use for cloud storage? How about Google App Engine?

Google App Engine is perfect for your backend server. this is the official documentation.You can also find tutorials on creating a Google App Engine connected Android app here

Upvotes: 1

Related Questions