[feedhenry-dev] FH-Sync and Android O

Summers Pittman supittma at redhat.com
Tue Aug 15 16:34:01 UTC 2017


So fh-android-sdk uses a polling thread with a one second timeout to
perform sync operations.  While the application is in the foreground this
is fine since this thread just checks the Sync configuration and makes HTTP
calls to sync if a sync timeout has been reached.  Because we want a
real-ish time experience our demos keep this timeout rather low.

Prior to Android O when the application is in the background these
aggressive sync timeouts keep the local data updated until the application
is killed by the system.  After Android O those requests fail and will
begin to call the failure callback while the application is backgrounded.*
 The way that Google advises apps to work around this is to use the
JobScheduler APIs.

JobScheduler has one downside though, you can't schedule background tasks
to run as frequently as the sync APIs want to run.  I believe the minimum
is once every 15 minutes.  For polling from the background this probably
isn't a big deal especially if there is a way to return the app to a more
aggressive state when it is in the foreground.

For the next sprint the client SDK team is looking at implementing
JobScheduler for sync because this will make the sync APIs work better in
Android O.  Does anyone have any objection/points of discussion or
clarification to the behavior and restrictions I mentioned?

Thanks,

Summers

* Specifically if the phone has gone into Doze mode.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/feedhenry-dev/attachments/20170815/c2b63a1e/attachment.htm>


More information about the feedhenry-dev mailing list