Image header

Today, I will share with you my experience of building countdown ⏰ timer Week2 challenge of JetpackCompose.

Thanks to Qatar Airways 🛩 for providing Super Wifi during my flight from Montreal to Doha, 🙌 which helps me to complete this challenge on time.


Image header

Today, I will share with you my experience of building Puppy 🐶 adoption app AndroidDevChallenge week1.

Requirements of challenge

All the UI of the app must be written using Jetpack compose.

Major components that I have used to build the UI are following

NavHost, composable, Column, Image, Text, LazyColumn, Row, and Spacer

I created the data class called Pet which holds the data for each puppy item

  • Their is no interaction with internet so, I have added the mock data to create the static pet list for our app
data class Pet(
val id: Int = 0,
val name: String,
val breed: String…

Distributing apps for testing is the only thing I found hard so far with this.


Story Header

In this article, We will learn about the SMS verification using SMS verification API.

  • API provides us 2 ways of handling OneTimePassword verification in android applications.

Article Header

The App Startup library provides a straightforward, performant way to initialize components at application startup.

It can be used by library developers as well as app developers to streamline startup sequences and explicitly set the order of initialization.

Instead of defining separate content providers for each component that you want to initialize, App Startup allows you to define component initializers that share a single content provider. This can significantly improve app startup time.

If you have a bit of experience of using Firebase/WorkManager in your android apps. …


KTX-HEADER

Today, We will learn how we can use Android-KTX library to write more concise code in Android codebase.

Android KTX is a set of Kotlin extensions that are included with Android Jetpack and other Android libraries.

KTX extensions provide concise, idiomatic Kotlin to Jetpack, Android platform, and other APIs.

These extensions leverage several Kotlin language features, including the following:

  • Extension functions
  • Extension properties
  • Lambdas
  • Named parameters
  • Parameter default values
  • Coroutines
  • Android KTX is organized into modules, where each module contains one or more packages.
  • Check 👉 the list of all the KTX Modules

Let’s see it in action

  • To start using Android KTX, add the following dependency to your project’s build.gradle file:

Story header

Today we will learn about the new feature provided by ActivityManager in API 30. Which helps us to get an information related to application crashes.

Method that provides the information about the crashes

It has 3 parameters :

  • packageName: Optional, a null value means match all packages belonging to the caller’s UID. We provides application package name here.
  • pid: A process ID that used to belong to this package but died later; a value of 0 means to ignore this parameter and return all matching records. It can be ≥0.
  • maxNum: It represents maximum number of results to be returned; a value of 0 means…

Today we will learn about ActivityResult API, which makes the life of Android developers a lot easier to manage the permissions, and inter-activity communication.

  • Currently if we need some data from child activity or another activity started by host activity we use startActivityForResult and onActivityResult
// start activity 
startActivityForResult(intent,requestCode)
// get the result
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
}
  • Second use case is permissions, if you ever implemented the asking permissions ex. access media files, etc. You got it.
// request for permisison
requestPermissions(arrayOf(android.Manifest.permission.READ_CALENDAR))
// manage the result
override fun onRequestPermissionsResult(…

In this article we will learn how we can encrypt our SharedPreferences in Android using Jetpack’s Security library

Definition : An implementation of SharedPreferences that encrypts keys and values.

  • First you need to add the following dependency in your build.gradle file of app module.

Check the latest version here for this library


The Android Kotlin Extensions Gradle plugin almost 3 years ago brought two new conveniences to Android development in Kotlin:

Here we are not talking about KTX, it’s all about Android Kotlin Extensions Gradle plugin

Synthetics let you replace calls to

findViewById with kotlinx.android.synthetic bindings.
  • Parcelize allows you to remove boilerplate and easily create Parcelables through the @Parcelize annotation.

Major drawbacks of Kotlin synthetics

  • They pollute the global namespace
  • They don’t expose nullability information
  • They only work in Kotlin code

Replacement for Kotlin synthetics

Recommended approach that you should follow is ViewBinding

Let’s see step by step how we can migrate to viewBinding

// 1. step enable viewBinding
buildFeatures {
viewBinding true
}

Now rebuild your project and you are…

Nav Singh

Mobile Software Engineer at Manulife. GDG Organizer at GDG Montreal.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store