How can you use StrictMode in your Android app?

import android.os.StrictMode import android.os.StrictMode.ThreadPolicy import android.os.StrictMode.VmPolicy class LevelUpApplication : Application() { override fun onCreate() { if (BuildConfig.DEBUG) { StrictMode.setThreadPolicy( ThreadPolicy.Builder() .detectDiskReads() .detectDiskWrites() .detectNetwork() .penaltyLog() .build() ) StrictMode.setVmPolicy( VmPolicy.Builder() .detectLeakedSqlLiteObjects() .detectLeakedClosableObjects() .penaltyLog() .penaltyDeath() .build() ) } super.onCreate() https://developer.android.com/reference/android/os/StrictMode

Replace findViewById with View Binding

Perhaps you have code that looks like that: val mImageView = findViewById<ImageView>(R.id.img_view) mImageView.setOnClickListener(View.OnClickListener This has worked properly over the last years but what are the drawbacks? Or what are the promises of the new View Binding concept? View Binding is always null-safe and type-safe It compiles faster Gradle Enable View Binding in gradle: android {…