{"id":26222255,"url":"https://github.com/walles/batterylogger","last_synced_at":"2026-04-24T06:33:39.625Z","repository":{"id":21198806,"uuid":"24510275","full_name":"walles/batterylogger","owner":"walles","description":"Logs and plots Android device battery usage over the last month","archived":false,"fork":false,"pushed_at":"2019-01-23T14:43:28.000Z","size":939,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-27T16:14:11.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/walles.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-26T18:15:06.000Z","updated_at":"2023-11-27T12:10:49.000Z","dependencies_parsed_at":"2022-08-28T05:40:40.649Z","dependency_job_id":null,"html_url":"https://github.com/walles/batterylogger","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/walles/batterylogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Fbatterylogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Fbatterylogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Fbatterylogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Fbatterylogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/walles","download_url":"https://codeload.github.com/walles/batterylogger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Fbatterylogger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32212807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-12T16:51:39.814Z","updated_at":"2026-04-24T06:33:39.605Z","avatar_url":"https://github.com/walles.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"This app will log and plot battery drain speed up to one month\nback. The plot will include markers for when things like app or OS\nupgrades have happened.\n\nThe idea then is that using this information it should be possible to\nfind out what makes battery usage increase.\n\n\nInstalling\n----------\nEasiest way is to get it from Google Play:\n\nhttps://play.google.com/store/apps/details?id=com.gmail.walles.johan.batterylogger\n\n\nBuilding\n--------\nBefore building the project you need to run `render-graphics.sh` to\nconvert `gfx/logo.xcf` into icon resources.\n\nYou also need to add a `fabric.properties` file in the root of the\nproject. Here's one that will enable you to build and run:\n```\napiKey=0\n```\n\nIf you want to do it properly, [set up a (free) Crashlytics\naccount](http://try.crashlytics.com/) and use this `fabric.properties`:\n```\napiSecret=YOUR_BUILD_SECRET_HERE\napiKey=YOUR_API_KEY_HERE_\n```\nThe values can be retrieved from https://fabric.io/settings/organizations\nby clicking the (very small) `API Key` and `Build Secret` links.\n\n\nReleasing\n---------\n1. Do ```git tag``` and think about what the next version number should be.\n2. Do ```git tag version-1.2.3``` to set the next version number.\n3. ```./gradlew --no-daemon build```\n4. ```git push --tags```\n5. Upload ```build/outputs/apk/BatteryLogger-release.apk``` to [Google\nPlay](https://play.google.com/apps/publish)\n\n\nTODO\n----\n* Add a tab where we list installed apps and the average drain speed\nover the time each app has been installed (much like the built-in\nbattery app). Clicking on an app should expand that line and show\nper-app-version stats, as well as not-installed stats if available.\n\n* Add a .travis.yml to run the unit tests on pull requests and pushes.\n\n* If we change the system clock, think about how that would affect\nboot timestamps, the system sampling's reboot detection and the timestamp\nlogging in general, and the drawing of median lines.\n\n* See if we can detect enabling / disabling of Google Now and log\nthat. Or maybe when services start / stop in general?\n\n* Collect application-data-cleared events if possible.\n\n* When drawing the drain lines, try to guess the initial charging state by\ncounting backwards from the first change in charging state.\n\n\nDONE\n----\n* Make Gradle download Androidplot itself rather than having a static\ncopy in /libs\n\n* Implement the Androidplot quickstart tutorial:\n\u003chttp://androidplot.com/docs/quickstart/\u003e\n\n* Make sure we can push to Google Drive.\n\n* Make sure we can show a graph with holes in it.\n\n* Make sure we can label individual points. This would be used for\nshowing events in the graph. Try the PointLabeler as described here:\n\u003chttp://androidplot.com/point-labeling-tools-in-0-5-1/\u003e\n\n* Make sure the graph is zoomable (by dragging vertically) and\npannable (by dragging sideways). Have a look at\n\u003chttp://androidplot.com/docs/how-to-pan-zoom-and-scale/\u003e but use the\nsystem GestureDetector instead of rolling our own.\n\n* Make a data holder class that supports both receiving data,\npersisting it and presenting it to AndroidPlot.\n\n* Make sure we can handle the case when the battery gets pulled on us\nfollowed by a restart.\n\n* Make a service that updates the data holder class with battery level\nchange events.\n\n* Make the main activity plot actual events from the log file.\n\n* Make sure the service notifies the data holder about charger connects\nand disconnects.\n\n* Don't keep track of charger state; just store start/stop charging as\ninformative events and don't report negative drain.\n\n* Make sure the service starts on reboot.\n\n* Make sure the service notifies the data holder about shutdowns and\nreboots.\n\n* Tune the zoom sensitivity.\n\n* Make double clicking the graph zoom out as much as possible.\n\n* Make sure the service notifies the data holder about app upgrades,\ninstalls and uninstalls.\n\n* Don't print numbers at the points in the graph\n\n* Zoom around the finger, not around the middle\n\n* Remove the lines between the vertices\n\n* Make the X axis labels look sane at different zoom levels\n\n* Rewrite the data collection service to sample the system state\nevery 15 minutes and deduct data points from the differences between\nthose states. The reason is that we can't trust our service to stay\nalive (real-life observation).\n\n* Make sure the service notifies the data holder about OS / kernel\nupgrades.\n\n* Print proper app names and versions when logging app removals.\n\n* Think about how to show overlapping info events. With the new\nsample-based approach we simply don't generate any overlapping\nevents.\n\n* Draw a median line across each series.\n\n* If the log file doesn't exist or the plot is empty for some other\nreason, display something explaining that to the user.\n\n* Make sure we rotate the history file when it gets too big. When it\ngets bigger than 400kb, we drop the first 25% of all events.\n\n* Switch to pinch-zoom; the current scheme makes it too hard to scroll\nsideways. Try using ScaleGestureDetector for this!\n\n* Think about font size for the what-happened texts in the graph. Should\nthey be resizable? They should at least default to some size related to\nthe system font size setting.\n\n* Fake the data when running in the emulator\n\n* Right now if you \"exit\" the app by pressing the Home button, it will\nshow stale data the next time you activate it. What should we do about\nthat? When becoming visible, if the most recent data point is older than\n1h or so, reload the history.\n\n* If the sampling service throws an exception, store the exception stack\ntrace in a world readable file in a world readable directory.\n\n* Make History.createHistory() create its history by synthetic SystemStates\nrather than just adding history events.\n\n* Replace the start/stop-charging messages by green lines at Y=0 while\ncharging?\n\n* Find out why we don't get any lines on the device (but we do get dots)\n\n* Verify that sampling actually starts after rebooting the device.\n\n* Make sure the y=0 lines are visible\n\n* Make an icon.\n\n* Remove the Settings thing, it's empty.\n\n* Make sure the Y axis has units.\n\n* Replace the medians by something else? Averages? Least square approximated\nlines?\n\n* Find out why the simulator doesn't show any data. It was because there were\none or more samples, and then we showed them instead.\n\n* Only show text events if we're zoomed in enough, either by the\nnumber of visible events or by a certain amount of time (one day?).\n\n* Make dots less visible; either smaller or with alpha. The point is\nthat we want the drain lines to be more visible than the dots, even\nwith a lot of data in the graph.\n\n* Try turning the phone with an almost-empty history. Note how you get\n  the same dialog over and over. Fix that so that the dialog only\n  shows up once.\n\n* Make sure there's enough room for the tick labels at the bottom;\nthere wasn't on one of the beta devices.\n\n* Hint people about using two finger zoom get the details back.\n\n* Add a legend\n\n* Double tapping should zoom out fully, or if we're already zoomed out fully we\nshould zoom in to two days resolution.\n\n* Double tapping should animate the zoom operation so that it's obvious to the\nuser what's happening.\n\n* Make sure the legend is visible at once during startup. Right now it pops\ninto view a bit late, forcing a resize of the plot.\n\n* When starting the app, animate a zoom out from about 24h to max to hint users\nthat zoom affects which in-graph labels are visible.\n\n* When the zoom animation is done, log the time, number of frames and\nframes per second.\n\n* Try removing the sample series while zooming and see if that improves\nzoom performance.\n\n* Mark restarts by vertical red lines. That would make the\n  increasing-battery-use-until-reboot pattern on my phone more\n  visible.\n\n* Make sure we're actually removing samples older than one month\n\n* Auto generate version code and version number from git describe.\n\n* Enable making debug builds without Crashlytics keys.\n\n* Replace AndroidPlot with roll-my-own\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalles%2Fbatterylogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwalles%2Fbatterylogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalles%2Fbatterylogger/lists"}