Skip to content
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

Battery Usage #44

Open
ay8s opened this issue May 18, 2017 · 12 comments
Open

Battery Usage #44

ay8s opened this issue May 18, 2017 · 12 comments

Comments

@ay8s
Copy link

ay8s commented May 18, 2017

In the last 24 hours it's used 53%. Wonder if it might be better to use significant location changes in the run up to WWDC before switching out to more accurate location?

If it helps, my side project for location tracking for another event is native and cook possibly hook it up with the family DB. Although know you're wanting to check out React Native. 👍

@matthijs2704
Copy link

Are you sure you're running the latest version? As battery usage has been significantly improved in the last few betas... It's now hardly noticeable (definitely not as significant as 53%, which I also had in beta 54 or so)

Not sure about this one, but hooking that up would mean two apps to achieve the same result, right? Haha, and would kinda defeat the purpose of @KrauseFx's app :P

@ay8s
Copy link
Author

ay8s commented May 18, 2017

Using 1.0 (60) so looks to be the latest at least in my TestFlight app.

Was thinking the native code would replace the React Native version if battery usage can't be improved rather than be seperate. Although I know @KrauseFx is using it to check out React Native.

@KrauseFx
Copy link
Member

Mh, that should have been fixed... weird. Yeah, feel free to look into the project and see if you can improve it 👍 Having a less accurate location until WWDC starts sounds very reasonable to me

@ay8s
Copy link
Author

ay8s commented May 18, 2017

Updating iOS to see if that improves things at all.

@matthijs2704
Copy link

Hmm weird! But having less accuracy before wwdc doesn't solve the problem and would mean that everyone at WWDC would have really bad battery life. Which could also mean that they will either turn off background location sharing or even delete the app

@ay8s
Copy link
Author

ay8s commented May 18, 2017

Will see if the iOS update improves things, did see some issues around locationd reported by others in the forums and spotted that a bunch in my devices logs.

Changing it to significant location updates would improve it prior to WWDC but not during the conference, likely when battery life is needed most. Will see if I can spot anything, although not used React Native too much.

@ay8s
Copy link
Author

ay8s commented May 19, 2017

Just to update, still seeing battery usage with the latest update to iOS and the app. https://cl.ly/2T0T151B0f2j

@stephensilber
Copy link

My guess as to why battery drain is high is due to the distance filter being set to 250m. This is still keeping the GPS chip on constantly in the background. A better solution might be to rely on significant location updates more, and when that fires, ramp up the GPS chip until you get an accurate read, and then ramp it back down. Anything over 1km switches to cellular triangulation + wifi instead of keeping the GPS chip on, which has much lower battery consumption.

An alternative solution could involve adding a geofence once a user's location stops moving for a certain amount of time, and only ramping up GPS once they break out of that geofence.

https://github.com/wwdc-family/app/blob/master/app/mapViewComponent.js#L224

@KrauseFx
Copy link
Member

Sounds good to me @stephensilber 👍 If you have some free time, feel free to submit a PR improving the battery usage 🚀

@stephensilber
Copy link

Will try to put something together before the weekend 👍

@klaas
Copy link

klaas commented Jun 1, 2017

Some info from a first time install yesterday:

I installed WWDC.family for the first time 17 hours ago and it drained my phone immediately. It seems to use battery in the airplane mode as well, because during the 16 hours in the background the airplane mode was turned on for about 7 hours.

img_8437

@stephensilber
Copy link

I was playing with this last night. Not sure I'm competent enough with React to get something useful together by this weekend. A simpler fix would be to only user significant location updates, which fires whenever a user moves 500m or more. This will make it a little less accurate, but maybe an option to toggle high accuracy in the settings would be a suitable workaround for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants