Skip to content

YunlongYang/LightAndroid

Repository files navigation

LightAndroid 简体中文说明

Gitter Chat LightAndroid Library is used to help android programmer make a light app.

Now, it contains the features etc.

  1. LeakCanary A memory leak detection library for Android and Java.
  2. Glide Glide is a fast and efficient open source media management and image loading framework for Android that wraps media decoding, memory and disk caching, and resource pooling into a simple and easy to use interface.
  3. logbackThe reliable, generic, fast and flexible logging framework for Java on Android.
  4. LightPermissions LightPermissions is build by our self for android permission. You can use it like LightPermissionActivity.

How To Use?

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
    implementation 'com.github.yunlongyang:lightandroid:version'
}

Step 3. Start LightAndroid in your application.

public class MainApplication extends Application {
    LightAndroidApplicationLike lightAndroidApplicationLike;
    @Override
    public void onCreate() {
        super.onCreate();
        lightAndroidApplicationLike = new LightAndroidApplicationLike.Builder().setLeakCanaryEnable(true/false).build();
               lightAndroidApplicationLike.onCreate(this);
    }
}

Attentions

  • To Use LeakCanary, you should add this code to your dependencies. Because LeakCanary will use different library in debug and release.You can find $LeakCanaryVersion in gradle.properties.
      debugImplementation "com.squareup.leakcanary:leakcanary-android:$LeakCanaryVersion"
      releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$LeakCanaryVersion"

If you have some good third party library to recommend or got problems when using LightAndroid, welcome to submit issues, send emails to me at [email protected], you can also join the chat room to discuss.