As you know we can use RecyclerView in Android to populate long lists. Using RecyclerView we cannot only populate vertical lists. But we can also populate Grid & horizontal lists. In this article, we will discuss how you can show vertical list in Kotlin using RecyclerView. By following the code explained in the article, you […]
How to Get App Version Name in Kotlin Android
Sometimes we have to get the current App version in Android to send it to our server or to show App update popup. You can use the following method to get the App Version Name in Kotlin Android. fun GetAppVersion(context: Context): String { var version = “” try { val pInfo = context.packageManager.getPackageInfo(context.packageName, 0) version […]
AlertDialog with Custom XML Layout in Kotlin Android
We use AlertDialog class to show popups in Android. But sometimes default AlertDialog’s layout is not enough to fulfill our requirement. So that we have to create Alert Dialog with custom layout. This article explains how to create AlertDialog with Custom XML Layout in Kotlin Android. Basic Kotlin Code to populate Custom XML Layout in […]
Inflate Layout at Runtime in Kotlin Android
In this article, you will learn how to inflate one layout in another at Runtime using Kotlin in Android. To populate very few items, we can embed or inflate them on runtime. But for a long list, its always better to use RecyclerView. Following is the basic code to inflate one layout in another in […]
Rounded Rectangle with/without Background & Gradient XML in Android
While designing Android layouts we have to make custom XML based designs. In this article, I am going to share 3 types of XML layouts which will help you to drawable rounded rectangles in your Android Apps, and you can use them as a drawable anywhere in your project. Following are the XML code to […]
How to Embed one XML Layout in Another in Android
It’s a common requirement when we have to make one layout and need to use it on multiple screens. Using include tag we can embed one XML layout in another in Android. In the following example its shown how you can include one layout in another. Include XML Layout <include android:layout_width=”match_parent” android:layout_height=”wrap_content” layout=”@layout/layout_to_include” /> Example […]
Pass Object from One Activity to Another using Serializable in Android – Java
Serializable is a Java Interface through which we can convert a class object into a byte stream. We can pass object from one activity to another using Serializable in Android. Although it is considered a slow method to pass data between activities as compare to Parcelable but it’s easiest to implement. In the following example, […]
Basic RecyclerView Custom Adapter in Java Android
RecyclerView is a UI component in Android to show lists & grid of items. we usually write the RecyclerView Custom Adapter to populate data to each item of the list. In the following code, I have shared a basic RecyclerView custom adapter in Java. You can just copy-paste this code in your project and modify it […]
Basic RecyclerView Custom Adapter in Kotlin Android
We use RecyclerView in Android to show a list or grid of items. For that, we have to write the RecyclerView Custom Adapter to populate data to each item of the list. In the following code, I have shared a very simple & basic RecyclerView custom adapter in Kotlin. You can just copy-paste this code […]
Lint found fatal errors while assembling a release target Android
I recently found that people are struggling while generating a release APK from Android studio with the error, “Lint found fatal errors while assembling a release target”. Although their App is running successfully in Debug mode. This error happens when we have some issues in some XML files or some other issue not allowing the […]