This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Start battery historian | |
cd $GOPATH/src/github.com/google/battery-historian | |
go run cmd/battery-historian/battery-historian.go | |
#Setup device for data collection | |
./adb shell dumpsys batterystats --enable full-wake-history | |
./adb shell dumpsys batterystats --reset | |
#Capture bugreport | |
./adb bugreport > ./bugreports/android_device_bugreport.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Updated: 2010/12/05 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it) | |
// | |
// Permission is hereby granted, free of charge, to any person |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a test shell script | |
echo "Hello World" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH=/usr/local/bin:/usr/bin:/bin | |
# cd to the directory of the image so we can work with just filenames | |
dir="$(dirname "$1")" | |
cd "$dir" || exit 1 | |
base="$(basename "$1" .png)" | |
# create a WebP version of the PNG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place this in the 'build.gradle' of the library module | |
// Task : Generate a JAR | |
// Usage : In the terminal, run './gradlew jar' | |
// Output : Get the jar at 'build/libs' | |
task jar(type: Jar, dependsOn: 'assembleRelease') { | |
from fileTree(dir: 'build/intermediates/classes/release') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 21 | |
buildToolsVersion "21.1.2" | |
defaultConfig{ | |
minSdkVersion 14 | |
targetSdkVersion 21 | |
versionCode 101 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [Android] ======================== | |
# Built application files | |
*.apk | |
*.ap_ | |
# Files for the Dalvik VM | |
*.dex | |
# Java class files | |
*.class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Add this as a debug manifest so the permissions won't be required by your production app --> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | |
<uses-permission android:name="android.permission.WAKE_LOCK" /> | |
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> | |
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android { | |
compileSdkVersion 23 | |
buildToolsVersion "23.0.2" | |
defaultConfig { | |
applicationId "com.company.packagename" | |
minSdkVersion 7 | |
targetSdkVersion 23 | |
versionCode 1 | |
versionName "1.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// USAGE | |
// Data set | |
final ArrayList<ViewModel> viewModelArrayList = new ArrayList<>(); | |
for (int i = 0; i < 100; i++) { | |
viewModelArrayList.add(new Order(i, "VM Name " + i)); | |
} | |
// Recyclerview | |
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv); |