In Android 12, we are making changes to enhance app and platform security to provide our users with a safer experience. After this article, check out our other blog posts that cover security and privacy.

Touch input is the primary means of interaction with an app in Android. Android 12 includes additional measures to ensure that touch events are properly passed to the intended apps to ensure an intuitive and safe UX. Specifically, Android 12 prevents touch events from being delivered to apps if these touches pass through a window from a different app. This behavior change applies to all…


In Android, we are making changes to enhance user privacy and platform security to provide our users with a safer experience. Apps targeting Android 11 (API level 30) or higher will only see a filtered list of apps that are installed on a device. In order to access apps beyond that filtered list, an app will need to declare the apps they need to interact with directly using a <queries> element in the Android manifest. This blog post will go through best practices of how to adapt to this feature.

Querying and interacting with apps:

There are different ways to query and interact with apps:


2 illustrated phones. One without header and one with header.
2 illustrated phones. One without header and one with header.

This is the fourth in a series of articles which cover the fundamentals of using RecyclerView. If you already have a solid understanding of how to create a RecyclerView, then carry on. Otherwise, consider starting with this post.

You can add information and context about your app’s data by including a Header in your RecyclerView. Although you can emulate a header by placing a TextView above your RecyclerView in a LinearLayout, this fake header stays on screen even when a user scrolls toward the bottom of the RecyclerView. …


2 illustrated phones. One without header and one with header.
2 illustrated phones. One without header and one with header.

For my next trick, I will write about onClick()

This is the third in a series of articles which cover the fundamentals of creating and using RecyclerView. If you already have a solid understanding of how to create a RecyclerView, then carry on. Otherwise, consider starting with this post.

When displaying a list of data with RecyclerView, you may want to have a response when an item is clicked. This response could open a new page with more data, present a toast, remove an item, etc. The possibilities are endless but they are all done using onClick().

Defining the click action

Before creating the listener, create a function in the Activity class that…


2 illustrated phones. One without header and one with header.
2 illustrated phones. One without header and one with header.

This is the second in a series of articles which cover the fundamentals of creating and using RecyclerView. If you already have a solid understanding of how to create a RecyclerView, then carry on. Otherwise, consider starting with this post.

RecyclerView is a great way to display a list of data items efficiently. For displaying a list of static data, the default adapter works great. However, in most use cases, RecyclerView data is dynamic. Take a todo list app for example: new items are added, and completed items are removed. notifyItemInserted() can insert new tasks at a specified index, but…


Kotlin Vocabulary: extension functions and properties

Have you ever used an API and wanted to add functionality or a property to it?

You could inherit from the class or create a function that takes in an instance of the class to solve this problem. The Java programming language usually solves this problem with a Utils class but this does not show up in autocomplete which makes it harder to find and less intuitive to use. Both of these work as solutions but neither promote easy, readable code.

Thankfully, Kotlin comes to the rescue with extension functions and properties. These let you add functionality to a class…


RecyclerView is a powerful UI widget that allows you to display a list of data in a flexible manner. When I was learning about RecyclerView, I found there were a lot of resources on how to create a complex one but not that many about creating a simple one. While the pieces that make up RecyclerView may seem confusing at first, they are fairly straightforward once you understand them.

This blog post goes through the steps of creating a simple RecyclerView that displays the names of different types of flowers. …


Kotlin Vocabulary

When we work with types that can be added, removed, compared, or concatenated we end up with verbose code that we need to write again and again. In Kotlin, we can write more expressive and concise code for these types with the help of operator overloading.

One thing I love as much as I love Android is singing in a choir, so let’s use an example of a choir of singers to illustrate the benefits of operator overloading. Let’s say that we have a choir of singers and we want to add another singer to our choir. …

Meghan Mehta

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