Skip to content

Instantly share code, notes, and snippets.

@inventor02
Last active December 6, 2017 20:01
Show Gist options
  • Select an option

  • Save inventor02/bb5fc6c6832712ab28997556b09a5c85 to your computer and use it in GitHub Desktop.

Select an option

Save inventor02/bb5fc6c6832712ab28997556b09a5c85 to your computer and use it in GitHub Desktop.
Useful snippets for android application development.

Useful Android Libraries

These libraries have been compiled to work with SDK version 25. Includes ButterKnife because let's be honest, it's awesome.

dependencies {
    // Support Libraries
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.android.support:cardview-v7:25.1.0'
    compile 'com.android.support:design:25.1.0'
    compile 'com.android.support:gridlayout-v7:25.1.0'
    compile 'com.android.support:leanback-v17:25.1.0'
    compile 'com.android.support:mediarouter-v7:25.1.0'
    compile 'com.android.support:palette-v7:25.1.0'
    compile 'com.android.support:recyclerview-v7:25.1.0'
    compile 'com.android.support:support-annotations:25.1.0'
    compile 'com.android.support:support-v13:25.1.0'
    compile 'com.android.support:support-v4:25.1.0'

    // ButterKnife
    compile 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}

ProGuard Logging Removal

This code removes all logging methods from your code when building for release with ProGuard. You must have minifyEnabled set to true in your build.gradle for this to work.

# Removes all logging methods
-assumenosideeffects class android.util.Log {
    public static boolean isLoggable(java.lang.String, int);
    public static int v(...);
    public static int i(...);
    public static int w(...);
    public static int d(...);
    public static int e(...);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment