Giter Site home page Giter Site logo

betterbatterystats's Introduction

Build CircleCI

#License BetterBatteryStats is an open source project unter the terms of the Apache 2.0 License. The license does not apply to the use of the names "BetterBatteryStats" and "Better Battery Stats", nor to the icon / artwork created for BetterBatteryStats.

Build

In order to build (with gradle / Android Studio) following changes to the local project are required

HockeyApp

The environment variable HOCKEYAPP_APP_ID must be set to a valid value

Signing

The signing config uses environment variables:

    signingConfigs {
        release {
            storeFile file(System.getenv("KEYSTORE_RELEASE"))
            storePassword System.getenv("KEYSTORE_PASSWORD")
            keyAlias System.getenv("KEY_ALIAS")
            keyPassword System.getenv("KEY_PASSWORD")
        }
        debug {
            storeFile file(System.getenv("KEYSTORE_DEBUG"))
        }
    }
  • KEYSTORE_RELEASE points to the release .keystore file
  • KEYSTORE_DEBUG points to the debug .keystore file
  • KEY_ALIAS defines the alias name
  • KEY_PASSWORD is the keystore password

Continuous Integration

The continuous integration (in this example CircleCI) needs to have access to some private settings.

Google play publishing

Publishing profile

The encrypted file (sa-google-play.json-cipher) is located in /app, and referenced by the gradle build.

See also https://github.com/Triple-T/gradle-play-publisher.

Deploy task

In circle.yml we define that all the google play publishing (to beta) is triggered on tag release-*

Encrypt

openssl enc -in infile -out infile-cipher -e -aes256 -k $KEY

See also https://github.com/circleci/encrypted-files

Decrypt (on CircleCI, as defined in circle.yml and using an env-variable KEY)

openssl enc -in encrypted-cipher -out encrypted -d -aes256 -k $KEY

The signing keys

The environment variables $KEYSTORE_RELEASE, $KEYSTORE_DEBUG, $KEY_ALIAS, $KEY_PASSWORD and $KEYSTORE_PASSWORDmust be set.

There variables are set in secret-env-plain (not part of the project for obvious reasons).

In order to run your own build create a file secret-env-plain and set the variables:

export KEYSTORE_PASSWORD=<your-keystore-pwd>
export KEY_PASSWORD=<your-key-pwd>
export KEY_ALIAS=<your-key-alias>
export KEYSTORE_DEBUG=<name-of-debug-keystore>
export KEYSTORE_RELEASE=<name-of-release-keystore>

and then encrypt this file using openssl aes-256-cbc -e -in secret-env-plain -out secret-env-cipher -k $KEY

In the piepline the decyption is done using the script circleciscripts/decrypt_env_vars.sh with the $KEY stored in circle-ci's env vars.

As the signing keys are not in the github repo a script circleciscripts/download_keystore.sh does the job of downloading and decrypting the keys at build-time. For that to happen following addition environment variables must be set:

  • $KEYSTORE_URI a public URI from where the files can be downloaded using http
  • $KEY the key to decrypt the keystores (same env var as for google-services.json)

betterbatterystats's People

Contributors

asksven avatar busimus avatar caiorrs avatar code010101 avatar eleoxda avatar gaich avatar lorilori avatar mag01 avatar matthias-vde avatar nmayorga092 avatar ryanphuang avatar vldesco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

betterbatterystats's Issues

[bug] FC on Android 3.x when opening prefs

I'm running prime v2.0.2 on mine and betterbatterystats force closes when i attempt to access the preferences, are you noticing this on yours or is it just this rom?
my fone_fanatic @ xda

[bug] inconsistent behavior when hitting "back"

I've got a few more oddities, if you don't mind:

  1. I understand about not using the "back" button if you want to keep the custom reference. If I've been off doing other things and then return to BBS by long-pressing the home key and selecting BBS from the list, it does indeed remember the custom reference. If, however, I go in to the app drawer and click on the BBS icon, or if I have the icon on the home page and click on that, it gives me the "no custom reference set" warning.

  2. When it gives me the "no custom reference set" warning, the display still seems to be based on some kind of reference point, usually further back in time than "last unplugged" but not as far back as "since charged" (which we know on Froyo is something different anyway).

  3. Sometimes the display does not re-draw fully when you come out of the preferences screen. Usually I get the two option bars but no data underneath. This seems to fix itself if I pop in to the help page and back out.

  4. I've no clear idea exactly what sequence of actions I had followed before this one occurred, but the other day after running BBS for quite a while and having set a few custom references during that time, I hit the back key to come out. Instead of exiting the app, the dispay re-drew with data based on an older custom reference. I hit the back key again and another set of custom reference data was displayed, based on another, yet older custom reference. I ended up having going back through about six screens of data, each based on successively older custom references, before the application finally exited.

