michael-cheung-thebus / foreground_service

Other
43 stars 29 forks source link

Location Service, Timing Issue and Service Stops #38

Open nirmalraj2000 opened 4 years ago

nirmalraj2000 commented 4 years ago

I want an application to be running in the background to collect the location data. When the app is open , it gives a accurate result. But , when the app is closed ,it collects location imformation at a improper interval. Some times it collects multiple records with in 10 to 20 seconds (Note : The Actual time period between collecting each record is 1 Minute).

PayLoad : 1) getting Device Current location for every one second 2) It Reading/Writing single record in two SQFLITE database 3) Time computation from DateTime.fromMillisecondsSinceEpoch(data);

Worst Case Scenario : When My app is running in foreground and if I open some cpu intensive app or play some games ,the system automatically closes the app.

My Android Version : Huawei Honor 9.1.0.168 (ANDRIOD PIE)

Here are some screenshots, refer the duration

Image 1 shows a perfect reading and Image 2 shows imperfect reading