Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update sync account after login

I have created sync adapter with default sync account like the following screen shot.

enter image description here

And I would like to update sync account after the user logged in to the application like the following picture.

I googling a lot but I did not found any solution. I am new to sync adapter and I have no idea how to update sync adapter account after user login. Please help.

enter image description here

like image 359
BomberBus Avatar asked Dec 13 '25 21:12

BomberBus


1 Answers

If you have an Android app that 1) reads and/or writes data from a SQLite database and 2) needs to update that data periodically from another source, say a RESTful web service then one approach you can take is to hook into the Android Sync Service. I recently created an Android project with a Sync Adapter to consume and publish data to a simple Go RESTful web service and I’d like to share what I’ve learned.

Android source: https://github.com/snyderep/TeamKarmaAndroid

Go source: https://github.com/snyderep/TeamKarmaServer

Relevant parts of the Android project: Content Provider Authenticator and Authenticator Service Sync Adapter and Sync Service

like image 109
Rajan Bhavsar Avatar answered Dec 15 '25 11:12

Rajan Bhavsar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!