Posts

Showing posts from January, 2021

Pick Contact | Android Studio | Java

Image
 Implement Contact Pick feature in and Android App To allow the user to pick a contact from the phone's contacts list, we can use contact intent. You will get all information of the contact e.g. Name, Phone Number(s), Address, Thumbnail, Email, etc. You can use get the specific information according to your requirement. To pick a contact we need to READ_CONTACTS permission. Check for Kotlin Video Tutorial: Add permission in AndroidMenifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android= "http://schemas.android.com/apk/res/android" package= "com.blogspot.atifsoftwares.pickcontact" > <!--Read contact permission--> <uses-permission android:name= "android.permission.READ_CONTACTS" /> <application android:allowBackup= "true" android:icon= "@mipmap/ic_launcher" android:label= "@string/app_name" android

View Binding | Android Studio | Kotlin

Image
  Implementing View Binding in Android Studio Intro: The View binding is a feature that allows you to more easily write the code that interacts with views. Once View Binding is enabled in a module, it generates a binding class for each XML layout file present in that module. An instance of a binding class contains direct references to all views that have an ID in the corresponding layout. From Android Studio 3.6, you can enable the View Binding that gives you the ability to replace findViewById with generated binding objects to simplify code, remove bugs, and avoid all the boilerplate of findViewById. Check For Java How to enable ViewBinding? The View Binding is enabled on a module by module basis. To enable the View Binding in a module, you need to set the ViewBinding build option to true in the module-level build.gradle file, as shown in example: android { ... buildFeatures { viewBinding true } } ViewBinding vs findViewById: The findViewById is the source of

View Binding | Android Studio | Java

Image
Implementing View Binding in Android Studio Intro: The View binding is a feature that allows you to more easily write the code that interacts with views. Once View Binding is enabled in a module, it generates a binding class for each XML layout file present in that module. An instance of a binding class contains direct references to all views that have an ID in the corresponding layout. From Android Studio 3.6, you can enable the View Binding that gives you the ability to replace findViewById with generated binding objects to simplify code, remove bugs, and avoid all the boilerplate of findViewById. Check For Kotlin How to enable ViewBinding? The View Binding is enabled on a module by module basis. To enable the View Binding in a module, you need to set the ViewBinding build option to true in the module-level build.gradle file, as shown in the example: android { ... buildFeatures { viewBinding true } } ViewBinding vs findViewById: The findViewById is the sourc