transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.65k stars 426 forks source link

Issues With Android 9 #942

Closed Namec closed 4 years ago

Namec commented 4 years ago

Currently i am doing my tests with two devices

1 - OS Version Android 8.1 2 - OS Version Android 9

on the 8.1 device, everything works well, the backbround Task is working corectly and it rigers the in_vehicule activity.

but on the Android 9 device, i receive only one location and then it goes blind, when i start the plugin.

any idea about this.

best

christocracy commented 4 years ago

see http://dontkillmyapp.com

Namec commented 4 years ago

i think that everything is ok from that side (http://dontkillmyapp.com)

i managed to solve this by assigning : BackgroundGeolocation.changePace(true)

when i start the plugin, and then it works OK.

then my new question is :

when i force the moving status when changing pace to true, doest it detect when it's really back to stationary mode ???

i added : stopTimeout: 5

but i don't know if it can do the job

christocracy commented 4 years ago

doest it detect when it's really back to stationary mode ???

No idea. That's up to your particular device. Why not try it and see?

Namec commented 4 years ago

After tens of tests i found the probleme !!!

my setup trigers the in_vehicule only, and doesnt work on Android 9 (tested on Oppo A9 and Infinix S4)

but when i added the walking activity.

i found that the plugin works well, but the recognized activity is always Walking, even if i drive 100 Km by car.

is this related to the OS version or the hardware it self.

and do you have any advice to manage this.

best

christocracy commented 4 years ago

is this related to the OS version or the hardware it self.

Probably the specific hardware of that device.

and do you have any advice to manage this.

No. The ActivityRecognition API from play-services is a "black box" with only an on/off switch. There is no configuration to it. You turn it on and magic happens. This is proprietary code made by Google. It aggregates sensor data from accelerometer, gyroscope and magnetometer to output an answer: on_foot, in_vehicle, etc. It totally depends on the quality of sensors of that particular device. Garbage in = garbage out.

Namec commented 4 years ago

then my only two choices :

1 - avoid auto tracking, and make the service enabled/disabled by a user action 2 - try a 3rd party library to get the speed, and if it's more than 10, i'll trigger tracking

let the force be with us

Namec commented 4 years ago

damn !!

this thing gona drive me Crazy !!!

now i am discovering that when using a position simulator (Mock Location) like Lockito, everythings works fine.

but when driving a real car, i have a lot of problems

christocracy commented 4 years ago

Show me the Config you’re using. You completely ignored the issue template which asked you that information, including a bunch of other helpful info, such as device model, os version, logs. You provided nothing.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

stale[bot] commented 4 years ago

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.