cancel
Showing results for 
Search instead for 
Did you mean: 

Auto synchronization

Former Member
3,625

Hello,
My android application has a working mobilink synchronization, but is started only with a button click. I have to make my app synchronize in a period of time and I wonder what is the best approach to do this? Maybe a service with a running timer that calls the sync or it is better to try push notification.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Thanks for the answers, I made it using AlarmManager, because the Timer has problems when the phone goes into sleep mode. The processor slows down and the timer doest'n execute as it is scheduled.

Answers (2)

Answers (2)

Former Member

MobiLink has several options for Server Initiated Synchronization (SIS) and for Android you can also use Google C2DM to push synchronizations.

Unlike the SQL Anywhere client for MobiLink (dbmlsync), UltraLite has no built-in feature for scheduled synchronization but it does have support for performing background synchronization.

So changes on the consolidated database could start synchronization via SIS or C2DM, and you could have your Android application initiate a synchronization for changes made by it. Then there would be no need for scheduled synchronizations.

Former Member
0 Kudos

FYI, some documentation may suggest otherwise but SIS is supported for Android.

Former Member
0 Kudos

In addition to Graham's valid answer, if you do want to do scheduled synchronizations (for example to save the performance drain of doing synchronizations after many updates in a short time interval) there are several options. One thing I do not recommend is doing a potentially long-running operation like synchronization on the UI thread (such as a button click). A couple of options are: (1) you could use java.util.Timer to run scheduled synchronizations on a thread. (2) you could use android.os.AsyncTask to run synchronizations on a background thread.