0

We use the SyncAdapter to send data to the server.

It works perfectly almost always. But we identified one problem. When the phone physical memory is full, the SyncAdapter seems to stop working. It seems to delay the execution until some memory is free.

Is it a normal behavior? What can we do to address this issue?

We have a "real-time" application and it is a problem if the SyncAdapter becomes stopped for a long time.

Thanks for the help!

Bruno da Hora
  • 61
  • 1
  • 3
  • You can implement a watchdog , you can send a GCM and you can, you can use basefire .. the behaviour of the syncAdapter sound fine, android will stop plenty of things if memory is full – Shai Levy Apr 16 '15 at 13:32

1 Answers1

0

You cannot expect the SyncAdapter to run in a fixed period of time. In fact you cannot expect to run at all. The user may stop the auto-sync and this breaks your logic. I'll advise you to use alarms and trigger alarms on a schedule based on your logic. When the alarm fires, start a Service that syncs your app with the server. It is more reliable than the SyncService. In addition when your app is launched/resumed always check if you have synced soon. If not - sync now.

Kiril Aleksandrov
  • 2,601
  • 20
  • 27