How to display Toast  Message in App?

How to display Toast Message in App?

In Class what is a file, and what happens in the file, knowing about the piece of code, designing of App, and generating of APK

In Android Studio the file will be created the name of the file is MainActivity.kt is a class. And the next is Import, and the next is Package, AppcomponentActivity is used in code and it is a header component in Activity that is called the Import Activity.

The AppcomponentActivity is written in Java code like the Inheritance as Parent Component and the main class.

The onCreate method is having override in the AppcomponentActivity if we need depth about that component just click on that and the documentation will be viewed all the details will be available on the Android official website.

onCreate method is the method that calls first. savedinstantstate is the youtube app when will use and suddenly a notification from WhatsApp will pop up we need to see that notification and we come back to the app we used in past will be displayed the same and continue from the last seen that the use of savedinstantstate Every source code is designed with a file to set content view.

Now go to MainActivity.kt and you will get the Layout file and

you can text view you

can do that accordingly by drag and drop or by using the code. the code will give you the exact layout design. And now you can edit the text view into a button and choose in the horizontal direction and add another button by name download and other with Upload.

Here id we can name the button name like Download and Upload, and we need to give margin and padding for the design of the button and add the height and width like 120dp width. Now the buttons will be created. Adding toast to the Download and upload button. At the below code the Toast is Added to the buttons, when you click on the Upload button you will be visible like it is Downloading, or Uploading This is called adding the Toast for Button. you can change the color and design in the app

val buttonUpload= findViewById<Button>(R.id.btnUpload)
val buttonDownload= findViewById<Button>(R.id.btnDownload)

APK

the option will be visible at the Top

Build>Buildbundle/APK>BuildAPK. Click on the following steps then the process will generate the code you have written and designed will be generated and the App will be APK generated.

You can share the app with your friends and family. The file name will be in APK.

This is how you can start building your app buttons and Design.

#WeMakeDevs @WeMakeDevs