I'd like to write an application that has the following
characteristics:
- It's a client-server solution, where data is stored on a remote
server and a local replica is kept up-to-date on the phone
- Client-side synchronization is performed continuously by an always
running Service
- Client-side data is stored in an SQLite database
- There's a GUI application on the Android handset that the user can
use for easy editing of data => this data gets then sync'ed between
the client and server by the Service.

I was thinking about the major building blocks of my program and came
to the conclusion that I could use a triple of application-service-
content provider. I'm not sure about the last one, though: the
documentation says that a Content Provider could come in handy when
data is shared among multiple applications. Now I'd have an
application + a service - is that multiple application? At least it
would be two separate processes ...

Another question I couldn't answer is how my GUI (or Service) gets
notified on change in the underlying data? For example, suppose that
my GUI is up and running as well as my Service (which is always
running, anyway). The Service connects to the remote server, notices
that a local update is needed and eventually does the update. How will
the GUI app know that the data has changed in the mean time? I
couldn't find any way for this kind of notification mechanism in
ContentProvider class's interface (which would offer the cleanest
design). Or perhaps the GUI could register with the Service via a
callback mechanism so that the Service could always let the GUI know
whenever a change has happened. What do you think?

Finally, are you aware of any limitations on what a Content Provider
can do? For example, I've just read the following thread:
http://groups.google.com/group/android-developers/browse_thread/thread/b6c2a2104cca4a9e/0182b1c1685e366c
It says that it's very complex (if possible at all - nobody has
confirmed/disproved it) to issue an SQL query that contains a JOIN.
Since my scenario may very easily rely on such a database schema where
JOINs are needed, I'd like to know if I can use ContentProvider for
this purpose or should rather go for direct SQLite operations on both
GUI- and Service-side.

Thanks for your help in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to