Actually, I could almost see that last one as being a feature, if it could be reliably reproduced...

Nothing displayed on screen

Starting the app, the Computing notification pops up, and once that is done, i'm left with the two drop down options. No matter what I do, nothing is shown.

Android 2.3.5
BetterBatteryStats 1.1.1.0

[feature] Widget

nobnut
What I am thinking is maybe a widget that is updated only after a minimum period of sleep and then remains static until after the device wakes up from sleep again (minimum sleep period perhaps 30 minutes). This way it will not cause any wake time as it only updates after the device wakes up

Similar to the BBS main app, the widget could display:

  • Top 3 or 5 apps/services causing wakelock since screen off
  • In ranked order
  • Perhaps the apps could be colour coded if certain thresholds are exceeded (e.g. > 30% of sleep potential prevented is Red... > 20% is Orange... < 20% is Blue)
  • The user can perhaps specify the thresholds and colours via the in app menu

Click on the widget and... whatever you want (open BBS/open battery statistics/open Manage Applications etc).

This might be easier for users than going in to the main BBS app to see the 'worst offending apps' and would present an ongoing glimpse into what causes wake on their devices.

I know I would certainly love this feature and would be more than happy to pay for it via the Market, which I fully intend to do even if there is a free version on XDA

[feature] Rework Titles of StatType

[thebeardedchild] the stat types "last" and "current" are not self explaining and should be renamed. Interesting would be a stat since powered up

[feature] change wording for wakelock pct in perfs

Suddenly the penny drops - I think. I believe I am correct in interpreting the three options as showing the time that the offending process has had a wakelock in place, expressed as a percentage of:

  1. the time in the displayed measurement period that the phone has not been plugged in
  2. the time in the displayed measurement period that the phone has been awake
  3. the time in the displayed measurement period that the phone has been awake less the time that the screen was on
    I hadn't twigged that the "-" in "% of time awake - time with screen on" meant "minus". Could the whole dialogue be re-worded to make it clearer? For example, the heading could be "Wakelock expressed as % of time..." and the three options could be "on battery", "awake", "awake, minus screen-on time".

Or maybe I'm just too thick for it to be worthwhile pandering to my stupidity since no-one else has had any problem understanding what it meant.

[bug] Network Usage reporting

I think the app is great and displays the data that I believe is relevant in an intuitive way. The only issue I believe I have found presently is that under 'network usage', having used applications requiring network connection (XDA app and Dolphin browser for example), they do not display in the lst. There are entries displayed but these relate to system applications. In my case these include:

Google Services
Android System
A weather livewallpaper

It might be that 'Android System' is a container for the other processes using the network?

[feature] Check if NameResolver can be improved

[f_padia] display the actual process/package name rather than the long name given? E.g. I see the highest wake lock on my phone is something called 'SyncManagerHandleSyncAlarm' but I have no idea what this is.

[feature] aggregate wakelocks by application

currently wakelocks are listed by service and application name/tag e.g.
network-location
com.asksven.betterlatitude.BetterLatitude

This fine granular representation is interesting when looking for the root cause. On the other hand it may be interesting to see the total wakelock caused by an application in total.

[feature] add knowledge base

For known services/apps there should be the possibility to add an explanation on how that wakelock can be conditioned. The storage of this knowledge should be kept outside of the app (xml) for it to be updatable witout release (on user request).

[feature] add links to Settings

nobnut
The option to click on an entry to take you to the application's settings details.
The same as Settings > Applications > Manage Applications...
That would be a tough one but a great feature!
And/or a shortcut to the app itself to allow the user to edit the settings from within the app.

[feature] Wording of wakelock pct settings

Suddenly the penny drops - I think. I believe I am correct in interpreting the three options as showing the time that the offending process has had a wakelock in place, expressed as a percentage of:

  1. the time in the displayed measurement period that the phone has not been plugged in
  2. the time in the displayed measurement period that the phone has been awake
  3. the time in the displayed measurement period that the phone has been awake less the time that the screen was on
    I hadn't twigged that the "-" in "% of time awake - time with screen on" meant "minus". Could the whole dialogue be re-worded to make it clearer? For example, the heading could be "Wakelock expressed as % of time..." and the three options could be "on battery", "awake", "awake, minus screen-on time".

Or maybe I'm just too thick for it to be worthwhile pandering to my stupidity since no-one else has had any problem understanding what it meant.

[bug] since charged returns too high values on froyo

So it's been 42 days since my phone was charged? I don't think so! The Froyo Spare Parts Battery History (which incidentally is also available from within Battery Monitor Widget) offers "Since last unplugged" and "Total since boot". The "Since last unplugged" time matches the "Since unplugged" time in BetterBatteryStats, so that looks fine. "Total since boot" is a bit over one day, which is correct.

Nothing seems to match up with BetterBatteryStats' "Since charged" time, though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.