Created
July 28, 2016 02:40
-
-
Save nosix/20dbef6b7afd2bb5fdc8a6b241b90b2c to your computer and use it in GitHub Desktop.
Using the LeakCanary that is a memory leak detection library for Android and Java.
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
<manifest | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
package="xxx"> | |
<application | |
android:name=".MyApplication" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" | |
android:theme="@style/AppTheme"> | |
... | |
</application> | |
</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
dependencies { | |
compile fileTree(dir: 'libs', include: ['*.jar']) | |
testCompile 'junit:junit:4.12' | |
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | |
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" | |
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2' | |
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2' | |
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2' | |
} |
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
package xxx | |
import android.app.Application | |
import com.squareup.leakcanary.LeakCanary | |
class MyApplication : Application() { | |
override fun onCreate() { | |
super.onCreate() | |
LeakCanary.install(this) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment