delight-im / Android-DDP

[UNMAINTAINED] Meteor's Distributed Data Protocol (DDP) for clients on Android
Apache License 2.0
274 stars 54 forks source link

Offline usage #30

Closed limbit closed 8 years ago

limbit commented 8 years ago

how is it possible to get the items synced localy for an offline-app?

ocram commented 8 years ago

Well, good question!

Currently, this library doesn't really work for that use case. Sorry!

In Meteor itself (when developing web apps), there are three things that make offline apps possible:

  1. On the client, data is stored in an in-memory database that resembles the server's database. It's called Minimongo and has an interface similar to MongoDB on the server.
  2. Using AppCache, you can cache resources on the client.
  3. Using GroundDB, for example, you can cache data on the client.

So in order to build offline-capable apps with this library, we need those things as well. We don't need (2) because we don't use the web app's resources from the server. But we need the other two things.

(1) will be the hardest and the most important part. We'd have to build an in-memory database for Meteor on Android that is convenient and maybe similar to MongoDB as well.

But for the short term, there's no solution here, sorry!

ocram commented 8 years ago

You can now implement the DataStore interface and pass an instance to the new Meteor(...) constructor. In your class, you will then receive all data from the server automatically and you may choose to persist it in whatever way you want :)

Sorry there's no built-in solution yet that is more complete!

See https://github.com/delight-im/Android-DDP/issues/54 also, please.