Android emulator shell list fails: Permission Denied in app directory

Today I learned I should include the app package name after shell in my ADB command, if for example I want to list files under the “subdirectory/media” directory of an app, like so: adb -s emulator-5556 shell run-as com.domain.my.app ls -al /data/user/0/com.domain.my.app/subdirectory/media First try’s command below failed with a Permission Denied error message: adb -s […]

Read More

How to start using view binding //Android Kotlin Dev Diary

First, open your app/build.gradle file Inside the android{} block of app/build.gradle, add the following: buildFeatures { viewBinding = true } Sync project with gradle files. In your activity or fragment, define the following class-wide property:

Replace the FragmentorActivityNameBinding above with the appropriate binding class name. Tip: The binding class name is based on the […]

Read More

Exception: No signature of method android() is applicable for argument types, Build Gradle // Dev Diary

Today I wanted to make a data class a Parcelable so that I could pass it as an argument in Navigation component. Parcelables, though better in performance than Serializables, take more time to implement! To help us out, there’s a “kotlin-parcelize” plugin that can generate the boilerplate code for us. There were issues though. After […]

Read More

Remove room database on app uninstall // Android Dev Diary

The problem: Installing on an Android device that has an old version of an app I’m developing triggers an error: Room Database Migration: java.lang.IllegalStateException: Migration didn’t properly handle Problem persists despite uninstalling the Android app and deleting all app data. The solution: Very simple. I set allowBackup to false in my AndroidManifest.xml file like so: […]

Read More