When we tried to edit the existing layout XML in android by adding Material theme for EditText, but got the below error, Solution : In our resource xml file, following line was missing, So, we changed /home/myuser/android_app/app/src/main/res/layout/fragment_name.xml to make it like, So, in your code it can be any Layout.
In this post, we will show you how to use Calendar from Material components for selecting Birthdate of user during registration process in UI. In Above code below code create the Material Date picker builder. Below code sets the Input Mode of Calender, we are using INPUT_MODE_CALENDAR to show the complete calendar. Set the title … Read more
Following code we used to create two buttons we use to select the Gender of user during registration, As you can see in LinearLayout we have set, android:weightSum=”2″ and then in each of the button we set android:layout_weight=”1″ to make those of equal size, and also another important is android:layout_width=”0dip” For using Material view for … Read more
We wanted to show icons along with titles in our applications, this is possible in one way to add Imageview along with textview and combine both in a LinearLayout while we write layouts.xml. But all of this has been very simplified by adding just a drawable within textview and mention whether we want the icon … Read more
One of our android app shows lot of user information in text views one after another, to make sure this information looks good, we added a top card layout and inside that the information in text views with bottom border, so it looks good. This post shows how you can add a border to textview, … Read more
In our previous post, “Show alert dialog with options on click on Button in Android” we have shown how you can write alert dialog with options on click of a button and the alert dialogs were shown using default AppCompat theme. In this post we will show how to write alert dialogs using material theme. … Read more
Recently we migrated one of our old application to Androidx and then we came across this Material components which we can use for our app. This posts details only changes required to migrate your app from AppCompat theme to Material Design theme. Other details of Material components can be seen on its website. Modify app/build.gradle … Read more
Following code shows you how you can show an alert dialog with options such as Cancel, Subscribe and No .. All this options can be customised to take action as you want. This alert has been shown on click on the contact button.
Prerequisite : “Identify and add SHA1 / SHA-256 Certificates to Firebase console for Phone Authentication” When we were trying for Firebased based SMS OTP Authentication for our android app, we followed all the steps but got the exception as below, Solution : This can be solved by modifying app/build.gradle to add a line as,
For phone authentication, we need to add release SHA1 or SHA-256 key to your firebase console, to identify your app package is connected with your firebase console. When we didn’t had done this, we got the following “SMS verification code request failed” error, When you are using release key, then this SHA1 , SHA-256 key … Read more