I think you seem to be misunderstanding the use of content providers in Android.

In Android, there is a heavily sandboxed model.  If you write an app,
there are a variety of ways that you can persist information.
SharedPreferences, files on SD, databases, just to name a few.
However, in theory apps should not be allowed to touch other apps'
data (however you will note this is not the case on either a rooted
device or some situations in which you put files on the SD card,
etc..).  A content provider solves the problem of presenting a common
interface to external apps who might want to interface with your app
to exchange data, it's not intended for interfacing with things like
external web services.  This isn't to say it wouldn't be of utility if
you wanted to exchange data with another app on the device that synced
data with the server, or a number of other uses you might envision in
this scenario.

But in brief, if you want to sync with an external service, you don't
want to be using a content provider, you want to be using some library
which will do communication with the server using whatever protocol
you need (restfully, etc...)

kris

On Thu, Jan 19, 2012 at 1:11 PM, Ab Caballero <a...@mac.com> wrote:
> Hi, Mark.
>
> there seems to be documentation about using the SyncAdapter for this
> type of operation but that the implementation requires
> ContentProviders. Ideally, my app would be able to sync with the cloud
> on some basis, say hourly, the same way sugarsync does with my phone,
> table and laptop. Am I misunderstanding the role of the SyncAdapter?
>
>
> On Jan 19, 9:56 am, Mark Murphy <mmur...@commonsware.com> wrote:
>> A content provider would have nothing much to do with it.
>>
>> If you wish to upload files, upload them. If you wish to download
>> files, download them. There is nothing in the Android SDK that is a
>> "sync this directory of stuff with this online counterpart". I'm not
>> even aware of a third-party solution for that, though I seem to recall
>> there was some work going on for a git client library.
>>
>> On Thu, Jan 19, 2012 at 12:53 PM, Ab Caballero <a...@mac.com> wrote:
>> > I have an application that stores files to the SD card of the device.
>> > If I want to sync that data with the google cloud, do i need to write
>> > a content provider, or is there some other way to share the data?
>>
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Android Developers" group.
>> > To post to this group, send email to android-developers@googlegroups.com
>> > To unsubscribe from this group, send email to
>> > android-developers+unsubscr...@googlegroups.com
>> > For more options, visit this group at
>> >http://groups.google.com/group/android-developers?hl=en
>>
>> --
>> Mark Murphy (a Commons 
>> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>>
>> Warescription: Three Android Books, Plus Updates, One Low Price!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to