Skip to content

Instantly share code, notes, and snippets.

View konmik's full-sized avatar

Konstantin Mikheev konmik

View GitHub Profile
neworld /
Last active September 15, 2020 11:32
How to make faster Android build without sacrificing new api lint check

Original solution sacrifices new api lint check.

Here my solution:

int minSdk = hasProperty('minSdk') ? minSdk.toInteger() : 16

apply plugin: ''

android {
 compileSdkVersion 23
Sloy /
Created February 26, 2015 12:50
MockParcel for testing Parcelables implementations with the new Android's Unit testing support ( Only String and Long read/write implemented here. Add mock methods for other types.
import android.os.Parcel;
import java.util.ArrayList;
import java.util.List;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doAnswer;
Nilzor /
Last active August 29, 2015 14:08
build.gradle snippet for automatically adding version code postfix to APK file name
import javax.xml.xpath.XPathConstants
import javax.xml.xpath.XPathFactory
// Set output filename of APK based on version code from manifest when doing release build
// Note: This script will add a couple of seconds to the build script build time
gradle.projectsEvaluated {
preReleaseBuild.doFirst {
android.applicationVariants.all { variant ->
// Check version number configured in AndroidManifest
if ( != "release") return
davetrux / SQLiteDebugADB
Created March 24, 2014 14:42
Verbose Logging of SQLite statements in Android
adb shell setprop log.tag.SQLiteLog V
adb shell setprop log.tag.SQLiteStatements V
adb shell stop
adb shell start
imminent /
Created November 12, 2012 19:55
Utility to retrieve user profile on Android device
* A collection of authentication and account connection utilities. With strong inspiration from the Google IO session
* app.
* @author Dandré Allison
public class AccountUtils {
* Interface for interacting with the result of {@link AccountUtils#getUserProfile}.