How to create a signed App Bundle

Motivation When you are building an Android App you finally want to publish it in the Google Play Store. To achieve this you need to build an signed app bundle in Android Studio first Settings Select build variant “release” Go to Build -> Select Build Variant Now a new tool window becomes visible. Select “release”…

What is the AOSP?

AOSP is the Android Open Spurce Project Architecture Source Code is hosted here: https://android.googlesource.com/platform/manifest Google uses repo (basically a git wrapper written in python) to clone the source code. You can find the instructions here:  https://source.android.com/setup/build/downloading Further Reading What is Ninja? What is kapt? Anatomy of a Gradle file

What is ProGuard?

Perhaps you noticed the file proguard-rules.pro in your app directory? Why do we need that? ProGuard ProGuard has three use cases: shrinking obfuscating optimizing Code shrinking Often called “tree shaking”, shrinking optimizes the byte code by removing unused code. Resource shrinking After code shrinking all non-referenced resources will be removed as well Obfuscation This step…

How to use Snackbars

A Snackbar is a replacement for Toasts in Android. Dependency implementation ‘com.google.android.material:material:1.4.0’ Layout A snackbar must be tied to a coordinator layout. If you use fragments the standard layout is FrameLayout which can be directly swapped with: <androidx.coordinatorlayout.widget.CoordinatorLayout Snackbar val snackbar = Snackbar.make( binding.root, “No internet connection! Please enable WiFi or Mobile Data”, Snackbar.LENGTH_INDEFINITE )…

Depdencency Graph with Gradle

Gradle has built-in capabilities to generate a dependency graph of all packages used in the application. Gradle Tools gradle app:dependencies Command line Windows .\gradlew.bat app:dependencies Linux / macOS ./gradlew app:dependencies Further Reading Anatomy of a Gradle file How to add local jar files to your gradle dependencies How to enable R8 in your build process

versionCode vs versionName in Android Apps

versionCode 1versionName “0.1” versionName is a string which is visible to the user in the settings menu under App Info versionCode is an integer. It is used to compare APK updates against each other to make sure apps aren’t downgraded. val packageInfo: PackageInfo = this.packageManager.getPackageInfo(this.packageName, 0)Log.d(packageInfo.versionName)Log.d(packageInfo.versionCode) Further Reading Anatomy of a Gradle file Depdencency Graph…