‫Welcome back.
‫In this section we're going to build another amazing application called Currency Converter App.
‫In order to understand the views and handle the click events by the user, open Android Studio, select
‫a new project, select Empty Views Activity and specify the name of this application as currency converter
‫app the package name, whatever you want.
‫Save location wherever you want.
‫Make sure you select Kotlin and keep the minimum SDK and build configuration language as Setted by Android
‫Studio.
‫Click finish and wait for Android Studio.
‫When creating a new app, you should follow these steps.
‫You need to add the required dependencies and libraries.
‫You need to add the permissions.
‫You need to design the layout and the functionalities and logic, and finally run and test the application.
‫Since we don't need to import any external libraries, we don't need to add dependencies and libraries.
‫Also, we don't have any permissions in this app.
‫So the first two steps are skipped.
‫We need to start designing the layout for that open activity.
‫Underscore main dot XML file.
‫Select split mode.
‫And here you need to remove this text view.
‫And here we go.
‫We have this Constraintlayout and no views.
‫This is our layout.
‫Later on in the next videos next sections we're going to learn about the layouts.
‫I prepared this image to display it as a background for my constraint layout, so copy it and paste
‫it in the drawable folder.
‫Paste.
‫Make sure all the letters are small and there are no numbers at the beginning of the name.
‫Click okay and there we go.
‫This is our background.
‫In order to set this background to the constraint layout, we need to add the background attribute and
‫select the drawable slash background.
‫And you can see our image is set it to this constrained layout.
‫Now we need to add the views.
‫We need to add a title, an edit text a button and a result text.
‫For that I need to start with the title which is a text view.
‫And here we go.
‫This is our text view.
‫You can see it.
‫I can drag and drop it because there are no constraints added to this layout.
‫Then I need to click on this button called Infer Constraints to add these constraints.
‫Later on we'll talk about these constraints in deep details.
‫I created an ID attribute, the width and height wrapcontent and the layout margin top 25.
‫I am having a space 25.
‫From the top you can see it and the gravity is center to center.
‫The text in the middle of the display and the text currency converter app.
‫This is the text and this is the text attribute text color, size.
‫And these are for the constraint layout.
‫Then I need to add another view which is an edit text.
‫I give it an ID?
‫Edit text and hint.
‫Enter USD.
‫United States dollars and this app will convert from dollars to euros.
‫The hint color would be white, and I'll drag and drop this edit text below to here and I'll add this
‫constraint.
‫Also, I can infer the constraints right and left.
‫Here we go.
‫This is our layout one text view and one edit text.
‫We infer the constraints in order to make sure that this design layout matches our app layout.
‫When it is run, then I need to add a button.
‫I give it an ID, convert button to text, convert to Euro, and again I'll drag and drop it to here,
‫and I'll select the circle and add it up.
‫You can try it right and left.
‫Or you can click this Infer Constraints button.
‫Again guys we're going to learn about this constraint and the constraint layout in the next videos.
‫Then I need to create a text view to display the result.
‫And here we go.
‫This is our text.
‫I'll drag and drop it to here and infer the constraints.
‫And this is good.
‫I give it an ID result text okay.
‫So in this video we created our layout.
‫Our layout contains four views four widgets, the text view title, the edit text that the user will
‫enter USD amount, the Convert to Euro button that allow us to convert the entered USD quantity and
‫number, and convert it into euros and display the result in this result text.
‫By the way, I want to add another and last attribute for this edit text and set the input type as number.
‫To prevent the user from entering letters and symbols.