Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
View Poll Results: Should we split the BBS thread into a DEV and a Q&A thread?
Yes 651 50.78%
No 216 16.85%
I don't care 415 32.37%
Voters: 1282. You may not vote on this poll

 
Post Reply+
Tip us?
 
chamonix
Old
(Last edited by chamonix; 16th April 2013 at 09:03 PM.) Reason: New Release
#1  
chamonix's Avatar
Recognized Contributor - OP
Thanks Meter 9229
Posts: 3,248
Join Date: Nov 2008
Location: Berlin
Default [APP][2.1+][16 Apr. - V1.13.4] BetterBatteryStats

I wrote BetterBatteryStats because I was missing the great battery history that Spare Parts allowed to call on Froyo:
- General "other stats "overview: Awake, Deep Sleep, Screen On, Phone On, Wifi On, Wifi Running ratios
- Kernel Wakelocks
- Partial wakelocks
- Alarms/Wakeups
- CPU States
- Network stats
- Process stats with User and System CPU time


BetterBatteryStats is calling the "batteryinfo" service of Android to retrieve data already lying there without generating overhead.

BetterBatteryStats is focussing and has been tested on Froyo, Gingerbread, Honeycomb (3.1, thanks to daveid), ICS on different ROMs and Kernels.

What are wakelocks and why should you care about them?
When it comes to Android the most discussed and commented topic that I know is battery drain / battery life. I'm a quite heavy user because I spend a lot of time on the train every day reading my mails, surfing and listening to music but still my phone is off for a long time during the day and while I accept the battery being drained while I use the phone I care about it draining slowly while "doing nothing".


