-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working on android simulator and real device in sleep mode. (related issue #2 ) #7
Comments
@byCedric ProblemThe problem was after some minutes phone enters sleep mode, It stops logging ( on timeInterval 1000ms ) So for ideally, it should have no problem on the code and should work right. SolutionsSo I fixed it to not iterate, but just dump in the whole locations array like this I didn't check that the locations object is exactly the locations that the phone tracked, but I think it would be, I'll test it soon. I will request PR about this. Thank you! |
@byCedric I actually used my app to track my running, I ran about 3km, around 20min, while my phone in sleep mode. I think the arrays, android giving to me while on sleep mode are not accurate. And I need to look into it. as you see below, there are some duplicated points recorded. I also recorded with 'Strava'(a popular app for running tracking ). We can see the difference comparing with it. |
@HYJ29 Some nasty fluctuating points appear especially with Android. Have you tried any filtering of the noisy data such as Kalman filter? |
@vasildimitroffhristoff No, I have not. I don't have much knowledge of filtering raw data. Do you think it would be the solution~? |
@HYJ29 we found out that the array with the locations coming from the background task after the device is awaken from sleep are in messed up order. Try sorting them by timestamp. I think it will fix some of the issues with the strange lines appearing on your track. |
@vasildimitroffhristoff Thank you for letting me know! I'll try that |
@byCedric
I really thank you for your effort. 👍
But the problem keeps happening and I couldn't find anything from google for several days.. So I came back again..
Would you try
Then you will find the tracking and logging stops.
I'm sure you can reproduce it!
just background..
I set the time as 1000 ms ( because I need to track a running person )
And I think this work on ios, not terminating process or app on sleep mode ( I tested about 1hour )
but on Android
On Android 10 simulator, this stops on sleep mode. For me, it logs about 72 locations and stops.
If I get out from sleep mode, It keeps logging.. ( for some reason It goes crazy.. )
The main problem is it stops tracking location on sleep mode..
and
for some reason, I think expo SDK40 gives me a permission error like this below
https://forums.expo.io/t/sdk40-android-unhandled-promise-rejection-error-not-authorized-to-use-background-location-services/46508/4
This makes me really exhausting. I want to know is it about google policy So I should wait for a while until expo team deals with it? or it's just a problem of me?
Originally posted by @HYJ29 in #2 (comment)
The text was updated successfully, but these errors were encountered: