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 optimization #72

Open
shepelroman opened this issue May 27, 2020 · 1 comment
Open

Battery usage optimization #72

shepelroman opened this issue May 27, 2020 · 1 comment

Comments

@shepelroman
Copy link

Hi Matt,
Thank you for your open-source library. We are developing an app for personal tracking emissions of CO2. So we are using your library to detect transport user uses. We have an issue with battery usage. App track user activity all the time and the battery become dry very fast.

I used this:
loco.dynamicallyAdjustDesiredAccuracy = true
loco.useLowPowerSleepModeWhileStationary = true

Please may I ask your advice on how we can increase and optimize usage of a battery energy?

@sobri909
Copy link
Owner

Hi!

With those settings, LocoKit will be running at peak efficiency, and can maintain uninterrupted recording sessions for 24-48 hours on a single battery charge (or 2-4 days on larger model phones).

You should profile your app in Instruments Time Profiler for a while, examining the CPU time use of the UI, and potentially any background tasks you are using. The most likely candidate for excess energy consumption will be UI and other aspects of the app separate from LocoKit.

Also, at the moment your API key is disabled. I saw quite high API usage from your API key, but could find no contact information for yourself (name, email, etc), and couldn't find a website for your app. So you are possibly seeing increased CPU usage if your app is making repeated failed attempts to use LocoKit server API calls.

If you could provide me with some contact details, and information on my app, I can reenable your API key, to assist with the latter.

Thanks!
Matt

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

2 participants