Wakelocks or to be more precise partial wakelocks is a pattern (in fast a class) than helps devs to make sure that important pieces of their code do not get interrupted.
Basically the phone has (simplified, kernel devs don't shoot) three states:
1. awake with screen on
2. awake
3. sleeping (that's you phone favorite state)

The transitions are from (1) to (2) and finally from (2) to (3). Now as long as you use your phone it's in (1) and does not leave that state as long as you keep using it interactively. If you stop using it the phone is aiming to go to (3) as fast as possible.
And here's where wakelocks are important: as our phones as smartphones they tend to do background processing. Some of this processing is important like e.g. making a phone call, listening to music or synchronizing your contacts.
As the phone wants to go from (2) to (3) and on the other hand you don't want to hang up while you are in a call the app keeps hold of a wakelock to prevent that transisiton. When you hang up the partial wakelock gets release and here we go (the phone goes to sleep).

So partial wakelocks is a tool and it's not something that we should forbid for obvious reasons. Now there are cases when the design on an app is not real life proven (conditions of poor of no converage) and the wakelocks have negative effects because they are held unnecessarily or for too long.
BetterBatteryStats identifies these wakelocks and using your expertise or the once from our users here you can understand what happens and find a strategy to change that for the better.

Try it yourself

If you need help
Always add the whole context when asking for help. Most of the times a dumpfile is helpful, sometimes screenshots showing your observations may help as well.

Before posting a dump please make sure that the references for kernel wakelocks and alarms were processed correctly. Reading a dump takes a few minutes and it would be great if you could not waste the time of whowver studies in, aiming at helping you.
Generally a dump "since unplugged" is better than "since charged". When you start your analysis make sure to follow following procedure:
- plug/unplug the charger
- leave the phone alone 1-4 hours
- save a dump and check that the chapters "Kernel wakelocks" and "alarms" (if you have root) are populated
- Post the dump as attachement

I will not reply to posts with incomplete dumps

Reporting bugs
If you want to report a bug please make sure:
- that you can reproduce the problem
- explain what the problem is, how you could reproduce it and what is going wrong (a sentence lke "xxxx does not work for me" is a waste of your time and wil be ignored)
- enable debug in advanced prefernces
- post a logcat

A good read about reporting bugs

Thanks
To nobnut for donating me a Nexus S for testing
To nobnut and brandall for their support, encouragements, testing and constructive feedback in the early stages of the development.
To @cri for the new icons / logo

To suku_patel_22, jeremysherriff, Karpfenhai, Tungstwenty and It_ler for their help in this thread and their systematic testing my betas and RCs

To Entropy512 for providing support and insights about kernel wakelocks and helping making BBS a better tool
The Following 3,292 Users Say Thank You to chamonix For This Useful Post: [ Click to Expand ]
 
chamonix
Old
(Last edited by chamonix; 3rd May 2013 at 11:12 PM.) Reason: moved betas and RCs to hidden block
#2  
chamonix's Avatar
Recognized Contributor - OP
Thanks Meter 9229
Posts: 3,248
Join Date: Nov 2008
Location: Berlin
Post Release

BetterBatteryStats is available on the Android market (https://market.android.com/details?i...erbatterystats) for what I believe is a fair price. If you like my work and want to support me please fell free to show your gratitude by buying the app.

Follow me on twitter to be notified of updates and get insights in new features/developments.

xda edition: for xda-dev members see the attachement (please play fair and do not redistribute the app without my consent).


Changelog
1.13.4.0
Same as B2, no changes

1.13.4.0B2
#391 support all implementations of sqlite

1.13.4.0B1
Refactoring of database access to avoid locking

1.13.3.0
Fix for users having FCs due to database lock problem
1.13.2.0
Fix for users having FCs at start

1.13.0.0
Unchanged from RC2



Older Changelogs
 

1.13.0.0RC2
#384: salted the account name before hashing
Fix for stats not reflecting the combo boxes anymore for some users after a reference refresh

1.13.0.0RC1
Fix to make sure spinners do not get out of sync
#383: Fixed battery / voltage level in dumpfile
A few typos
Added timestamp to logcat

1.13.0.0B5
#191, #334: Added "share" option for saving/sharing dumpfiles, dmesg and logcat
#381: fixed database exception occuring sometimes and potentially responsible for the blank stats happening from time to time for some users
#382: dmesg requires root for newer kernels

1.13.0.0B4
Added some logging to debug percentage problem: adb logcat | grep StatsAdapter
#377: refactored KB handling
#379: refactored "raw" stats
Stats row shows interactive areas (glow)


1.13.0.0B3
#236: mask account info
#378: fixed fallback stat in DashClock widget

1.13.0.0B2
#376: no icon in process view
#377: missing KB icon

1.13.0.0B1
#367: added dashclock support
#375: added JSON dumpfile format support

1.12.4.0
#372: Widgets do not update on a fresh install
#373: change default widget fallbacl to "boot"
#374: refresh spinners and user refresh causes the cache of refs to get flushed/reloaded from data

1.12.3.0
#369: small widget uses wrong prefs
#370: Other stat times/total time incorrect

1.12.2.0
#366: fixed FC when creating a dumpfiel from tasker
Improved logging
Fixed concurrency problems potentially leading to weird display
Fixed a caching issue

1.12.1.0
Fix migration issues from 1.11 leading to inconsistent stats
#359: make sure BatteryInfoUnavailableException does not other stats to be shown
#361: a better fix for battery/voltage using current instead of "to" stat
#363, #364, #365: fixed different error conditions from crash reports

1.12.0.2
Skipped 1.12.0.1
#356: bug when migrating from 1.11
#357: to battery % always shows current value

1.12
Same as RC12, no changes

1.12RC12
#356: fixed empty stats after screen being rotated

1.12RC11
#223: active monitoring
#346: save 'unplugged' ref at first use to avoid empty refs
#347: pref to diable widgets to be refreshed at screen on
#344: better fix for errors in parsing network/alarms causing the whole reference to be saved empty

1.12RC10
#302: added credits for used libs in app besides git (under help)
#342, #345: remove log verbosity when debug advanced pref is not enabled for cleaner logcats
#343: fixed alarms parsing of details for flg= and cmp= (both pre- and post 4.2.2)
#344: error in parsing network stats causes the reference to be saved empty (potentially a cause of reference shown as not having been created)

1.12RC9
#323: pref for saving dumpfile to private storage
#337: implement 48dp rhythm
#338: optimize list real estate
#339 (partially): fixed tiny font for widget being same as small

1.12RC8
#341: fixed alarms for android 4.2.2

1.12RC7
#327: spinner refresh issues
#331: sometimes the stats shown do not reflect the spinner selection
#333: charged and unplugged should not be in the "to" spinner as that makes no sense

1.12RC6
#307, #328; widget stops updating and stays blank
#327: spinner refresh issues
#329: fallback ref in 1x1 widget is never loaded
#330: an attempt to fix wakelock issue when su commands are blocked

1.12RC5
#326: fixed rate dialog showing at each start
Some profining
Less intrusive logging if dedug is disabled in prefs

1.12RC4
New readme and rate dialogs
#325: times in wakeup_sources are a factory 1000 to small

1.12RC3
#321: fixed spinner heights
#322: filter "0" cpu states
#324: add marker to dumfile if using wakeup_sources

1.12RC2
#320: added experimental support for wakeup_sources (newer kernels deprecate /proc/wakelocks)

1.12RC1
#318: automatically refresh current when entering the main screen (can be changed in adv. prefs)
#319: "to ref" is shown by default (can be changed in adv. prefs)

1.12B9
#316: FC when calling BBS from watchdog notification
#317: 2x2 widget showing 0 KWL/PWL

1.12B8
#312: Fixed negative CPU percentages
#313: refresh after events creating new references show inconsistent references (from/to)
#314: proper migration of default stat type prefs coming from 1.11
#315: fixed cause of "unknown error"

1.12B7
#310: fixed partial and kernel wakelocks always being the same and icons missing
#311: fixed kb reader thread not retriieving online content

1.12B6
Changed the way su operations are processed
Some fixes regarding the refresh of the spinners
Make sure all root operations are running in an own thread

1.12B5
#308: since boot can not be selected
Fixed callstack when updating a reference
Widget now have a lightweight method for obtaining the current data without causing the cache to be updated
Spinners show references sorted in ascending order
Fixed spinner not showing all existing references

1.12B4
#306: fixed broken dumpfile
Added pref to show/hide the "reference to" spinner
Added screen on reference (saved when watchdog is active)
References are now stored in a database
From/To references are chronogical
1.12B3
#303: invalidate "current" when other refs are saved
#305: dissapearing refs

1.12B2
Some tuning
#298: Fixed FC on raw alarms
#299: Watchdog does not report when awake > threshold
#300: fixed spinner height

1.12B1
#187: freeze current time
#193: add screen brightness states to "other" stats
#274: copy wakelock to clipboard
#279: add option to save dmesg
#286: add mV/h to dumpfile
#290, 292: typo, wording
#296: kbreader is now asynchronous and doesn't block UI thread when github is slow

1.11
no change from RC8

1.11RC8
#289: FC on package info screen for pre-ICS devices

1.11RC7
#288: usability issue in permission view fixed

1.11RC6
#276: another attempt at fixing scheduled dumpfile creation from tasker
#287: fixed ratio calculation for battery drain in %/h

1.11RC5
#280: added legend to permissions tab
#283: unticking watchdog option "Screen off" stops the EventHandler service
#284: added drain per hour to battery drain text on screen and dumpfile

1.11RC4
#281: Fixed bad reference on unplug when 100% charged
#276: fixed dumpfile creation from tasker
removed delimiter till a configurable version can be provided

1.11RC3
A better fix for widgets being updated
Nicer implementation of package info using a tabbed pager (using ActionBarSherlock)
Changed in-app help and messages to make the conect of references clearer
More speaking "missing ref" texts

1.11RC2
#277: more prominent delimiter in listview
fixed calculation of since value

1.11RC1
#229: show autorun and other package info like permissions and services, click on the icons
#279: reverted the time reference for since and calculations back to 1.9.x
#275: widgets do not always refresh: hack to make sure the widget always get the broadcasts from the launcher, even if the lancher is not complying with standards (see http://stackoverflow.com/questions/7...p-is-restarted)
yet another attempt to fix since screen off dump incomplete when created at wakeup from taker plugin
big refactoring (only relevant for the ones reading the code)
1.10.5
No changes from RC1

1.10.5RC1
Make sure app is not installed to SD (watchdog, widgets, detecting boot and unplug won't work properly)
Writing references respect "root features" settings
Fixed error condition in widget (potentially not showing data)
Refactored broadcast handlers
Another attempt to fix dumpfile creation in tasker plugin

1.10.4
Fixed logcat permission

1.10.3
Some changes in widget code
#270: added option to save logcat from app

1.10.2
#263: adv prefs to turn on stats while plugged
#264: error happening when reading other stats should not skip the whole stats
#265: reference summary shows data instead of counts (in dumpfile and log)
#266: difference in "since" time between widget and screen
#268: error when checking charger status causes exception

1.10.1
#261: missing cpu states file causes references to stay empty
#262: battery level handling causes exception

1.10
A few changes in logging
New ?????

1.10RC3
#257: referencea are missing processes
#258: if debug pref is not checked since shows 0s

1.10RC2
#256: silent crash on progress dialog
#252: a better fix for the FC on enabling root features
Typo in prefs
Added drain to on screen battery info

1.10RC1
#251: added batter level from/to to screen (and a pref to enable/disable it)
#252: an attempt to fix the FC on enabling root features
#254: incomplete (ref missing) dump from tasker
#255: not systematic crash on creating custom ref

1.10b7
#248: added raw CPU states
#249: ratio of other stats is calculated against something that is smaller than "since"
#250: when a reference is null all stats should show that there is no reference availble

1.10b6
#247: fixed deep sleep sometimes being substracted twice, causing negative values

1.10b5
#245: source of "since" is now the reference
#246: added battery voltage/level from/to to dumpfile
Removed unneeded API calls (that were to cause to batteryinfo stopping)
New error handling exposes API errors to the user

1.10b4
#243: deep sleep not showing
#244: no stats when plugged (as some internal registers do not count when plugged, leading to inconsistencies)
Removed pre-1.9 migration code that may lead refs to be deleted at start
#235: grey background for bars


1.10b3
#234: show icon for stats providing package info
#8: call application settings when package info is available (click on icon)
Refactored error handling
Workaround to avoid SuperUser to obcess about asking for rights

1.10b2
#240: removed "test" menu
#241: fixed nested menu causing FC on SDK<14
#242: removed froyo specific references as BBS is not depending on Android's implementation of refs anymore

1.10b1
#209: added since boot ref
#227: fallback to since boot if default stat type is not available
#228: pref to control log level
#230: two step save of references to avoid empty references if su request times out
#231, #232: reorganized preferences
#233: reorganized menu
#238: process Siyah "deleted: " kernel wakelocks properly
#239: network stats / alarms are disabled by default, can be turned on in advanced prefs
1.9.2.1
#226: reference info to dumpfile

1.9.2 (|xda only)
Fixed error condition where "no ref since charged" appeared after a while when a reference was present
#224: screen on time is too high in "since screen off"

1.9.1 (@xda only)
Added more logging to references
#213: Tasker plugin does not create dumpfiles / custom refs
#216: more compact CPU state view
#218, 220, 221: various fixes from Google Play logs

1.9.0
#208: tasker plugin writes zero-sized dumpfiles

1.9.0RC9
#205: disabled trace logging by default (can be turned on with setprop)
#207: discrete KWL detection added (hint is in dumpfile)

1.9.0RC8
#204: data inconsistency sometimes showing data with values > since

1.9.0RC7
No fixed, more logging
1.9.0RC6
#201: missing line break after os version in dumpfile
#203: when substracting eventX-YYYY kernel wakelocks the package list must be merged

1.9.0RC5
#196: added os.version (/proc/version) to dumpfile
#199: package info for eventX-YYYY caused some event lernel wakelocks to get removed
#200: "Deep sleep" and "awake" percentages were not always summing up to 100% in "other" stats

1.9.0RC4
#188 (again, this time correctly): Network totals are sometimes incorrect while transfer volumes are correct
#195: eventX-YYYY kernel wakelocks are being decoded, listing all the process names / packages involved
#197: inconsistent reference calculations / display for partial wakelocks (added back full logging as well)
#186: auto-refresh of widget can be disabled: then they are refreshed manually + on screen on (always anyway)

1.9.0RC3
#188: Network totals are sometimes incorrect while transfer volumes are correct
#189: exiting references (from 1.8) are being invalid in 1.9 so first start of 1.9RC3 will delete those
#194: Fixed sometimes missing "since unplugged" and "since screen off" references, ANR on unplug / screen on, wrong (too high) deep sleep values in both "other" and "cpu states" stats

1.9.0RC2
Please note that comping from pre-1.9 release this release will reset the preferences of default stat and stat type
#183: tapping widget open BBS with disregard to the selected stat/stat type
#184: "test" menu removed
#185: broken stat type constants leading to no values in BBS
#42, 173: (hack) missing perm "android.permission.BLUETOOTH" leads (for unknown reasons) to the error that BBS can not connect to the batteryinfo service
1.9.0RC1
#1, 181: added network usage report back
#33: added an alert mechanism (watchdog) to notify about high awake times while screen was off
#125: the content of "other" stats can be defined on prefs
#140, 141: preferences to set the stat/stat type to be shown when bbs is opened by tapping on a widget
#165: messed up icons sizes
#166: widget writes log to SD
#167: text about ratios poorly formulated (in how to)
#168: automatically switch widgets to another stat in case "custom" is defined and no reference is available
#169: add battery percentage and voltage lost during reading to dumpfile
#170: widget does not refresh till screen is rotated on tablet
#174: widget alarm still called when screen is on even when no widgets were added
#175: implemented cpu state reporting
#177 "since" time not always shown
#178: functionality to decode eventX-YYYY processes
#182: graph layouts are not looking good on high res devices
1.8.1
#162: Radio listed twice in dump, first occurence not working for all API
#163: shorten durations > 1 day in widget by removing seconds
#164: graph bars not displaying when coming from 1.7.x with default bar height

1.8
no code change to RC8, just icons and inline doc

1.8RC8
#159: make sure to delete all references on boot to avoid inconsistencies
#160: fixed 2x2 widget graph order to be consistent with labels
#161: made colors of 2x2 widget consistent with 1x1

1.8RC7
#158: fixed FC when creating dump file for API < 14

1.8RC6
#154: added more build info to dump file
#155: fixed leaked window condition when progress dialog is showing when activity is gone
#156: more logical sorting of fields in widgets
#157: refresh zone is now the top 1/2 of 2x2 and 2x1 widgets

1.8RC5
#149: 2x1 widget
#150: make widget font size adjutable
#151: setting for widgets to show % or times
#152: preference to show/hide stat type title of widget

1.8RC4
#142: replace icon by transparent bitmap in widget
#143: add analytics for xda edition
#144: reduce fontsize of widgets
#145: log of alarms to /sdcard/bbs_widget_log
#147: report n/a if there is no reference available for that value in 2x2 widget
#148: refresh widget immediately on unplug
#130: better fix for bars being drawn with incosistent size (below top screen)

1.8RC3
#128: removed title from 2x2 widget so save some space
#129: added hot zone (stat type) to refresh 2x2 widget, the rest of the widget launches BBS. For 1x1 the behavior is set in preferences (see also #139)
#130: fixed bar length
#131: adjusted bar heigth on 2x2 widget
#132: wrong data shown when BBS is removed from memory
#133: inconsistent data when custom ref selected and that ref does not exist
#134: Kern. Wl -> Kern WL
#135: preferences for refresh rate of widgets
#136: bg color gamma for 1x1 widget didn't work
#138: tapping on widget lauches the activity from the stack (not a new one)
#139: see #129


1.8RC2
#122: bar height not set
#123: Missing toast after dumpfile creation
#124: tap on widgets open main activity
#126: widget background now has its own alpha pref
#127: adjustable update frequency for widgets
fixed sometimes empty kernel wakelock duration on 2x2 widget (formating error on 0 times)

1.8RC1
#16: 2x2 "expert" and 1x1 simple but powerfull widgets (tap refreshes)
#92: added tasker/locale plugin for saving custom references and dumps
#102: reordered the stats to a "more logical" ordering
#114: experimental: added connection quality to "other" stat
#115: experimental: added signal strength to "other" stat
#117: changed root detection / root access to hopefully solve issues with SuperUser
#120: added deep sleep time to "other" stat
Graph bars (inline) were replaced by a neater design

-1.7.1
#113: fixed inconsistency in wifi running stat (other)

-1.7
#103: changed default pref for stat/type to other/since unplugged
#104: added alarm details to dump
#105: processed and services are not part of dump anymore (default)
#108: added preferences to add/remove chapters from dump
#109: added more details to the "general" chapter in dump
#110: added ability to be moved to SD
#111: added "wifi running" stat to "other"
#112: last alarm from dump was not p****d (formerly known as >999 bug, in the end it was a coincidence)

-1.6.1
#100: fixed "since chanrged" reference to be stored continuously (removed service completely)
#101: removed property to hide "since..." from main screen as this makes screenshots unreadable
#102: changing stat/stat type now refreshes again

-1.6
#68: promoted alarms to main screen
#93: migration to ICS standards (theme)
#94: added follow-me and rate buttons to about/readme
#95: caching of batteryinfo service for more MIUI stability

-1.5.1 Bugfix
#87: added debugging code, fixes FC in MIUI
#88: graphs not working on all ICS ROMs
#89: alarms sometime hangs due to superuser dialog in the background

-1.5
#62: Dmpfile is now named with timestamp to avoid overwriting
#63: if writing a dumofile fails because of unmounted SD and error is displayed
#64: alarms with upper case names / numbers in the package name were being truncated
#65: the retrieval of the online knowledge base was blocking the refresh of the screen under bad network conditions
#66: alarms were added to dump (if phone rooted)
#67: "Actions" menu was renamed to "More"
#70: references "since unplugged" and "since charged" were added to kernel wakelocks. Please note that the corresponding events (unplug, charge to 100% must occur once for the data to be available)
#34: the whole persistence of sample data (custom reference, since.... for kernel wakelocks) was refactored and persistence of samples is now on private storage (files). There is no ned for preventing the user from leaving BBS with "back" as the data is not in memory
#71: graphs now work in ICS
#72: FC on start when the battery service could not be initalized (typical for MIUI as the service is off be default).
#73: added google analytics for a better tracking of how BBS is used. A warning notifies of that change and offers to opt-out if Google Analytics are not wanted
#74: added "raw" kernel wakelocks to the "more" menu

- 1.4.2: fixed #59, mixed wakes in kernel wakelocks
- 1.4.1: fixes #57, FC on alarms for non-rooted phones
- 1.4.0: #55 Kernel Wakelocks are not from /proc/wakelocks, #39 added alarms, #56 fixed wifi scan/locked times
- 1.3.4: a first attempt to bring native kernel wakelocks from /proc/wakelocks
- 1.3.3: #51 Kernel wakelocks sometime show no time/count, #52 BT / Wifi series mixed-up on graph, #54 Wifi locked / scan increase when wifi is off
- 1.3: #45 Added kernel wakelock stats, #49 Added dump to file for history, Added more graphs, #46 Added zoom / navigation on data series, #48 fixed FC on froyo
- 1.2.1: #47 Wifi graph did not show
- 1.2.0: #38 own implementation of battery history and data serie (missing on froyo and honeycomb), #43 FC entering prefs on honeycomb
- 1.1.1: #40 FC when clicking on a list element
- 1.1.0: #6 Added online knowledge base: the online knowledge base describes kown wakelocks, their causes and suggests solutions to remedy to wakelocks. If a wakelock is found in the knowledge base an icon is displayed beside it and clicking on the wakelock open the corresponding KB article, #28 stat types are now consistent with Froyo and Gingerbread, #30 Sorting can be changed between "time" and "count" for wakelocks and processes. A preference was added to persist the sorting order, #32 Custom ref does not preserve sorting was fixed together with #30, #35 Wording of preferences was fixed to make it more self speaking
- 1.0.0: #25 Added in-app and online help and how to (see menu "Help"), #29 Added groupings to unclutter the menu, #18 Added Release notes to be displayed once for each new version, #27 Fixed the app manifest for Android market to show it for other screen sizes/densities too
- 0.9.0: Fix for #26 ("menu" showing dialog), #24 (refresh after changing prefs), added #23 (dump of service info)
- 0.8.4: Fix for #21: Advanced prefs let you set the height of the bars, an attempt for a more elegant fix to #22 by asking when "back" is used to leave the app and there are custom refs that would be lost
- 0.8.3: Fixes for #20, preferences of default stat type were not applied correctly on start, #21 a better attempt to fix graph bar height for devices with higher densities, #22 custom ref is not saved when leaving the app with the "back" button
- 0.8.2: Fix for EVO 3D / Desire HD: on those devices graph bars get calculated with a hight of 0. Under these circumstances draw with a minimum height of 4px
- v0.8.1: Clean-up after app validation, added loggin to GraphableButton to analyse display problem of canvas on EVO 3D / Desire HD
- v0.8.0: New graphics/icons courtesy to nobnut, #15 the 100% of wakelocks can now be selected between total time, awake time, (awake time - screen on)
- v0.7.0: #3 titles of stat types are now speaking, #4 graph bar added to stats, #14 Added menu option to open GB battery history, Added stat type (speaking) to dump, Better haptic: long running operations are threaded
- v0.6.1: Fixed "Since" not being displayed in "Custom Ref" (#13), Wakelock count not being shown (#12), Error message regarding state not being saved (#11)
- v0.6.0: Added menu option "refresh", added possibility for user to set his own "custom" reference (#10), added option to dump stats to a file (#9), added total time since the stat is running to the main screen controlled by preferences (#7), implemented percentages in wakelocks (#4 partially)
- v0.5.1: Improved performance (process and wakelocks were slow on single cpu devices), better name resolution for processes / wakelocks adds more insight to the origin (e.g. previously stated process *wakelock* now tells from what apk ist was held)
- v0.5.0: Added "Other Usage" stats
- v0.4.0: Added preferences for default selection, removed Network Usage due to non resolved issue #1

I maintain A list of features to be implemented and bugs here.
Attached Files
File Type: apk BetterBatteryStats_xdaedition_1.9.2.1.apk - [Click for QR Code] (1.51 MB, 50764 views)
File Type: apk BetterBatteryStats_xdaedition_1.10.0.0.apk - [Click for QR Code] (1.49 MB, 2303 views)
File Type: apk BetterBatteryStats_xdaedition_1.10.1.0.apk - [Click for QR Code] (1.49 MB, 16348 views)
File Type: apk BetterBatteryStats_xdaedition_1.10.2.0.apk - [Click for QR Code] (1.49 MB, 475 views)
File Type: apk BetterBatteryStats_xdaedition_1.10.3.0.apk - [Click for QR Code] (1.49 MB, 1156 views)
File Type: apk BetterBatteryStats_xdaedition_1.10.4.0.apk - [Click for QR Code] (1.49 MB, 6645 views)
File Type: apk BetterBatteryStats_xdaedition_1.10.5.0.apk - [Click for QR Code] (1.49 MB, 7342 views)
File Type: apk BetterBatteryStats_xdaedition_1.11.0.0.apk - [Click for QR Code] (1.98 MB, 42649 views)
File Type: apk BetterBatteryStats_xdaedition_1.12.0.0.apk - [Click for QR Code] (2.10 MB, 1697 views)
File Type: apk BetterBatteryStats_xdaedition_1.12.0.2.apk - [Click for QR Code] (2.10 MB, 3804 views)
File Type: apk BetterBatteryStats_xdaedition_1.12.1.0.apk - [Click for QR Code] (2.10 MB, 37093 views)
File Type: apk BetterBatteryStats_xdaedition_1.12.2.0.apk - [Click for QR Code] (2.10 MB, 2799 views)
File Type: apk BetterBatteryStats_xdaedition_1.12.3.0.apk - [Click for QR Code] (2.10 MB, 2341 views)
File Type: apk BetterBatteryStats_xdaedition_1.12.4.0.apk - [Click for QR Code] (2.10 MB, 7901 views)
File Type: apk BetterBatteryStats_xdaedition_1.13.0.0.apk - [Click for QR Code] (2.11 MB, 1292 views)
File Type: apk BetterBatteryStats_xdaedition_1.13.2.0.apk - [Click for QR Code] (2.11 MB, 649 views)
File Type: apk BetterBatteryStats_xdaedition_1.13.3.0.apk - [Click for QR Code] (2.11 MB, 1136 views)
File Type: apk BetterBatteryStats_xdaedition_1.13.4.0.apk - [Click for QR Code] (2.12 MB, 27710 views)
The Following 2,521 Users Say Thank You to chamonix For This Useful Post: [ Click to Expand ]
 
chamonix
Old
(Last edited by chamonix; 3rd May 2013 at 11:16 PM.) Reason: Changed to new site
#3  
chamonix's Avatar
Recognized Contributor - OP
Thanks Meter 9229
Posts: 3,248
Join Date: Nov 2008
Location: Berlin
Default How-to and FAQ

How-to
I have created a GitHub project for the Knowledge Base where the online and in-app help will be maintained as well. You can find the information here:

The online help: http://better.asksven.org/bbs-help/
The how-to: http://better.asksven.org/bbs-how-to/

A good how-to by Chris Hoffman published by How-to geek

Online Hilfe auf Deutsch: http://asksven.github.com/BetterBatt...e/help_de.html
How-To auf Deutsch: http://asksven.github.com/BetterBatt.../howto_de.html

The repo: https://github.com/asksven/BetterBat...Knowledge-Base
The Knowledge Base Project: http://asksven.github.com/BetterBatt...nowledge-Base/

FAQ
Q:I have high wlan_rx kernel wakelock. What is it and how to proceed?
A: This kernel wakelock is caused by Wifi waking up your device. To avoid it you should turn your Wifi off if not using it, use a tool to control your Wifi state or try to find and remove the cause. More here

Q: Google Maps is causing a lot of overhead. Must I freeze it?
A: no, Karpfenhai wrote step-by-step instructions on how to configure autostarts and the location service to avoid that

Q: Are you aware of the bug in BBS causing SuperUser to ask for su-permissions over and over again
A: As you said, SuperUser is asking over and over again, it's no BBS bug as BBS only requests su rights. More here

Q: BBS shows "no ref since unplugged"
A: Starting from 1.9 is is mandatory to plug/unplug after boot to get a "since unplugged" reference to be created. Starting from 1.10 there is anew reference "since boot" and a preference to fall back to that reference if no other is available.

Q: Why can't you just skip deleting the references at boot?
A: If I could I would. In a nutshell: BBS is a passive monitoring tool; this means it does not cause any overhead collecting data but compares snapshots. Now the disadvantage of this is that it makes no sense to compare values of counters between two references (e.g. "since unplugged" and "current") if the counters were reset in between. In fact that would potentially cause negative values, in every case wrong values.

Q: But is used to work before. Why did you change it?
A: It didn't work, you just didn't notice. The kernel and Android reset their counters at boot. That means that there is no way to compare counters from before the boot with counters from after.


Q: What do the widget colors / graphics mean?
A: For the large widget it's pretty simple. The colors represent the values "Since" (blue), "Deep sleep" (green), "Awake" (yellow), "Screen on" (white), "Kernel wakelocks" (magenta), "Partial wakelocks" (cyan). The 100% is the max of those values.
For the small widget see here

Q: Where are the dumpfile and logcat saved / how are the files named?
A: Both files are saved to /sdcard, their names are BetterBatteryStats-<timestamp>.txt and logcat-<timestamp>.txt where timestamp is of the format "yyyy-MM-dd_HHmmssSSS" (starting from 1.12 there is an option in advanced prefs to save those files to the private directory /sdcard/Android/com.asksven.betterbatterystats/files).

Q: Are you aware of the fact that BBS does not work properly for secondary users (Android 4.2)?
A: BBS works fine for secondary users as long as you don't enable root features. The reason is not BBS but the lack of support of the multiuser feature in the superuser/supersu version you are using.

Q: What is *overflow*?
*overflow* is a sign that one stat counter was overrun. This may happen if you have not boote your phone since long or if some wakeup/wakelock is very frequent. The only way to see what is hidden behind *overflow* is to reboot and take a fresh reading.

Q: Why is 'screen off' reference not being created?
A: You have to enable the watchdog for that reference to be created

Q: What is the watchdog and how does it work?
A: The wachdog is a feature to help you in analysing when happens when screen is off. When the watchdog is turned on a reference 'screen off' is created. You can also configure the watchdog to create a reference 'screen on'. Opionally the watchdog will notify you when screen is turned on and the awake ratio was bigger that the configured threshold. In order to avoid too much overhead in processing a threshold can be set to disable the computing for short screen off times.

Q: my logcat is empty and says "Unable to open log device '/dev/log/main': No such file or directory"
A: Check if you have a custom kernel that turns off logging. If not some file permissions may be broken: use the repair permissions function from your recovery

Q: How can I get rid of GSF wakelocks
A: GSF (google service framework) can not be avoided and in no case it should be frozen. Here are some settings that can help reducing the overhead.
The Following 346 Users Say Thank You to chamonix For This Useful Post: [ Click to Expand ]
 
chamonix
Old
(Last edited by chamonix; 27th August 2011 at 01:23 PM.) Reason: Merged with References
#4  
chamonix's Avatar
Recognized Contributor - OP
Thanks Meter 9229
Posts: 3,248
Join Date: Nov 2008
Location: Berlin
Default Ref, Hints and blacklist

Litterature
Article from the Android PDK about Power Management: http://www.netmite.com/android/mydro...PowerWakeLocks

Other useful tools
The default battery usage (Gingerbread): Settings -> About Phone -> Battery Usage
The most interesting data is shown when clicking on the graph (bars below the graph). Unjustified "awake" times when display is off is an indicator for rogue apps doing stuff in the background when you think your phone is asleep
Battery Monitor Widget
Has a great stat on battery drain over time. I use this tool regularly after leaving my phone alone for 1/2 hour to check how the battery drain looks like against my benchmark of 2-10 mAh average (optimal for my SGS2).

[android backup service]
(http://code.google.com/android/backup/index.html). It is a service that offers cloud backup/restore of your settings and offers an API for other apps to do the same (http://developer.android.com/guide/t...ta/backup.html).
You can turn it off (but will lose the automatic backup) under Setting -> Privacy ->Back up my data.
Backups are useful though but no need to do it in the cloud, I'd recommend scheduling a regular backup using titanium instead (that's my setting).

[DataTracker-FD] is fast dormancy. Find the 'secret' codes for your device to turn FD off. *#*#9900#*#* on an SGSII. (contrib. by nobnut)

[syncmanagerhandlesyncalarm] That service is documented here (http://www.kiwidoc.com/java/l/x/andr.../c/SyncManager) and is responsible for updating the accounts you have under Settings -> Accounts and Sync. High values may come from bad settings (sync too often, huge amounts of data) or poorly written providers.


[reserved for misbehaving apps]
The Following 206 Users Say Thank You to chamonix For This Useful Post: [ Click to Expand ]
 
thebeardedchild
Old
#5  
thebeardedchild's Avatar
Senior Member
Thanks Meter 41
Posts: 746
Join Date: Apr 2011
Been looking for something like this since I installed a GB ROM!
So, basically I install this app, and then Spare Parts should work as it normally did? (or dial *#*#4636#*#*, or whatever that is)
The Following 3 Users Say Thank You to thebeardedchild For This Useful Post: [ Click to Expand ]
 
chamonix
Old
#6  
chamonix's Avatar
Recognized Contributor - OP
Thanks Meter 9229
Posts: 3,248
Join Date: Nov 2008
Location: Berlin
Quote:
Originally Posted by thebeardedchild View Post
Been looking for something like this since I installed a GB ROM!
So, basically I install this app, and then Spare Parts should work as it normally did? (or dial *#*#4636#*#*, or whatever that is)
No Spare Parts won't be of any help as BetterBatteryStats does not replace com.android.settings.battery_history.BatteryHistor y (called by Spare Parts). Installing the app you will get a new icon and will get the stats when starting it
The Following 22 Users Say Thank You to chamonix For This Useful Post: [ Click to Expand ]
 
nobnut
Old
#7  
nobnut's Avatar
Senior Member
Thanks Meter 2241
Posts: 5,990
Join Date: Feb 2010
Excellent work! Just what Gingerbread needs. The very best of luck with the app!

Thank you.

Sent from my Motorola StarTac using Voodoo
Never, ever conform
IOHWIRI
The Following User Says Thank You to nobnut For This Useful Post: [ Click to Expand ]
 
thebeardedchild
Old
#8  
thebeardedchild's Avatar
Senior Member
Thanks Meter 41
Posts: 746
Join Date: Apr 2011
Quote:
Originally Posted by chamonix View Post
No Spare Parts won't be of any help as BetterBatteryStats does not replace com.android.settings.battery_history.BatteryHistor y (called by Spare Parts). Installing the app you will get a new icon and will get the stats when starting it
Ah, I see, so I use this app instead of Spare Parts. Well awesome, thanks for the clarification, and the useful app!
 
lexluthor
Old
#9  
Senior Member
Thanks Meter 83
Posts: 1,025
Join Date: Feb 2007
This is great. What about mimicking the part in spare parts that showed percentage running time? That's valuable info too. I've seen many times where running time was pegged at 100 yet there wewettewere no partial wake locks.
The Following User Says Thank You to lexluthor For This Useful Post: [ Click to Expand ]
 
chamonix
Old
(Last edited by chamonix; 22nd July 2011 at 12:31 PM.) Reason: typo
#10  
chamonix's Avatar
Recognized Contributor - OP
Thanks Meter 9229
Posts: 3,248
Join Date: Nov 2008
Location: Berlin
Quote:
Originally Posted by lexluthor View Post
This is great. What about mimicking the part in spare parts that showed percentage running time? That's valuable info too. I've seen many times where running time was pegged at 100 yet there wewettewere no partial wake locks.
I'd be happy to look into that. Can you give me the exact name of the option/dialog you are missing to make sure we talk about the same thing?

The Following 17 Users Say Thank You to chamonix For This Useful Post: [ Click to Expand ]
 
Post Reply+
Tags
alarms, battery drain, battery monitor, battery stats, wakelock, wakeup
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...