Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does SyncAdapter support both uploading and downloading during a sync?

I am trying to write an Android SyncAdapter and am a little confused. During a sync (i.e. in onPerformSync() ), I want to be able to pull data down from a remote server but also push data up to a remote server (is that a 2-way sync? or is a 2-way sync when the server also initiates a sync?).

Anyway, I am guessing I need to set android:supportsUploading="true" in the manifest file. However, from my understanding, the documentation says that this is for uploads only. Is it not possible to do both uploading and downloading in a sync operation with a SyncAdapter?.

Thanks.

Edit: It looks like the Sample SyncAdapter has two way syncing (although I am not 100% sure) - but only from API 11+. I want to support earlier API levels - is this not possible?.

like image 517
Umbungu Avatar asked Nov 03 '22 12:11

Umbungu


1 Answers

I dont know, what protocol you are using to send or receive data, but if you are using http you can easily do both by using a HTTP Get-Request for receiving data and a POST or PUT Request to send data.

like image 56
Nickolaus Avatar answered Nov 13 '22 18:11

Nickolaus