Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26947] Android: Foreground Services do not work reliably

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionHold
Resolution Date2019-04-22T17:32:09.000+0000
Affected Version/sRelease 8.0.0, Release 7.3.1, Release 7.5.1, Release 8.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, engTriage, foreground, service
ReporterHans Knöchel
AssigneeAbir Mukherjee
Created2019-03-28T13:16:23.000+0000
Updated2019-04-22T17:45:05.000+0000

Description

One of our technology customers is using a module we built for them that utilizes foreground-services (7.3.0+) and the location provider API to record geolocations and it seems to randomly fail: {quote} In the foreground, the tracking on all devices under Android 7 and Android 8 delivered sufficiently accurate results. On a Galaxy S5 under Android 6 no geo data could be recorded. If the app is running in the background, the results are very different. On Huawai Devices, the Foreground service is often terminated - this happens very differently, sometimes after 16 minutes, sometimes even for the first time. after 50 min. A Google Pixel 2 with Android 8 behaved similarly. The least problem with the Foreground service seems to be on Galaxy devices. {quote} We hope this can be resolved by some fine tuning.

Comments

  1. Joshua Quick 2019-03-29

  2. Joshua Quick 2019-04-22

    The following community module attempts to keep the app alive by having the Android AlarmManager poll it at regular intervals (as I stated above in my last paragraph above). This should work, but spawning a wake-lock every interval via the AlarmManager is frowned upon... unless your app "really" needs it. https://github.com/AppWerft/Ti.Watchdog

JSON Source