I hereby claim:
- I am tunjos on github.
- I am tunjos (https://keybase.io/tunjos) on keybase.
- I have a public key ASC5YE68Fb_enhCJO8gjmDbIN_UId1ujxWrvrVWWyqWQCAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
adb is the Android CLI tool with which you can interact with your android device, from your PC
You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.
To get the list of your installed applications:
| // |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
| apply from: "../artifacts.gradle" |
| defaultConfig { | |
| versionCode buildVersionCode() | |
| versionName version | |
| } |
| def publish = project.tasks.create("copyReleaseApkToCustomDir") | |
| publish.description "Copies release apk to custom directory" | |
| android.applicationVariants.all { variant -> | |
| if (variant.buildType.name.equals("release")) { | |
| variant.outputs.each { output -> | |
| if ( output.outputFile != null && output.outputFile.name.endsWith('.apk')) { | |
| def task = project.tasks.create("copyAndRename${variant.name}Apk", Copy) | |
| def outputFile = output.outputFile | |
| println "Creating " + rootProject.name + "-${versionName}.apk" + " from " + project.name + "-${variant.name}.apk" |
| def versionMajor = 3 | |
| def versionMinor = 0 | |
| def versionPatch = 0 | |
| def versionBuild = 0 // bump for dogfood builds, public betas, etc. | |
| android { | |
| defaultConfig { | |
| versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild | |
| versionName "${versionMajor}.${versionMinor}.${versionPatch}" | |
| } |
| private boolean checkForPower() { | |
| // It is very easy to subscribe to changes to the battery state, but you can get the current | |
| // state by simply passing null in as your receiver. Nifty, isn't that? | |
| IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED); | |
| Intent batteryStatus = this.registerReceiver(null, filter); | |
| // There are currently three ways a device can be plugged in. We should check them all. | |
| int chargePlug = batteryStatus.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); | |
| boolean usbCharge = (chargePlug == BatteryManager.BATTERY_PLUGGED_USB); |