I want to upload my images,video and contact to server for backup.Which is optimize way to do this? I try to use sync adapter to upload all these things but problem occur in implementation.Please help me.Thanks in advance.
Asked
Active
Viewed 388 times
0
-
I think SyncAdapter is the optimum way to do that in android. so the question should be mentioning What kind of problems do you have – Ahmed Hegazy Dec 26 '14 at 11:44
-
@hegazy I try to implement using basic sync adapter which is in sdk but problem occurs on uploading on server i don't know how it is done with the help of sync adapter. – Rahil Ali Dec 26 '14 at 11:55
1 Answers
0
A sync adapter doesn't automate any data transfer tasks. If you want to download data from a server and store it in a content provider, you have to provide the code that requests the data, downloads it, and inserts it in the provider. Similarly, if you want to send data to a server, you have to read it from a file, database, or provider, and send the necessary upload request. You also have to handle network errors that occur while your data transfer is running.

Ahmed Hegazy
- 12,395
- 5
- 41
- 64
-
i only want to upload data on server.Can this is done by sync adapter or not? – Rahil Ali Dec 26 '14 at 12:45
-
The sync adapter component does not automatically do data transfer. Instead, it encapsulates your data transfer code, so that the sync adapter framework can run the data transfer in the background, without involvement from your app. When the framework is ready to sync your application's data, it invokes your implementation of the method onPerformSync(). That's all it do. It doesn't provide you with a way of uploading your data. – Ahmed Hegazy Dec 26 '14 at 12:52
-
whether i use sync adapter for uploading data or create a service to upload data? – Rahil Ali Dec 26 '14 at 12:58