Android App Development Tutorial For Beginners 2021 [ Master Android Today ]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's go and install the another studio in our Windows operating system so go to your browser and type under the studio download and then go to developers hundred comm slash studio and click on the download under the studio button select the equipment and hit download and you download should proceed so let me pause this video until the download is finished and here's our under the studio so let me double click on that and then hit run now hit next next and then finally hit install you now hit next and finally start the under the studio and then you will see a message like no Android SDK found so just click Next and it is going to download these components so let me hit finish and this may take some time so I'm going to pause this video all right now let's go to SDK manager and let's go drastic Atul's make sure you have downloaded all these files and finally this Intel emulator accelerator man hit ok and then wanted to download this Intel emulate accelerator so hit OK and I'm going to leave this as default but if you have bigger RAM then you can increase this value so let me hit next and then hit finish now I want you to go to the AVD manager and let's create a bottle device so we're going to select the pixel to and hit next and here we need to download one system image so let's download this android cue and once your download is complete hit finish now select this Android queue in here and hit next and this is going to be our device name and I didn't want this animal device play and hit finish and Harry's our varsity buys as well so let me close that now we are fully ready to create out Android a studio project and I will see you in the next part hello my wonderful people out there in this episode were going to install the Android studio in our Mac operating system so just type Android studio download and go to the developer.android.com slash studio and click on download under the studio select the check box and hit download under the studio for a Mac and your download should proceed so this is a large file and I'm going to pause this video until the download is finished and once your download is finished come to the download folder and double click on this a dmg file and then just drag this Android Astoria to application and we have installed a Android studio that can close this now let's go to application and use if she understood in here double click on that and hit open and select down import setting and hit OK so if you see something like this select all of them and hit delete directories and then you will see under the studio setup wizard so like me hitting xed select the standard installation and hit next and let me go for a white theme if you want you can go for black theme as well and let me hit in next and then our Android studio is going to download the software development kit okay so said finish since the download size of Android STK tool is where he loves I'm going to pause this video and finally we have installed the Android SDK components now let me hit finish I want you to go to the configure and then every manager and then unity download the emulator so click on install emulator and select the license agreement and hit next and I'm going to pause this video until the download is finished and here we go install the Android emulator as well so let me hit finish and finally when to download the Android software or hundred emails for our personal device so just click on this download option and click OK now it is going to download the Android system image for our Android emulator it sizes 1.1 GB so let me pause this video until the download is finished and we have finally installed the Android system image as well so that made finished and our virtual device is also ready so let me close this and I will see you guys in the next episode hello there welcome back from the section working to learn Android application development first of all select this option called start a new vendor studio project and you can see we have lots of design templates for developing application for phone and tablet now if we go to aware ways we can see we have a design for development application 400 watts and similarly for TV and Android auto as well so for now let's go to phone and tablet and let's select the empty activity and let sit next and we need to give our application name so let's keep our application name as learning Android and here we need to give our package name to our application and Perkis name is a unique identifier for our application and there are some general convention of writing they package them so for example let's say our website is abc.com then we're going to write our package name like this come dot ABC and then we're going to write our application name so that is learning Android and if you don't have domain name then you don't need to worry about that you can place anything for example you can write and Google or Facebook and as of now we're going to say a counter example and dot learning Android and this is our work indirectly you can change this directly if you want okay so for now I'm just going to leave it as default and here we're going to select lead Java and here we can select a peer level as 15 now if you click on this you can see we have a API level up to 29 as of now now our hell is a little option if you click on this help me choose this you can see we have a nice start in here so if you click the API level as let's say 16 then our application is going to run in 99.6% any device worldwide so for now they have not specified the percentage market share of this API level 15 but you can add some that if you select the API level 15 and then you can be sure that our application is going to run in the more than 99% of Android device worldwide and depending upon the application complexity and requirement we can select this API level so for now let me hit OK and for now our application is not going to support the instant apps and instant application of those application which we don't need to install them in our Android device we can directly run those application without installing so for now we are not going to select this option and let it finish so if you re starting this under the studio for the first time and then it is going to take some time so let me close this so here can see we have two files called mainactivity.java and activity underscore XML so let's go to activity underscore min and here can see we have got text view which says hello world so let me zoom this a bit and here is our hello world and don't worry about anything about this attributes I'm going to guide you step by step as we go on so for now if we go to folder called manifest file you can see we have a file called Android manifest dot XML file so let me open this and you can see we have an activity called main activity and you can see we have an intent filter and we have mentioned the X and s min and category as luncher and again don't worry about anything about this attributes I'm going to tell you as we go on so for now it is showing some error and it says app is not indexable by Google search we need to add X and view intent filter so let me copy this and I'm going to paste that in here and instead of min I'm going to say a view and you can see our error is gone so basically in this Android manifest file we are going to declare all of our permissions our activities services and broadcast so you can think this Android manifest file as the dictionary where we can track every single component of our application in this single file so for example let's say our application it's internet permission then we are going to declare that permission in here so we can say uses permission and we can say 100 dot permission dot Internet similarly let's say we want to read the phone number then we can the say uses permission and we're going to say a read contact so this is the major functionality of androidmanifest.xml file so for now I am going to remove this uses permission now let's run our application so here you can see we have our own icon so let me click on that and heads our biggest in call learning Android and it says Halliwell so for those who are having problem 2 upon the Android emulator so just go to this often called AVD manager so in your case there is no vassal device so I will show you how to create the virtual device one more time so let's go to a create a virtual device and here you can deselect phone and let's select pixel 2 and that's it next and here wouldn't you download the Android system is so if you have not downloaded with that go and download that and hit next and you can rename the device if you want and you can enable or disable device frame if you want and finally hit finish so once you hit finish then you will going to see versatile device in here and just click on this green option to launch your EVD so let me close this and you once a minute is running you can click on this green button and you can see it is going to install the application and in here is the application one more time and this is all we're going to cover in this video and I will seem in the next part hello my dear wonderful people in this episode I will show you how to run your high-level program in your real device so for that let's go to our settings and inside our tools you can see we have our Sun collar connection assistant so let's click on that and it is going to open this tab so we need to connect our and device via a USB to our laptop our computer and then let's risk and device and and the studio has rejected my device which is of Samsung so once your Android studio has detected your device you are good to go so let's it next and it says we need to enable USB debugging suffer that we need to go to setting and we need to type couple of times to our dual number option so let me show you how you can do that and has my real device and in my settings I'm going to tap the blue number so let me click on this option and then I'm going to click a couple of times to this bill number and he says no need developer mode has already been animal that's because hybrid animal developer mode in my device so if I go to back and in my setting you can see there is awesome called developer option so let me click on that and then you need to enable this option to disable this and once you enable this option in your Android studio you should see your device so the select a device and hit run and then it is going to install our Halliwell program in our real device and inhales our hello world program in my real device and if we have any problem running your application in your real device and then do let me know and I will be there to help you save in the next part hello guys in this episode I will show you some of the Android studio settings that you can use to improve your coding experience in Android studio so if you're in Mac go to preference and if you are in Windows go to file and then sitting so first of all let's go to appearance and behavior and select the appearance and here we can choose the direct him and liked him so if we select the Dracula and if we hit OK and here's our Black team now let me go to setting' one more time and I'm going to switch back to let him now if you go to editor and inside the general and click on auto import and make sure you have selected this to checkbox and once you select this to checkbox it is going to automatically import all of our package and class for us so that we don't need to do that manually so I highly recommend you to choose this to upsell now let's go to appearance one more time and here we can assign this background image as well so let me click on this and I can select a background image so let me select that and I'm going to choose my name is and let's say open and let's go okay and okay one more time and here is an image in the background now can type your code in here and I have one more tips for those people who have bigger RAM so let me go to setting one more time and inside our appearance and behavior inside system setting and here we have the memory setting and here we can increase the heap size similarly for here as well you can guess the heap size if you want and this is going to make her under the studio a little bit faster and if we're running the Android studio in low Ram then you can skip this option and our under studio will going to optimize the heap size for us and I will see you guys in the next part hello guys in this episode I will explain you the basic fundaments of constantly out so if we go to activity on us come in inside our text app you're going to see a constant layout in here so this is our view group and we have one text view inside this view group and if you place your mouse inside this text by XML and then you will notice the four strings or constant coming out from this textview so this is your top constant this is your bottom left and right so what this constant do is that it tries to pull the textview towards itself for example this top constant is going to pull this textview towards the top similarly this left constant is going to pull the textview towards the left this button constraint is going to pull the still to us the button similarly this right constant is going to pull the textview towards the right so let me show you with the demo so if I hold on this top circle it says to delete the top constrain I need to click command + click and if you are running Windows it is going to be ctrl + click so let's do this command + click so have deleted it drop constrained so that's why our bottom constraint is going to pull our text view towards the bottom so let me undo this now I'm going to delete this bottom concern now so command + click to delete that now can see our top concern is now pulling this textview towards the top so if I undo this and if I delete this left constant then our right constraint is going to pull our text view towards the right so let's do this and here you can see that so let me undo this as well so that's the fundamental building block of constantly out and you always need to remember this thing now I will show you how to write XML code for constantly out for a particular view and in our example this four line are responsible for adding the constraint to our text view and I'm going to delete this constraint now now let's learn how to write the constraint to our view so here's our takes P right so I want to add the constant top first of all so I'm going to type C for constraint and then I'm going to type top and here you can see I have four of them now I want to add the constant top to top off parent so that's why I'm going to type top again and this is option that we need so let me click on that and then we're going to say parent so we have added the constant to parent now let me add the constant to this bottom so I'm going to say C that is constant and I'm going to type bottom and you can see I have for option one more time so in our case I'm going to add the constraint bottom to the bottom of parent so for that I'm going to type bottom as well and here is my off son so let me click on that and let's say parent and here is out to constant constant top and constraint bottom now let's add constraint right to the right of parent so it's going to be very simple as well so I hope you might have already guessed this as well so see for constant and I'm going to type right and I have four Upson so I'm going to type right again and here I'm going to say parent and we have added the constant right as well now let's add the constant left to left our parent so C for constant and we're going to say left and we have four of Sun and we're going to say left as well to the left of parent I hope you are understanding this concept so far and if you are having any problem understanding this concept then do let me know in the comment with the time stamp and I will be there to help you out now let's see one of the interesting properties of constantly out so I'm going to delete this three constrain bottom right and left constraint and then it shows some error it says the view is not constant horizontally at run time it will jump to the left unless you add a horizontal constraint so this means we always need to provide at least two constant one for horizontal and one for vertical so that's why we need to provide at least one constant for horizontal it can be the left or right so let's say constraint right to right a parent now can see our error is gone so similarly what happens if I remove this top and this time it says this view is not constant or vertically at run time it will jump to the top unless you are the vertical constraint and that is we need to provide at least one constant for vertical it can be the top or bottom so let's add constraint bottom so to bottom a parent and our error is gone so I hope you got the concept now let me add the constant top and constraint left as well constant left left of parent and here's our hello world text at the default position so this means we have another rule that is we need to provide at least one constant for a vertical and one constant for horizontal and inorder constraint your view horizontally you can either use left or right similarly if you want to constrain your view vertically you can either use a top or bottom alright now let me go to a design tab and I'm going to attract one bottom below this text view so like this so let's ignore that hair for now let me go to text mode and here can see android studio has added two properties absolute x and absolute Y so without modifying anything in this code I'm going to run this application and let's see the output first of all and here is the application and I can see our bottom is at the left part but in our design people you can see our button is below out textview so what's causing the error in here so if we go to activity Oscar mean you can see we have our tools namespace and this tool namespace is the only going to be used in our design tab not in the real time device or in our emulator so whenever you assign the tool namespace it is only going to be used for design it is not going to work for our real device so for example let me copy this tool and instead of Android I'm going to say tools in here so let's run this application and check the output and here can see we didn't have text called bottom but in our design we have the text called bottom so I hope you understood this tool namespace so let me undo this now as we just saw in order to align this button below our textbook and just by dragging and dropping this button is not going to work so for that we need to add the constraint to this bottom select me remove these two properties now let's add some constant so I want to add the constant top to bottom off textview okay so that's our first thing and in order to do that when it add the ID so let's say idea is gonna be since this is our textview I'm going to say txt and let's say hello world so this is the idea of our text view so here we're going to say constant so I'm going to type C and then top and here can see we have for off some one more time and we want to add the constant top-to-bottom of hello wall program so we're going to say bottom in here and then we need to pass the ID and our ID is going to be text hello world and here you can see our bottom is in below our text view now let's search constant right to write a parent and constant left the left of parent so that our text we on bottom lines together so here we're going to say constant right to right after and and constant left to left of parent and here can see both of them are aligned together now let's run a repetition and here you can see our design in our emulator is similar to that of design preview now let's see we want to add another button below this button so for that we can copy this button and paste that in here now let's change the button 3 as let's say button - and let's change this button ideas well let's say button + and here we're going to say plus and here we're going to say - and here instead of adding cars in top to bottom of text hello world we're going to say button + so here we're going to update our ID - button + now let's say we want to align the another button to the left of + so for that let me copy this and let's paste that in here now instead of - let's say button reset and here we can say reset as well and here's a button so let me remove all of this constraint now we want this button to the left of + right so for that we can thus a constraint left to the right of our button + and finally we need to add the constant top to the bottom of hello world text so let's do that in here so constant top to bottom of our hello Baltics and Hell can see this + and reset buttons are now aligned horizontally so this is all I want to cover in this video and in the next episode organ dad the click functionality in this buttons so see you in the next episode hello guys in this episode we're going to add click functionality in our buttons so first of all let's change the hello vortex value to zero and let's say the ID name as well so we're going to say txt counter and I need to modify the ID in here and here as well and here's our counter and its various zero so let me increase the text size first of all so text size let's say 20 SP and let's say text color as black so has 0 0 0 and here is our counter now in our application whenever user clicks on this plus button we're going to increment this counter similarly when user clicks - button we're going to decrement the counter and we're going to reset our counter to 0 whenever user clicks on reset button so let's go to the main activity and here we're going to declare those views so let's say private text view and here willing to give the name so it can be anything so for now I'm just going to say txt counter and here we're going to declare the three buttons let's say button and button + button - and finally our button reset so we observe stability view now we're going to link this view to our XML component so in order to do that let's come in here and we're gonna say txt counter is gospel find view by ID r dot ID dot our ID name which is takes on the score counter similarly for the button plus this can be fine if you by D ordered ID dot button + now let's also do the same thing for a button my and button plus so butter - is cause to find a few by D hearted ID dot button - and for a button reset it's gonna be easy cause to find view by ID hearted ID dot button reset so at this point we have finally linked our XML views to our and Java object now let's click functionality to our button + so in order to do that we're going to say button plus and dot sit on click listener and we're going to type in new and then view dot on click listener so just select this option and under studio we'll going to over add this on click function for us and here we want to increase the counter right let's declare a variable call a counter and it is going to be of type integer here we're going to say X counter dot get text and dot two string so with this to function we're going to get the strings present in our text view and here we have one small error so we'll interchange this a string value to integer so in order to do that click all and enter or place your mouse to the end of this statement and you will see a red pulp Suz of click on that and then select a wrap using integer dot parse int and this function is going to change this string value to the integer now here we're going to say a counter plus plus and here we have implemented a counter now let's update the value in our text counter text view so takes counter dot set text and we need a pass counter variable in here and as we know that this counter is an integer so we need to change this integer to a string so let's concatenate this with empty string now let's run our application and here is our application so let me click on this plus button and here you can see we have updated the value so let me click this plus button couple of times and you can see we have increment the value now let's start click functionality to - so we're going to say button - dot sit on click listener new view dot on clay listener and here we are going to do the same process so let me copy this and paste in here and he said uh + / smoking - save - - now let's run our application and here is our application one more time so let me increment this value and if I click on this - it's a decrement the value and this is how we're going to add the click functionality in our buttons our view so let's add our simple logic whenever this value becomes 0 we didn't want to decrement it anymore so let's go to our main activity and here we're going to check is one condition if counter not equal to zero then only we want to and decrement that right so let me put that into this curly bracket and let me cut this to line and pitch in here and this is going to solve that easier now let's add click functionality now reset button as well so button reset dot set onclick listener and then view dot onclick listener or you can simply type on click listener and our Android studio is malinovka DT correct option for us so let's select this option and here we can say takes counter dots it takes as 0 so this is all we need to know so let's run our application to check the output and here's our application so let me increment this value and we can determine this value as well so once it reads to 0 it is not going to decrement anymore so let me click on this button couple of time and you can see it is not decremented to less than 0 so let me increment this value one more time and if I click on this a reset button and you can see our counter is now 0 again and this is all we are going to cover in this video and in the next part I will show you different methods of handling click listener or click vending Android so see in the next episode hello my dear wonderful people out there in this episode I will show you how can add this same click functionality in your application but with the different approach first of all let me comment this previous approach and in order at the multi-line comment in the studio for Mac users you can't do command option and then forward slash and for Windows users it is going to be control shift and forward slash now let's see how can add the click functionality in our application with different approach suffer that and go to activity underscore main.xml and here we're going to add one attribute call on click and we need to give the function name so let's say plus function and this is going to be our function name and you can see it is throwing some error and if you hover on this it says we need a function called plus function in our main activity so let's go to our main activity and here let's create that function so just come out of this bracket and we're going to say public and void and our function name earned our function image and this one so let me copy that and paste in here and here we'll into pasty view so let's pass that view in here and this is our function and this function is going to be called whenever someone clicks on this plus button similarly let's add on click function in here as well so we're going to say - function and this function name can be anything you want ok so there is no restriction at all and for a reset we're going to say on click let's say a reset function and you know to resolve this - error let's go to our main activity and we need to create that function so let me copy that and I'm going to piss that twice and instead of plus function we need to say - 1 Sun and here we're going to say a reset function now we can simply copy this operation from our previous approach and let's paste that in here and for our - function here's our operation right so let me copy that and paste in here so let me copy that as well and paste in here now let's go and run our application to check the output and here is our application select my click on this plus button and you can see it has incremented value so it has decrement the value and if I click on this and you can see our values now back to 0 and here you can see we are creating the 3 function for performing 3 different action actually we can combine all of this function into one function as well so for that let's go to activity underscore min and here instead of minus function let's say operation and I'm going to copy this function in my prison and paste in here and paste in here as well and as we know we need to create this function call operation right and here let's say public void operation and this is going to get the parameter as view and this function call operation is going to be called whenever our user clicks on one of these buttons plus reset n minus so let's go to main activity and before writing our logic in here we need to distinguish on which button the user has clicked so in order to detect that we're going to say integer let's say ID and we're gonna say view dot and get ID and we're going to have a sweet kiss here and I'm going to pass that ID in here and here I'm going to have a kiss let's say added ID dot button + and let's do a break a statement in here and I'm going to create another case add that ID dot button - and let's say break in here finally I'm going to create a another case for button visit as well now here I can write the logic for + so this is our logic so I'm going to copy that and paste in here and for - this is our logic so let me copy that and finally for our reset function so let me copy that and paste in here and it says integer counter is already declared so let me pull this counter in here and by default I'm going to assign it at 0 and let me remove this and here also I can remove that accident it caught that thing in here right and now you can see we have combined all of these three methods into a single method call operation now let's run our app addition to verify the output and here is application so let me click on this plus you can see it is now working for - and for reset as well so all of our function that is working fine so this is how we can add the click functionality in our views from the XML attributes and in the next part I will show you the one more method that you can use the airplay functionality in your views and I will catch you guys in the next episode hello guys so let's see another important approach that we can use to handle a click event in our application so first of all let's come to the activity on us come in and let's remove the click operation now we didn't need that so here also and finally let's remove that one click from here as well now let's go to main activity and in this approach book and si button plus and dot sit on click listener and let's select this and here we're going to pass this keyboard and this keyword represents the object of our class called main activity and currently it is showing some error so let me click on this red ball or you can do alt + Enter and I'm going to select this second option call make main activity implement on click listener so let me click on that and and the studio will go into open one dialog box saying we need to override this method call on plate so let's select that and hit OK and there are two important changes in our main activity dot Java file the first one is this function and the second one is if you go to top you can see address to D has added this line implement on click view listener now whenever user clicks on this button plus our function called on click is going to be executed and here we are going to give a small message for now let's say toast dot make text and here we need to pass the context and our context is going to be main activity dot this as of no you can remove this mainactivity and you can simply pass this keyboard in here and then add comma and here we can write the message so let's say plus button is clicked and then add comma one more time and here we need to write the dose duration so let's say toast dot and he'll can see we have a two of Sun length underscore sort and length underscore now so let me select this sort and finally we need to say dot so now let's run this application and here's our application so let me click on this plus button and you can see we've got the nice message saying plus button is clicked so that's how we're going to handle the click event with this approach so if I go to top in here one more time so let's handle they click event in button - as well so button - dot set onclick listener and ready to sate this and finally for button reset as well let's do the same thing and whenever user clicks on one of this button our unclick function is now going to called and here also we need to distinguish the buttons on which user has clicked similar to that of and this case right in this case so let me actually copy that and instead of toast so I can simply paste that in here and instead of view we're going to say V in here now our replication is going to work in a similar way so as of now let me remove this function and let me remove these three and finally these three as well now let's run our application and his applications like an increment this counter decrement this counter and finally I can decide this counter as well so this is how can implement the same click event with these three approach so there are other approaches as well and we're going to look at them as we go on and for now we're going to stick with these three approaches only and you can use any approaches you like okay and I will save in the next episode in this episode we will see how we can use the image view in our application so let me go to the design tab and I can drag this image view in here and our under studio is going to sue this option so let me select this avatar and let me once if this and I can select any one of them so let me select this one and hit OK and here is our image view so let me go to text mode now and let me scroll down and here is our image view and I have already talked about this to this properties right so let me remove this tools property for now so I want to add the constant left so I'm gonna type C and then left to the left of parent and I'm going to add the constant right so first of all a community type C and then right and this constant is going to be to the right of parents so I'm going to type right again and let me hit enter and here I'm going to say a parent so far we have only added a horizontal constraint so let me add our on top concern as well that is for Tico constrain so see for constant and now let's type top to top off parent and if I run this application right now we are not going to see this image because I have used tools namespace in here that's why this author profile fixer is one again to be visible in our design editor so let me run this application to verify this and here's our application and you can observe that there is no avatar profile now let's go and add a real image in my desktop I have prepared one image so let me copy that image and let's go to drawable and I can paste that image in here so select the drawable instead of version 24 and hit OK and you need to write all of the this was filed into the lower case and you can use on the squares well if you want so let me hit OK for now and here is our image now let me remove this for now and I can say source and I need to type at the rate and drawable and here is our image name hundred on a Scottish studio and remember one thing we don't need to add the exchanger name and his I miss view and you can see it is now covering the whole space so let me change this with as 300 EP and hide us 200 TP and I can say are just few bounders true and finally I can say skill type as fit effects now let's run our application and here is our image and I forgot to tell you one thing you need to use image with smaller size and if you're going to use the image with larger size then you will going to get memory allocation error so as of now just use the image with a smaller size now let's go and add the button to the left of this plus button whenever user clicks on that button we're going to hide and so this image view so here by default let's say visibility as I'm gone and listen the idea of this image view as IB for image view and we can say let's say meme and in our main activity we're going to get that image be so private image view that's IB mean and here we need to get that XML file so IB meme is gonna be fine be by D order ID dot or IV underscore meme now let's add a one button as well so I'm gonna copy this button underscore rest and I'm going to paste that in here hide /so and here also let's see hide underscore so now we need to change the constant so instead of saying costing left to right a button plus we're going to say constraint right to left off our button plus and here is our button now let's go and get this button in our main activity as well so let's add comma and button hide so here we're going to say hide so as equal to a find V by D art ID dot button underscore hide so now let's hide click listener on this button so we're gonna say button hide so dot sit on click listener new on click listener and you can select any event handling method that we talked in the previous video and as of now I'm going to go with this approach so whenever someone clicks on this button we're going to check if IB meme dot let's say get a visibility equal equal dot view dot visible then we can say dot set the visibility as view dot and gone otherwise we're going to say I be maimed outside the visibility as a view and dot visible so let's go and run this application now and here's the application and by default the visibility of image view is gone so let me click on this button and here can see our image is now visible so let me click this button one more time and it is now gone so this is all we're going to cover in this video and I will save in the next episode hello my dear wonderful people in this episode we're going to learn the less Haven Android before that I will show you how can create the new activity or new screen in case of Android so first of all I'm going to right click on this package name and new and then Java class and here we need to give the our activity name so let's say ListView activity and then hit OK and here where it extend our activity with our app compact activity and finally we need to override one method call on create so just step on create and understood a is going to give us the epson and select the option which has only one parameter called bundle so let me click on that and here we need to assign our layout so the stripe set content and view and you can say r dot layout and here we need to write our layout name for ListView activity since we don't have XML for a ListView activity let's go to our layout so that's right click on that go to new and then select layout resource file and here let's say activity list view and then leave everything in default and hit OK now let's go to effects more and we're going to replace this linear layout with Lisp you and in order for me to record is a slab ctrl alt and yell and understood a is going to format the code for us so since this ListView is not going to have any child I can simply close that list view in here so as I said forward slash and then close with angular bracket and this is all we're going to do in this activity underscore list view so let me close this and here let's pass that layer times activity underscore list view and it says the cannot resolve symbol activity underscore layout even though we have that file in here so it is just a casting problem in Android studio you can totally ignore this error now let's go to our manifest file and here I wanted to register this newly created activity in our Android manifest file so let me copy this activity part and I'm going to paste that in here and instead of main activity we're going to say ListView activity and in case of main activity I'm going to change this launcher to default and wherever you are signed a launcher to a particular activity then it is going to be the false activity or a screen that is going to be open or whenever user clicks on the application icon in their phone and you can remove this view from here now let's go to list view activity and let's work on ListView so I'm going to say private ListView and it's gonna be ListView and here we're going to say list view and see Koster find P by D order ID dot and we have not given the any ID to our ListView so let me go to activity list view and here let's give the ID name so ID is gonna be list feel and you can assign any ID name you wish to so let me go to all s your activity and here we're going to say list view and this list view is responsible for showing our different options so let's create that options as well and in the top I'm going to say private let's say array of a spring and let's see options and I'm going to open the call the bracket and let's close that curly bracket in here let me close that panel as well and here we're going to write the options it's a little site couple of pops on a b c and let's say D so we're going to write D for option adds up now and we're going to modify this option as we go on and in order to show the list view we need one adapter so let's create a one array adapter and it is going to contain a string so let's say array adapter and new array adapter and the first part is going to be context so let's pass it this and the second parent is going to be resource and we're going to use one default resource from Android so this Android dot r dot layout dot simple list item one so let me choose this one and finally I need to provide a list up option so here we go now let's set this adapter to our less view so in order to set that operates very easy let's view dot set adapter and let's pass the ladder a raptor in here now let's run our application to check the output and his application and you can see we have full list in here so let me actually copy this and let my comma in here I'm going to paste that in here so let's say one say two three and let's see four and if I run this and here you can see we have the updated list so if we copy this and let me paste that in here one more time and here is a list view and we can scroll this list view as well now let's add a clipped is there on this list view so let's go to our lesbian activity and I'm going to remove this I just added this too so the functionality of ListView so let me delete that and in order to detect the click on list view we're going to say list view and dirt sit on item click listener so just click on that and type new and then type out after view dot on item click listener and if you select this option then our under studio is going to operate one method call on item click for us and this is the position in which user has created so let's sort ocean here so just type toast and just click tab and and the studio is automatically going to add a template for us and let's add some message so our message is gonna be let's see options array and let's pass that position in here and it is going to so Asti our option name so let's run this application and here's our petition now if I click on this B you can see we cut the toast at P so if I click on D got the Orson name so this is all we're going to cover in this episode and I will see you guys in the next episode hello there welcome back in this episode we're going to design a buyer application where user can enter name phone number email and their address with the help of relativelayout in android so let's go to our under studio and let's create one new activity or a screen and this time we're not going to use the manual method of creating the activity rather I'm just going to click right in here and go to new and then I can go to activity and here I'm going to select the in P activity and here we can directly keep the activity name so let's say my bio and we're going to use the delectably art only so let's say relative layout and select this checkbox called generate layout file and hit finish and here is our activity name my bio relative layout and his design and if you go to Android manifest file and you can see under the studio has added the activity for us so let me close that activity in here like this so that's how we can create the activity and its layout from the under studio now let's go to a ListView activity and instead of typing in here let's type introduction and instead of B let's say my bio app and does relativelayout and let me acid minimize this and instead of sewing toasting here I'm going to create our sweet statement and I'm going to pass that position in here and I'm going to check if position is zero then we're going to launch our main activity so you're not to navigate from one activity or one screen to another screen in case of Android we're going to say intend and let's create that engine in here and the first parameter is going to be the current activity since we're in the ListView activity we're going to say let's view activity and dot and this and the second parameter is going to be the class of our destination activity since we want to go from list view to your main activity it's gonna be main activity dot class in here and let's say start activity and hoping to pass that intent in here and this is how we're going to navigate from one screen to another screen so similarly let's check the kiss number one so if the position is one then we're going to go from our lispy activity to our my bio relative activity so I'm going to copy this and paste in here and instead of main activity we're going to say my bio relative activity okay now let me remove this to opsin as well and it is causing the error so let me remove this intent from here and I'm going to put that in here so let's intend in here and I can remove the intern class from here and you know to format your caller just press ctrl alt and yell now let's go and run this application to check whether this is working on not and his application and if I click on introduction you can see we are navigate to T another screen and I can do the normal operation as we did in the previous video now let me go back and if I click on my bio relative layout it is going to open the new screen now let's go and design our bio application with the help of relatively Advani so come to the activity my by or relative layout I can remove this constant layout with the relative layout because we're going to learn relative layout in this video so I can remove this as well so just type angular bracket and then type form as less and and less to do is going to close that view for us now let's design our application so first of all I'm going to add our text pier and its width gonna be maths parent and height gonna be wrap 110 so whenever you type maths parent it is going to occupy the whole space so let me actually make this bigger and whenever you add the wrap content it is only going to occupy the space needed for it now let's add text to this takes pure so just wrap text in here and hit enter and here let's say enter your data and let's say in thick text color as well so I'm going to say black so has 0 0 and 0 and let's increment the text size let's say 18 SP and we're going to align this text in center so subscribe text alignment and then type Center and let's say we have to keep the margin top and I'm going to add the margin top at 16 DP and here is our text view so far and below this text view I'm going to add the ear attacks and it's with gonna be max parent and height gonna be wrap on turn as well so let me close this view in here in order to close this view just sad for us less and understood is ultimately going to close that for us and let's add hint in here so you can say enter your name and we want to align our edit text and below out text view so for that we're going to give the ID for this text view first of all so subscribe ID and then add the red plus ID forward slash and here we're going to say txt for text view and let's say label and in our edit text we're going to say layout below and we're going to say text label and here is our edit text below our text view now I'm going to add the margin as 16 DP and here's our text view so far so let's keep the ID as well and we're going to say a tea tea for headaches and let's say a name so here also let's do the same thing ear attacks and maths parent and wrap content and hint it's gonna be enter your phone number and we're going to say input type as as fun and here also we can say input type has person name and this is going to suit the appropriate keyboard for a user and this is going to improve the user experience so let me add the margin as 16 DP and here is our detects and we want this elite X and below our edit name and we're going to say layout below edit name here let's keep the ID as well and again say edit e phone so I can simply copy this here it takes and paste in here and here as well so inside ability phone I'm going to say email and here I'm going to say address so instead of entire phone number I'm going to say enter your address I'm going to say enter your email and we're going to change the input type as text email address and here also instead of saying phone we're gonna say takes postal address or simply can add text in here and we want this eg text below our edit email right so let me copy this ID in here and I'm gonna paste that in here similarly I want this area takes below heart phone so let me copy that and paste that in here and finally I'm going to add one button the button wrap content and wrap content so that may close this view and I'm going to add the text as inter and I'm going to say all caps as false and let's say Center horizontal as true and here is a button so far now I want this button to appear blue our address so we can say layout below and then I'm going to say idiot address so it didn't actually notice one thing here never were going to add the ID then we're going to add plus symbol as well but whenever were going to reference this ID then we didn't need to add plus symbol in here but we can hurt that plus symbol as well and it is not going to cause any error and let me undo that so we have finally design our by application so let me run this application and here is our beautiful application so let me go to my bio relative layout and here is a design with the help of relative layout only so if I click on this phone number you can see we're getting the numbers only now if you click on this email and you can see we got the different keyboard with address symbol as well for email now if I click on this name now can see there is no address symbol and these properties are not coming up from input type attribute and this is all we are going to cover in this video and I will see you in the next episode and in the next video work in the design this same layout but with the help of linear layout so see you in the next part hello guys welcome back in this episode were going to design these same application but with the help of linear layout instead of relative layout but before that let's add a scroll view in our previous application so that you know even if you are running this application in a small device our view doesn't cut off so instead of legibly out let's say scroll view here so this is going to be our parent layout and make sure that if I'm scroll view in here and after that we can add the relative layout now so let you lay out and match parent and wrap content so let me close that relatively out by angular bracket and under studio is going to close that for us so let me cut this relative layout from here and I'm going to paste that in here and here's our previous layout now our application is now capable of running in a smaller size device as well without cutting off the fuse now let's go and design this same view with the help of linear layout this time so let's go to a package right click on that go to new and then select the activity and then choose empty activity and we're going to give our activity name as my buyer let's say linear layout and select is generally adoption and hit finish and here is our activity called my a linear layout and his layout first of all let's go to our list B activity and here we are going to add this solid raphson so first of all let me I come in here and I'm going to paste that in here and instead of relative layout we're going to say linear layout now whenever user clicks on our linear layout option that is our case - we're going to go from this reactivity to our my bio linear layout so select this second option here now right now we don't need this file and we'll need this main activity as well let me close this relatively out as well now instead of constantly out let's switch this to the linear layout and I'm going to add one property called orientation has a vertical and it is going to learn are all the tile view vertically so let me go to my bio relative layout and I can copy all of these views of to here and I'm going to paste that in here and this is our layout so far now here let me add margin at 16 DP and I will need this layout below because it is only going to be used for relatively out and let me remove this as well and finally this one and this one as well now we can remove the center horizontal as well now at all on this button to the center we're going to say layout gravity is the cost to Center then you can see it is now line to this center and yeah we have access provided same layout with the help of linear layout so the thing is you need to remember the orientation so let's see what happens if I change this to horizontal now our all that side view are aligned horizontally so if I change this to rock content as you can see we got the elite X in here so let me change this to wrap content and you can see we got the under the edit view in here so this is how linear layout works so let me undo the changes and instead of horizontal I'm going to say vertical so let's go ahead and run this application to verify and here's our application and if I click on this linear layout as you can see we got the same output and I hope you got the general idea of linear layout and we can look at different options of linear layout as we go on and I'll catch you guys in the next episode welcome back in this episode we're going to design this simple login form with the help of constantly out so let's go and design this form now right-click on your package go to new and go to activity and select empty activity and let's say login form activity and make sure you have check this box and hit finish and here is a login form activity and it's layout now let me go to a list view activity and I'm going to add that option in here so let's say login form and let's say constant layout and I'm going to add one more kiss so let me copy that and paste in here instead of two it is gonna be three and instead of my bio linear layout or going to say a login form activity and this is all we need to do so let me minimize this and we don't need this lisper activity anymore since we are only going to design this form we also don't need this activity and here is our activity login form now let's go to design tab and I right click on this rectangular screen and go to helpers and let's choose the add horizontal guideline and here is our horizontal guideline so let me actually open the component tree here and you can see we got the icon with upper triangle now if I click on this its position is going to be changed and if I click one more time and you can see this not change to percentage so let me open this attribute panel as well and I'm going to select this guideline here and inner layer constraint instead of 0.03 I'm going to save 0.1 and this represents to 10 percentage so inter and you can see we got the 10% margin from the top let's say this ideas well since it is a horizontal guideline I'm going to say yet G what's his chance for horizontal collide and I'm going to add 10 in here and let me hit enter now our ID name is yogge sheet tail and these guidelines will not be visible in our application but we can use this kind of guidelines to align our views the way we want so let's start another a horizontal guideline in here so I'm just going to right click on this screen and again helpers and horizontal guideline and here is my guideline so I'm just going to click on this icon and I'm going to click this icon one more time and it is change to person this so I'm just going to drag this and I'm going to raise this horizontal guideline at 90 percent days and I'm going to select this skyline here and I'm going to change the idea of this guideline so since this is a horizontal guideline one more time I'm going to say yep G and this time I'm going to say 90 and then just hit enter and now it's ID is yes G and 90 now let's go and add two vertical guideline from here and here so for that I'm going to click on helpers and add vertical guideline and if we cut the arrow let me click on that and let me click on this one more time and now this is 2% is now I'm going to drag this percentage of to 10% is so let's select this guideline and this time I'm going to say V G which is stands for vertical guideline and I'm going to say 10 in here so just hit enter and our ID name is VG 10 so let's go and add one more vertical guideline and here is our guideline so let me click on that and let me click on this one more time and now I'm going to drag this to date 90 percent days and like this and let's release that guideline in here now select this guideline in here and let's change this guy Dan ID as well so this is a vertical guideline and I'm going to say 19 here and hit enter so you can think all of these Garland's as the virtual boundaries on which we could add out all the views now let's go to text more and here can see we have their guidelines in here now let's go to top and now let's add out text view and I wit gonna be lets say match parent actually we're going to change this width but for now let's keep it Matt's parents and her hide gonna be wrap content and let me close this text view and let's assign the ID so we're going to say ideas txt let's say label so let's say text color is gonna be black and takes sides gonna be let's say 28 SB and let's add a text and I'm gonna say a login form and let's say it takes a style as bold and in order to format this just type ctrl alt and yell and it says if there is no view constraint so let's go and add some constraint now we want our text view to appear blue our horizontal guideline 10 so for that we're going to say constant that is C and we're gonna set top to bottom off our horizontal guideline tin and here can see it is now pairing to bottom of our horizontal guideline now we're going to align this text view to our vertical guideline 10 so we can say constrain left to right off our vertical guideline tin and he'll can see our view is not aligned to a vertical guideline but if you hover on these circles you can see our vertical guideline tin is also highlighted the reason is that we need to change the width from maths parent to 0 DP so previously our width was Matt's band so our text view was trying to occupy the all the space from its parent now whenever you add 0 DP in case of constantly out it is going to have different meaning so let me show you if you go to a design tab and just click on this text view now let me remove this 0tp from here and just click on this drop down menu so here can see we have another option called maths constrain and if I select this math constant let's see what happens you can see it is automatically assigning the value at 0 DP so in case of constantly out whenever you add 0 DP it's a value it's going to be mask strenght so you need to remember this thing now if you remember we have one added the constant to this vertical tin and this horizontal 10 now let's go and add a constant to right-hand side as well so I'm going to say C which is transfer a constant and right to the right our vertical constraint 90 so I'm going to type right here as well and I'm going to say vertical guideline 90 since it is just a straight line in this particular case you can say to the left of vertical Carlin 90 as well so in this particular case you can either go for a left or right it is not going to matter and here also you can either go for left or right and the reason is that this is a vertical guideline doesn't have any width now let's iron out edit X and our width can be 0 DP that is math constraint and our height is going to be wrap content so let's go and add the ID so going to say edit text that is EDT and let's say email and let's give the margin top as 32 DB and we're going to say int as enter your email now we need to add the constant to this edit text and we want this edit text to appear below our login form so for that we're going to say constant top to bottom off login form and our IDs text label and here can see how to edit X is below our login form text now we want this it takes to appear after this vertical guideline 10 so we can say constant left to the left of our vertical guideline 10 and as I've already mentioned you can either go for to write off as well and let's go and add the constant to write as well so constraint right to the right of or to the left of our vertical guideline 90 and here's our nice little it it takes now let's go and copy this edit text and I'm going to paste that in here and instead of idiot email we're going to say edit password by the way let me add input type as well so it's gonna be a text email address and in this case the input type is gonna be password and in our hint we're going to say enter your password and Hazel it takes password on the top of it it takes email and we want to add this edit text below our edit email sensitive text level we're going to say edit text email in here and we don't need to change this to a constraint and here is our design so far now let me show you the final result so let's go and add this to text view no account yet and sign up so I'm going to create the text view in here so text view and the width gonna be 0dp that is math constraint and our height can be wrap content so let's keep the ideas txt label no account yet and let's write our text and here we're going to say no account yet and here is out text view this since eat exercise as well and we're gonna say 20 SP and let's change the text color as well so we're gonna say black now we want to align this text below our edit password so it's going to be constrained top to bottom of our Eirik password and finally we want to align this text view after this vertical guideline 10 so constraint left to the left of vertical guideline tin so let's add some margin as well so I'm going to save margin let's say 32 DP and hazer option so by the way let me actually remove this text color it is not looking that much nice and we're going to add on the text view saying sign up let's go and do that in here so text view and 0dp and how it can be wrap content let me close that text view in here and going to CID txt label sign up and this a dot txt sign up and we're going to change the text size as 20s B and let's change the text color as well that's a 64 B 5 and that's a yup 6 and I want to change it takes this style as well so let's say bold and here's our text view and we want to align this text view to the right of no account yet so let's say constant left to the right of our no account yet so txt label no account yet and he can see we have a small arrow here mentioning that our signup text view is at the right of no account yet text view now we want this text view in here so for that we can say constraint top to the top of our no account yet and you can see we have a top concern to the top of no account yet now let's go and air the constraint button to the bottom of no account yet so constraint bottom to bottom of no account yet and you can see this to text view are now horizontally locked and finally let's add one login button so button and 0dp and height gonna be wrap intent so let's assign the ideas button login so let's see it takes as login and we're going to say it text color as white and we can add the background to this button similar to this one so let me copy that and paste in here so don't forget to add the healthy and here is a button progress so far let's add the margin top as 22 DP and we want to align this button below our no account yet or signup so constraint top to bottom off you can either type text label no account yet or sign up because both of them are equally aligned horizontally so for instance were going to go with no account yet and there is a button and we want this button to appear at this center so constant left to the left of our vertical garland tin and constant right to the right of particle guideline 90 and you can see our button is checking the entire space and that's because we have set the width and 0 DP and it is transfer Max constraint since we have added the constant to left and right so that's what it's going to take the entire space so instead of 0 DP if I had web content you can see it is going to take the smaller space and that's what we want now let me increase this size now login form is going to work exactly in every possible device so for example we have selected a pixel now let's go to the tablet one and he'll can see our form is looking exactly the same that we have designed so let's go and switch this tablet more to let say TB and harrelson were getting the desired output that's because we're dealing with person days in constant layout and that's the beauty of this constant layout so let me switch back to pixel so let's go and run this application and here is our application so let me go to a login form constraint layout and hair can see we got the login form and if you are running in the smaller device then you can add SQL view in here so instead of constantly out so let me say scroll view and make sure you have a scroll view in here and finally I'm going to add constantly out in here and I'm going to put that in here and finally in our view I'm going to say a field viewport as true and this is going to take the entire space and our design is ready to go and that's what we're going to use the constant layout to support multiple devices and this console layout plays significant role in improving the performance of application because in case of constantly out you can significantly reduce the nested view hierarchy compared to that of relative layout and linear layout and that's it for today's video and I will see you guys in the next episode hello guys in this episode were working to create a dice application whenever user clicks on this button poking the Saudi random diced number so let's build this so right click on your package name and go to new and select the activity and choose the empty activity and let's say dice activity and select this option and hit finish and here's our dice activity and it's layout now let's go to ListView activity and here let's add the dice option so dice app and we need to add the keys as well so let me copy that and I'm going to paste that in here so instead of three let's say 4 and here we can say dice activity now we don't need this ListView activity anymore so here instead of constantly out let's add legibly out and we're going to add the image view so image behavior let's say wrap content and hide can be wrap content as well so we can close this image view like this and let's keep the Miss pure as a placeholder and you can give this ID name as anything you want and we need to add the source image and in my desktop I have already prepared some images and these are some of the images and I'm going to provide this images to you so let me copy that and let's go to project and inside our tribal I'm going to paste that amazing here and select the drawable and hit OK and then hit OK one more time and here are those images now let's go to activity dice and hairless add the default source image so I'm going to add one and his Ramos so I want this image to appear at the center so I'm going to say Center in parent as true and here's our image now let's go and add one button so button and wrap content and wrap content and finally let's keep the idea as well so we're going to say button roll dice and here is her button so let's keep the it takes as well we're going to say roll dice and we want this button below her emails for you so we're going to use layout below and we're going to say IV placeholder and we want to align this button to Center horizontal so we have a one more property called Center horizontal and let's say true and I'm going to add margin top so for now we can say section D P and here is our button and image view now let's go to dice activity let me close that and we need to get the image view and button so grab it image view that's a IV placeholder and we need to get the button as well so button roll dice and we're going to say IB plus ultra it cost to find B by D at ID dot or IV underscore placeholder and for button we're going to say find view by ID ID ID dot button roll dice and whenever user clicks on this button we want to perform the operation so button roll dice and dot set on click listener and the step new on click listener and inside this function we're going to create a random number and you know to generate the random number we have a class called random so let's create the object of random and we can make use of this random object to generate a random number for us so random dot next int and we need to give the boundaries so whenever I type six this random object is going to generate a random number from 0 to 5 and as you know that in our dice application we have only number from one to six so we're going to add +1 in here now we're going to check if random number is it goes to 1 then we're going to set the image view as 1 right so set image resources we can say ordered rival and dot 1 and save if random number is a cost to 2 and then we're going to say Ivy placeholder set image resources at a tribal dot too and we're going to do something for rest of the number as well so let me do that quickly not a save time you and here's all day kiss now let's run this application and here's a little application and if I click on this and I SEP and here's our application so that we click on this button and you can see we got the different number so we can do that as many time we want and in this video we learn how to say the image view from Java and I will see you in the next episode hello there in this episode we are going to create the SMS application where a user can type phone number and message and we're going to send that SMS so let's go to our package right click on that go to new activity and select the empty activity so let's go and name this activity as SMS activity and this is going to be our layout and hit finish and here is our SMS activity and it's layout now let's go to list view activity and let's add that as soon as in here as well so SMS app and when it will update the kiss as well so let's copy that and we're going to make this house five and instead of dice application we're going to say SMS activity now let's close this activity and let's go to take small in our activity SMS and instead of constantly out let's use linear layout and as you already know that we need to assign the orientation for linear layout and our orientation is going to be vertical in this case and let's say the gravity has Center because we want to align outside bill to the center so here let's create one edit text so it's gonna be match parent and wrap content so let's give it the ideas edit phone and its input types gonna be fun and let's keep the hint as inter phone number and let's add the margin left has 32 DP and margin right has 32 DP as well now let me copy this and I'm going to paste that in here so instead of phone working to say message and let me remove this to individual margin rather we're going to add the margin to for Gregson and instead of India phone number we're going to say enter your messes and our input type is gonna be text multi-line and we're going to help button in here so button wrap contain and wrap content so that's it takes as send SMS and we need to give the ID so let's say button underscore send so in our SMS activity let's get that it it takes and buttons so private ear it takes and it takes phone and it it takes message and let's get that button as well so button and send SMS now let's link this is job object to our XML views so idiot phone is the cost to find PID order ID dot edit phone and for our elite message we're gonna say find pew by ideology dot edit message and finally button send SMS is koster hard ID doubt button underscore send and whenever user clicks on this button we want to send the SMS but before that we need you go to a manifest file and we're going to write our permission here so our users permission is gonna be send underscore SMS now we didn't need this Android manifest file anymore so let me close that now let's add the click listener on this send SMS button so set on click listener new on click listener so first of all willing to check whether the user has granted permission or not say it's gonna be IND permission and we're going to say context compact and dot check self permission and it's going to be context and our second parameter is gonna be late permission so our permission is going to be manifest file and dot permission dot send SMS and it says false argument is wrong so instead of this keyboard we're going to say SMS activity dot this and that's because whenever you read this it represents the object of this implementation but in this case we need the object of our main activity that is SMS activity so we're gonna say SMS activity dot and this and here let's say if permission equal equal package manager dot permission granted and then we can send SMS otherwise we need to ask the permission to users at runtime so let's show the dialog to users asking for permission so activity compact and dot request permission and we need to pass the context as soon as actively dot this and then we need to pass the array list of permission which is of type string so we can say new string and open the curly bracket and here we're in dimension our permission so manifest file dot permission dot send SMS and just add comma and if we need to pass one request goes it can be anything you want so for example let's say 1 1 1 and we're going to need this request code later now after this on create method we're going to override one more method called on request permission result and request permissions result and I'm going to have a Swiss keys in here and let's pass this request score variable this one and we're going to have a kiss call 1 1 1 that's because we have used the request code as 1 1 1 so if you use the recur squares let's say 5 then look at the hab 5 in here now we're going to check if grant results and 0 so we are writing the zero because we are only asking for one permission okay equal equal package manager dot permission grant and then we can send SMS otherwise we're going to so simple toast message to user saying we need SMS permission and finally let's add a break statement and in our default case going to read this super metal so let me cut that and paste in here and here I'm going to call a function called sin SMS and we don't have that function right so in order to create that function alt' + enter' and then select the options which says create method sin SMS and here's our function called sin SMS and from here we're going to set the actual SMS the SMS manager as he goes to a SMS manager dot get and default and it's gonna be SMS manager dot send text message and the first parameter is gonna be the phone number so we're gonna say edit phone and dot and get text dot to string and dart trim and this stream function is going to remove the white space from our string and the second parameter is gonna be the source address so we're going to pass null by default and our third parent is gonna be the actual message so it is going to be it it takes message and dot and get text to string and we're going to do trim here as well and we don't want the pending intent so we're gonna say null and we don't want the delivery engine as well so let's pass null here as well so this is our function call send text message now here we can say toast and message sent now let me copy this function and i'm going to paste that in here as well now let's go and run this application to check the output and here's our application so let's go to SMS app and let's type some number and let's say hi how are you and that's it send and our application is asking for the permission so let's recall our option and it says message sent now let me go to SMS and here is our SMS and we want update that and who can see we have seen the masses hi how are you - this number so this is how can send the SMS programmatically and I will save in the next part hello guys welcome back in this episode we're going to build a simple currency converter application which is going to convert the dollar into the Sterling pound so let me enter some dollar currency and if I click on convert and it's going to convert this dollar to pound and we're going to design this layout in constantly out so let's go ahead and do this so right click on the package go to new and then activity and select the empty activity so let's say currency converter activity and this is going to be our layout so hit finish and here is a Java file and it's layout now let's go to a list reactivity and let's add that option so we're going to say currency converter and in our case let's say case number six a pessimist activity we're going to say currency converter and dot class now let's close this lispy activity and let me minimize this panel as well now let's go and add our text view here and let's see we're going to be Matt's constraint that is and 0dp and our height gonna be wrap content and let's keep the idea as well and we can say txt let's say label and on the scope converter now let's add our text view and we can say $1 to pound converter and let's add margin top as 32 DP and we're gonna say it takes the line as Center now let's add some constraint I want to add the constraint top to top of parent so see for constraint and then top and to the top of our parent now let's say constraint left to the left of parent and a constraint right to the right of parent and I want to add the constraint bottom to the bottom of parent as well and heads out text dollar to pound converter now let's go and increase the text size as well and we're gonna say 20 SP and finally we're going to add the constraint vertical bias so just type C for constant V for vertical and type B for bias and here's your constraint vertical applies and I want to add a 20% particle bias so I'm going to say 0.2 and here is our textbook and whenever you are constant particle bias then our text view is going to appear from these 20 percentage of T available space from top now let's go and add it it takes in here and we can just say 0 DP again that is math constraint and our height can be wrap content and let's say it takes as a dollar and our hint it's going to be inter and dollar and we want this edit text to appear below our XP so constrained top to the bottom of text label converter and let's say cost a left to the left of parent and constrained right to the right of our parent now let's add some margin top as well who can say 32 DP and here's our gtex so instead of writing with a 0 DP let's say 250 DP now we need the button so button let's say wrap on 10 wrap content and we're going to say button convert and we want this button below our it it takes so constant top to button off he didn't come dollar and let's say constant left to the left of parent and constraint right to the right of parent and less Rd takes as convert and let's add some margin top as well let's say 32 DP and we're going to say it takes all caps as false and finally let's add on the text view to so our result let's say we're gonna be 250 DP and our height can be wrapped content and we're going to add the idea as a txt underscore result unless a default takes as results will be here and we want this text be below our button so constraint top two button off button convert and let's say constraint left to the left of parent and constraint right to the right of parent and we're going to add margin drop a story to DP unless I the text alignment as a center and this is our final layout now let's go to our currency converter activity and let's get that edit X button and our result textview private and button and button convert and we're gonna say it it takes this is gonna be in dollar and you can say takes view and it's gonna be txt a result so let's connect this Java object to our XML so button convert it cost to find P by D and ID dot button underscore convert and for dollar find P by dr died e dot edit and dollar and finally let's say it takes Rizal is cost to find V by D ad ID dot text a result now let's add the click listener on this button set on click listener and this time I'm going to pass this keyboard in here now just write alt + Enter or click on this red button and select this second option and hit OK and our activity is now implementing onclicklistener and its method is in here and here let's declare a variable called dollar and it's gonna be he did dollar god and get text dot to his string and then we need to convert this string to our double so alt' + enter' and select the option which says wrap using double dot parse double and here is input value from our user and here we're going to declare another variable let's say double convert it pond so it's going to be dollar x value of pound for its dollar so just go to google and so just I have one dollar to punt and you will get the current craite so it's currently 0.77 so let me go to under studio and we're going to say 0 into seven seven and this is our converted value now we finally need to set this value to our result so it's gonna be a text result dot septics and we need to pass this converted pound value in here since this is a double value when to pass this into the East Wing so let me congratulate this with empty string now before performing any operation let's go and check a simple condition if it takes dollar dot get text dot to string dot length we're going to check the length of a string first of all if it is greater than zero then only we are going to perform our operation otherwise we're going to say toast enter value and I'm going to cut this and I'm going to put that inside the if block now let's go and run our application and here is our application select Nicotra currency converter and without entering any value if I click on this button it says enter value now let me add one and if I hit convert you can see this is a converted pound so let me add some random number and if I convert and here is her converted pound value sleeping code to Google and effort to have hundred twenty two and here is her output so let me open the emulator and we got the 93 and 93 here as well and we got the slight difference in decimal position but that's okay for now and I will save in the next episode hello there welcome back in this episode we will learn how to pass the data from one activity to another activity that is from one screen to another screen so let's right click on our package let's go to activity and let's select interactivity and let's keep the name as activity a and this is gonna be our layout select mindfulness and here is our activity and it's layout now let's go and create another activity so activity and susinchu activity and this time we're going to say activity underscore B and this is going to be our layout so hit finish and here's our activity and it's layout now let's go to a list view activity and we're going to add a new option let's say passing data between screen or activity and in our up son we're going to say so this is going to be our key seven and we want to go to activity a first of all now let's go to activity a XML and instead of constantly out let's say relatively out now let's keep the background to this activity and I'm going to say 7 e 5 7 and then C 2 and you can select any background color you want and here I'm going to say textview let's say maths parent and wrap content and I'm going to keep the ideas let's say txt activity underscore a and let's add the tics as activity / screen E and let's increase the text size let's see 25 SP and let's change the text color as well let's say white and we're gonna say Center in parent as true and here's our text view so let's add text alignment as Center and finally Lisa texas-style as a bold and blue this I'm gonna add one button so button wrap content and drag content so let's give the ID name as button a and I want this button to appear below our text view so we're going to say layout below us txt activity a and let's say margin top as 16 DP and we're going to keep the text has send data to activity B and this is a center horizontal as true and it is an align Center horizontally so this is our design for activity a now let me copy this now let's go to activity on the scope the XML and I to paste that in here and I'm going to change the color so let's say da e9 a 5 and this is the color that we're going to use and I'm going to remove the color white and here I'm going to say button underscore B and here I'm going to say activity on a square B and instead of screen a we're gonna say screen B and I need to copy that and paste in here now instead of saying data to Bay we're gonna say go to this for you so what we want to do is whenever user clicks on this button we want to see the data to this activity and whenever user click on this button we want to go to the ListView let me minimize this panel and I can close this ListView activity as well now let's go to activity a and here let's get that button it's gonna be button and button a it's gonna be fine pube ID ID ID dot button underscore a and we're going to add the click listener to this so button here dot set on click listener neon click listener and as we have already I know to go from one activity to another activity we're going to use intent so internet cost you new intent and the first parameter is going to be our current activity so in this case it is gonna be activity underscore e dot this and our second parameter is going to be the class of destination activity since we want to go from activity to activity B we're going to say activity B dot class and we just need to restart our activity so let's pass that intern in here so with this tool and we're going to move from one activity to another activity now we're gonna pass the data from this activity to another activity we're going to add some extras in our intent so let's say in 10 dot put extra and here we need to provide the key so let's say our keys name and write comma and after then we need to provide the actual value so let's say John Cena let's provide one of the value put extra and we're going to say is and let's say 42 and remember this is a string value and this is an integer value and we need this information whenever we want to retrieve the data in our second activity and finally we need to pass another extra so let's say our key name is message and let's pass the actual message in here so let's say you can't see me and this is all we need to do to pass our data from one activity to another activity now let's go to activity B and let's get those data and our false values name right so let's say name value and we're going to say get intent and dot get string extra because the data type for name is the string in this case finally we need to write the key name in here and this name is actually coming up from here let's get another value set screen that's gonna be its value and get intent and dot get in extra this time and we need to provide that key name so it is is in this case and in case of primitive data type we need to provide the default value as well so let's pass and zero in here and I made a small mistake it needs to be integer and finally let's get that message value as well and it's gonna be get intent dot get string extra and our key name is message since the string is not a primitive data type we are not going to pass any default value so let's go and pin this value in her locket so in order to print their value in lock out in just a block and then type D and here we need to provide one tag it can be anything you like for the time being let's say checking value and we need to pass out data so let's say name value is value and finally our of message so let me run this application and here's our application so if I click on this button and we are now at the screen a and if I click on this button we are now at the screen B now if I go to look at and make sure you have selected the current emulator or a real device and our application package name and select evolve what's in here now let me copy that and you can see we got that value in our locket and zone Cena is is 44 and the message as you turn to see me so that's how we're going to pass the data from one screen to another screen now let's go and display this data in our text view called activity underscore B so for that vanity takes P so it's gonna be textview let's say txt B and it's gonna be fine view by ID order ID dot and if I go to activity B this is our ID name so let me copy that and I can paste that in here now we can say text B dot set text and here we can say name call on let's put that value in here so name value and I'm going to write that is in new line so for that you need to do black slash and then yearn for new line and let's is an hour is is gonna be his value now let's add the message in new line as well and we're gonna say a message Colin let's a message value in here so let me go to activity B and let's add the on click listener on this button as well and whenever someone clicks on this button we want to go to the list me right so button find PID RIT dot button underscore B so let's remove this log data and we're going to say button B dot set up like listener click listener and we're going to say intent new intent and from activity B want to go to the ListView activity and look in the say start activity and we just need to pass that intern in here now let's go and run this application and here is the application so let me click on this debating screens and let me click on this button and here can see we have passed the data from a screen a to screen B and if I click on this button we will go back to our list view activity so let me click on that and we are back to the let's view so this is how you can pass the data from one screen to another screen now let's go to my bio linear layout now let's do one talks whenever user enters all the data in these fields and clicks on this button then we will pass all the data from this activity to another activity called profile activity so let's do this and in our project you can see there is no profile activity so let's go and create that profile activity so activity and see we see empty activity and let's call it profile activity and hit finish and here is our profile activity and it's layout now let me go to resource inside layout and let's open the file called activity my bio linear layout and I'm going to copy all of this code and let's go to our activity underscore profile and I'm going to paste that in here so this is going to be our layout for a profile activity now let me close the other files which we don't need here so I don't need that and I don't need this activity as well now let's open our words have a file called my bio linear layout now in our my bio nearly activity we need to get all of this edit text and buttons in here so let's go and do that so it's going to be private it takes and let's say it takes phone it it takes name it it takes email and finally it takes address let's get that button as well so button it's gonna be button send now let's get these views in our Java object so it it takes phone it's gonna be find B by D order ID dot edit underscore phone similarly listen to it for eg takes name write it out takes underscore name by the way let me pause this and for each email it's gonna verify B by D order ID dot edit email now whenever user clicks on this button send we want to send the data to profile activity so set on click listener new on click listener and let's create our intent it's a new intent and want to go from my bio linear activity to profile activity dot class and let's start our activity and as you just saw we need to pass the data from this intent object so intent art put extra and we need to give the key name in here so let's say name key and then we need to provide the axle data so it's gonna be editing him and dot and get text to a string so let's do the same thing for our phone number so phone key he detects phone dot get text dot to a string similarly for email email key it it takes email dot in yet text to a string and finally let's do it for address as well support extra so address key and we're going to say edit address and dot get text to a string so we have passed the data from my by linear layer to our profile activity so let's go and get this data in our profile activity but before going into the profile activity let me copy this and I'm going to paste that in here and let me also copy this and I'm going to paste that in here so let's create those values in here so our name is gonna be get intent dot and get a string extra and our key name it is going to be named key in this case so let's say email get intent dot get a string extra and email in here similarly for a phone get intent Darden and get a string extra and phone finally let's say address get intend darted get a string extra and our address key actually I need to say email key and phone key in here because we have added the key name has phone key an email key so let me copy that and paste that in here and for email key as well I'm going to do this same thing so finally let's say edit phone dot set text and hook and say phone in here and for a dress that's a said text address and for a name and finally for our email as well and this is all in judo so let's add one click listener on this button as well and whenever user clicks on this button we want to go from profile activity to lispy activity so start activity new intent and profile activity dot this to ListView activity so instead of writing two lines of code I did in one line now let's run our application and here's our application so let me go to my bio linear layout and our application is crashed so let's go and see what went wrong so in order to check that let's go to look at and let me remove this filter and I need to choose error in here just click on this blue line and it says sit on click listener on null object reference so this means this button is not initialized so let me go to activity my by a linear layout and let's keep the ID in here so let's say button underscore send and I'm going to copy this ID let's go down here and I'm going to paste that in here and this is going to solve our error since we have to sculpt it this design code in our activity profile we need to make the same changes as well otherwise we'll get this same error it's a button on the skull sent and this time it should work so let's give it a try and here is our application so let's go to a linear layout and let's enter our name so our phone number and let's give the email address and let's give the address and if I hit enter you can see Ricardo's data but we are not actually getting the address right so something is wrong so let's go to my bio linear layout and this is our key name so I think I misspelled here so I need to write key in here so you can copy that and paste that in here just to be in safe side so let me run this application one more time and his application so they can hit enter and this time we got the data in our profile activity so I hope you got the whole concept by passing the data from one activity to another activity and I will see you in the next episode hello guys welcome back in this episode were working to create fully functional calculator application and in this calculator you can perform all sort of operation alright so let's go and build this calculator application so let's go to our package right click on that go to new and then go to activity and select the empty activity and let's name our activity as a calculator activity and select this checkbox and hit finish and this is our Java class and it's layout now let me go to a list reactivity and let's add the option for a calculator calculator let's say linear layout as well because we're going to use linear layout in this calculator and in our case let me add that calculator activity in here so calculator activity and instead of seven we're going to say eight and we didn't need this let's peel activity anymore so let me close that and let me minimize this panel so let me open the activity on a score calculator and instead of constantly out we're gonna see linear layout here so linear layout and our orientation is gonna be vertical in this case so let's see what some has 22 so I have assigned 22 in here and that means our screen is divided into 22 different equal parts from top to button because I have set the orientation as vertical all right so that's the meaning of that wet Sun and we're going to add text bit here and let's say maths parent and height can be wrap content and let's assign the ID and here we're going to display our result our input so you can think of this lag as screen as well so let's get the idea as txg result let's assign the weight as six and once I had layout weight as six then this textview is going to occupy the six number of parts out of this twenty two parts now let's say gravity as button and end and one side this our textview is going to appear at this part bottom and end so let me so if I add takes us let's say testing you can see our text-based appeared in here so for now I'm just going to remove that now let's add ticks size as 35 as P and we're going to give the background so let's skip the background has eb e 6 e 6 and we're gonna say pairing bottom has 32 DP and let's say padding right as 32 dps well and just what the testing purpose let's as tools and text as let's say 0 and as i have already talked about this tool name a space it is only going to appear at design-time not in the real device now let's add another linear layout and it's with gonna be maths parent and height gonna be wrap content and this time i'm going to say the orientation has horizontal and i'm going to assign the wet as for since i have use 4 and 6 in here we have used 10 parts out of 22 parts so we have to well parts remaining in our layout so just remember this thing and inside this linear layout I'm going to add button so let's say button and I'm going to give the width as 0 DP and I have already 0 TPS with because I'm going to control the width of this button with another properties and we will see that shortly height gonna be max parent and let's keep the ideas button 1 and in our linear layout I'm going to add with some as 4 and in our button I'm going to say weight as 1 and whenever we add with some as 4 then this linear layer is going to split in four different equal parts horizontally because we have set the orientation as horizontal and whenever I add the weight as 1 then this button is only going to occupy one part out for part okay so that's the important thing so let's add the text in this button and we're going to say one let's add the background as well and we're going to say at the red color and forwards less and then we need to write the name of our color so let's say number color anythign see it is now giving us the error that's because we don't have this color right so let me copy that now let's go to project inside our resource folder let's go to values in our color dot XML let's add the color name so color it's going to be named and let's paste that name in here and here we need to provide the actual value for this color so let's say our color is going to be 6 6 B B 6 a and let's declare another color let's say symbol color and we're going to assign the value of this color as 7 e 5 7 c and then 2 so this is going to be background color for symbol and this is gonna be background color for our numbers so let's go to activity calculator and we can actually close this color XML so let me minimize this panel as well and let's say the text color as white and we're going to change the text size and we're going to say it takes a style as bold and finally let us keep the margin as 1 DP and this is our button so far so let me actually copy this button and I'm going to paste that three times one two and three and instead of button one I'm gonna say button 2 and here three and finally I'm going to say button division that is deep now let me go to this linear layout and I'm going to copy this linear layout and I'm going to paste that treat em as well one two and three and here is our buttons so let me open this secondly nearly out and instead of button 1 here I'm going to say button 4 and let's change this takes as well so button 4 and here we're going to say button 5 so since this takes as button five as well so it's gonna be button six so antics gonna be six as well and this is gonna be button - and let's add - symbol in here and we're going to change the color as symbol color for this - similarly let me click on this button one so let's change it takes us to and here are three and here I'm going to add divide now let's click on this button of TOD row and instead of button one I'm going to say button seven and let's say seven and we're going to say eight here say it as well and we're gonna say nine and nine as well and instead of button division we're going to say button multiply and let's add a string in here and look in this a symbol color for this aspect similarly let me click on this forward slash and that is division and I'm going to change this color as symbol color now let me click on this first button of fourth row and I'm going to say button clear and let's trap CLR here here we're gonna say button zero and we're going to add it takes us and zero and we're gonna say but an equal and our background color gonna be symbol color so let's add equal in here as well and finally this is gonna be button plus so let's add the plus symbol and our symbol color and instead of adding margin top is caused to one going to say margin across to one so let me go to eat it and then find and select the replace so here I'm simply going to type margin and equal to and 1 DP and I'm going to replace all and our application is now looking good so as you see place the margin top with margin for every button so let me close this now now let's go and run our app Edison and here's our application so let me click on this and we got the output now let's go and work on the Java part to make it functional so let's come to calculate the activity and here we need to declare all of those buttons so it's gonna be private button button to button 3 and I'm going to do that up to nine including zero and these are all the number buttons so let's go and create the buttons for our symbol as well finally let's declare out takes P as well so textview it's gonna be txt result and we need to assign all of these views to our external component so going to do find B by D so button 0 find PID order ID dot button 0 and I'm going to do the same thing for rest of the buttons as well alright so by this point I have assigned my job object to my XML views now let me go to a button one and I'm going to assign one attribute call on click and we're going to say number operation and I'm going to copy that and I'm going to paste that in to three inside our four five button six button 7 button 8 button 9 and in our button 0 as well so ctrl alt yell to format and as we know that we need to create the function called number operation in our main activity so let me copy this and here let us create that function so public void and her function name and inside this we need to pass our view and this function is going to be called whenever user clicks on new make buttons so I'm going to say button here say button and I'm going to cast this view as buttons so alt enter and select the first option cast 200 that widget dot button since this function is only going to be called whenever someone clicks on numeric buttons we can actually cast this view to the buttons now we're going to say it takes a result and dot set text and we're going to say it takes result dot get text to a string plus button dot get text dot to a string so what widget has that we take the value from text result and then we take the value from our button for example if the user has clicked the number six then this function is going to return this six and it is going to obtain that value to the previous value of text result and finally we have said they takes result again so let me actually run this application and you will get a better idea of what we are doing here so here is our application so if I click 5 then outtakes retail value is 5 now if I click 6 there is going to be 56 you can see they are appending together and if I click 3 it is now pending to that four I hope you are getting the point up to here so let's move forward now let's go to top and I'm going to declare two variable first thing is integer first input let's say 0 and our second input it's going to be 0 as well and I'm going to declare some boolean variables and I'm going to say it's add is subtract he's multiplied his division and let's come in here and when my user clicks on button plus then we're going to say set our click listener new one click listener and inside this we can say if takes result and dot and get takes dot to string dot length not equal to 0 then we're going to say first input is the costume takes result dot get text to string and then we need to change the string to integer and then type alt' + enter' and then select the option wrap using integer dot value of so this is gonna be our first input and we're going to say is ad as true and finally we're going to say it takes result dot set X as null now let me copy this and then we're going to do same thing for - division and multiply as well so let me paste that here and instead of plus or going to say - and here we're gonna say is subtraction as true similarly let me paste that one more time and instead of plus we're going to say multiply and we can say is multiplayers true so let me piss that one more time and here we're going to say button divided and is divided gonna be true and finally for button clear we're gonna say button clear and the first input is gonna be 0 second input is going to be 0 as well and let me remove this and then we're going to say set text as empty string and we didn't need to check this condition here and finally we need to add the listener to our button equal so we're gonna say button equal dot set on click listener new on click listener and we're going to check if he's had he cost to true or he's subtract is true or he is multiply or is division is true and then we're going to say second input as Jocasta takes a result and dot and get text dot to string and then you need to cast this string to integer so just click alt and enter and select the tour option called integer dot and value of and after this Aoife statement within the check another if statement is articles to true then we're going to say it takes result dot set text and it is going to be first input plus second input and then we need to convert this value to a string and we're going to say 'yes because to fall now let me copy this and I'm to paste that for subtraction multiply and for division as well and here I'm going to say Esau crack is true and here is subtract let me copy that and I'm going to paste that here his multipliers false and let me copy this easy division and I'm going to paste that here and paste that here as well since it applause here I'm going to say divide and here I'm going to say asterik and I'm going to say - in here but for division we need to change this to double right so let's say double and we're gonna say result value is equals to first input divided by second input and let me remove that and we're going to say spring dot format and we want up to two decimal numbers so I'm just gonna say percentage dot two and Jeff and I'm going to pass the result value in here and this is all we need to do to make our calculator functional so let's run this application to check the output and his application so let me go to a calculator so let me click five into five and let me hit equal you didn't see we got the output now I'm going to hit clear to clear that screen so let's say 10 minus 6 and riccati 4 so this means our calculator is now fully functional and I will see you guys in the next episode hello guys in this episode were conducted the same design of our calculator but with the help of constantly out only so let's go ahead designed this so first of all the right click on your package go to new and select activity and then to simply activity and here we can say calculator 2 and this is going to be our layout and hit finish and here is our calculator and it's layout now let me go to list be activity and let's add that option as well so going to say calculator constraint layout and in our option we're going to say kiss 9 and calculator to dot class so let's close this less reactive as you know and let me close this panel as well so I'm going to add the vertical guideline first of all so the stripe guideline and its height canopy wrap content and with canopy wrap on 10 as well and here is a guideline and by default it is horizontal so let's make this as a particle so for that we can say or intestine as for chakal and here is our vertical guideline and I'm going to add constant guideline percentage as a 25 so I'm going to say 0.25 and let's keep the idea as a vertical guideline that is VZ + 25 and I'm going to copy this and paste in here and here so let me format this and instead of 25 I'm going to say 50 and here let me remove this too and here is our second particle and finally I'm gonna say a particle guideline 75 and let me remove this too and I'm gonna add 7 that is 75% is and here is our 3 for the calc Islands now I'm going to copy this and I'm going to add one horizontal guideline and I'm going to say horizontal guideline Totti and our orientation is going to be horizontal and instead of 75 we're going to say 30 or 3 and here is our horizontal guideline now let me copy this and I'm going to piss that three times one two and three and here is our design so far so let's go to add text view for showing the results this is going to be textview let's save it gonna be zero DB that is Matt's constraint and height gonna be 0 DP as well and everything to keep the ideas takes underscore result and let's say texturizer and zero and text size as 35 SP and we're going to define the gravity as button and end so let's say background has has eb e 6 e 6 so I'm gonna add the constant top to top of parent and I'm going to add the constraint bottom to top of our horizontal guideline Totti and finally I'm gonna say con still left to the left of parent and constrain right to the right of parent and heads out textview so let me have some padding I'm going to say 32 DP and as of now this textview is covering the 30 percentage of our screen and we are left with 70 percent days of our screen so let me show you something and as you can see when I had 4 rows 1 2 3 & 4 so we are only left with 70% of the screen and we need to add four rows so let me open the calculator and I'm going to say 70 divided by four saris Row is going to take this piece off 17.5% days so let me copy the skyline and paste in here and instead of 30 now I'm going to say 30 plus seventeen point five which is equal to forty seven point five so that's why we're gonna say four seven five in here and here's our horizontal Guilin now let's change the ID as well so I'm going to say a horizontal guideline 47 and instead of writing dot five I'm going to say 47 underscore five okay now let me copy this one more time and paste in here and let me open the calculator one more time so forty seven point five plus seventeen point five and we got this sixty five so let's change the portion is a sixty five here and let's rename the idea as horizontal 65 and here is another horizontal guideline so let me copy this and paste in here one more time so let's go to calculate row and 65 plus our seventeen point five and we got the eighty two point five let me remove the sixty five and we're going to say eighty two point five and here we are going to say 85 underscore five and here is our fourth horizontal line so let me format this first of all control all and yell so let me open the final output so we're going to add button one here and button for seven and clear similarly we're going to say three six nine and equal so let's go and build this individual buttons now so first of all over get it is in all the buttons for first color and second column toran fourth so let me come in here let's say first column and let's go and build the buttons so our button with canopy 0dp is mass constant and our height gonna be 0 DP as well so let's keep the idea as button1 and let's say take size 1 and let's add the background color as a number color and we got this number color in our previous video so let me do ctrl + click and here is a colorful number color and for a symbol color let me close this now and so far there is no button right that's because of from 0 DP n 0 DP now let's say text size gonna be a 25 SP and a text scholar gonna be white and takes the style gonna be bold and we're going to add the margin as 1 DP and finally we're going to add the constant now so we're going to say constant top to the bottom of horizontal guideline 30 and constant left to the left of parent and constraint right to the left of our vertical guideline 25 and finally we're going to say constant bottom to the top of our whole central gallon 47 underscore 5 and here is our button now let me format this first of all and make sure your constant is in the same order as that of mine so first of all it's at the bottom top left to left right to left and top to button because we are going to do a lot of copy and paste in this video so if you maintain the order then you will get to save a lot of times as well as there is less sense of getting error now let me copy this and I'm going to paste that in here and instead of button one I'm going to say button 4 and here also button 4 and in our button top constraint instead of 45.7 we can say horizontal constraint 65 and in our top bottom constraint I'm going to say horizontal constraint 47.5 and here is number four so let me copy this and I'm going to paste that in here and instead of four let's say seven and seven here as well and in our button top instead of horizontal 65 I'm going to say horizontal eighty five point five so 16 plus seventeen point five it needs to be eighty two point five so I added the wrong idea so let me change this to horizontal eighty two point five and finally in our constant top button I'm going to say holds under constant 65 now let me copy this and I'm going to paste that in here and instead of button seven I'm going to say button clear and let slide siela that is clear in here and in case of constraint bottom to top off I'm going to say constraint bottom to bottom off and we're going to say parent in here and finally we're going to say constant top to bottom off horizontal guideline eighty two point five and now let's write the second column so we're going to say second column and for that I'm going to copy this up to here and let me paste that in here and instead of button one we're going to say button two and takes two in here and in this column we're going to change this to constantly constantly left to left off and constant right to left off so in our constant left to left off vertical constraint 25 and in our constant right to the left of vertical constraint 15 and let me copy this too and I'm going to paste that in here here and here as well and instead of button clear let's say zero and zero here as well and in case of button seven I'm going to say but it and button it here as well and finally I'm going to say button five and five here as well and this is our second column now let me add third column and I'm going to copy these buttons up to here and let's paste that in here so let's go to here and instead of button - we're gonna say button three so let's say button three and instead of five we're going to say six and here also six and in case of button eight we're going to say button nine and it gets a button zero we're going to say but an equal and let's say equal here as well and I forgot to get this value to nine and instead of number color I'm going to say symbol color so let's go to button three so let me click on that and in this column also we need to update this - constraint constraint left - left off and the constant right to the left off so in this case we can say vertical constraint 50 and vertical constraint 75 and here is a button three so let me copy this and in a button six let me replace this with our new constraint so we are not seeing any result so that will go through design tab and you can see our design is now updated so let me go to text mode one more time and here is a six so the problem was due today guessing Molly so let me go to about a nine and I can replace these two constraint and similarly for our button I can replace these two with our new constant and here is our third column as well now let's go and add the final column that is fourth column and I'm going to copy these four buttons and I'm going to paste that in here and instead of button three I'm going to say button divided and let's add the divided symbol and in our fourth column as well we can change this to a constraint so instead of constant left to left we're going to say constant left to right off and we're going to say vertical constant 75 and finally instead of constraint right to left off we can say constraint right to right off and we're going to say parent in here and here's our forward slash now let me call and change the background color as symbol color and I'm going to copy this to constraint now and I can paste that in here here and here as well and instead of equal let's say plus and plus here as well and let's change the number color has similar color and instead of nine we can the same multiply and instead of six we can say minus and here let's say minus as well and finally change the background color has similar color and this is our final output so let's go and run this application and here is the application so let me go to a calculator constantly out and you can see we got the same layout and you can have the calculation function if you want as that our previous video and I will see in the next episode hello everyone welcome back and in this section we're going to learn about the networking library called retrofit and this is our final application and here we can type anything and whenever we hit Send button we're going to retrieve the related data from the Wikipedia so let me search for Roman reigns and let's hit send and we got the API data Wikipedia so let's go and learn about the retrofit library in this section now come to your under studio go to a file and create the new and history project so I have already created the new understudy project and here is my activity XML RS layout so just pause this video and create the new project first of all so once you create your project replace this constant layout with a linear layout and let's remove this text below and here we are going to say it it takes Matt's parent wrap content and let's give the ideas input and below this we're going to add one button let's say wrap contain and wrap content and it's ID gonna be sent and after this button let's add one progress bar sober up contain grab content and let's keep the ideas progress bar and the minute I had the orange isn't as vertical to our linear layout and here is our design so far so let's add the text to our button let's say send and let's add the hint to our lead X so let's say enter your search query and after this progress bar looking at the list view so Matt's parent and Matt's parent and let's give the ID as list view and for our progress bar let's say gravity as Center and we want to hide the progress bar initially and for our it takes let's say pairing adds adp and margin at ADP and this is going to be our final layout now let's go to our main activity and let's get those components in here alright so our design part is ready now let's go to Google and then source for retrofit get up and then click on the first link and retrofit is an open source networking library build by square so if you scroll a bit you will see the download of and we just need to copy this dependency and let's go to our Anna studio let's open the Builder cutter and let's say implementation and let's paste that in here and we need to convert our JSON data to a Java object so for that we need 1 more parsing library so let's go to website and let's go to retrofit configuration and you can see we have lots of converters for converting our XML or JSON data to Java object so for now we're going to use gisun converter so let me copy that and this could render studio and I'm going to paste that in here and make sure you have same dependency in here and in order to debug our networking data we're going to add one more dependency and let me paste that in here and make sure to add this Login interceptor in your dependency as well and this is all we need to do in this file so let's it sync now we can close this file and before signing off from this video I want you to go to the google and type postman download and just go to a post mentor come / download and download this postman depending upon your system and I have already downloaded this postman so I'm not going to download this so basically this postman is going to be very helpful whenever you are testing your API so let me show you what it looks like so here is my postman and this is the EPA that we are going to work in this section so just pause this video and write this in your notepad so whenever I add parents like Excel format list and yes ourselves and let me hit enter and as you can see we will get the list of data and we're going to pass this data in our section so before going into the next video download this postman and write the CPI in your soft box make sure you have selected get in here and then add this action format SR source and this value inside the query parents under your param step and I will catch you guys in the next one hello everyone I hope you are doing great and in this episode we are going to prepare the retrofit client so in our package let's go to new and Java class and let's create a file named call API client and here is our class and inside this I'm going to create one private static final string and let's call it this URL and inside this visual we need to add the base URL of our API so let me go to postman we uncheck this query and this is gonna be our base path so I'm going to copy that and let's paste that in here and make sure you have already forward slash in there as well otherwise our application is going to grass so let's create another variable private static retrofit and let's initialize this with null and now we're going to create a public static function which is going to return the instance of retrofit and let's call it get API client and here we're going to say sgtp login interceptor it's a costly new HTTP login interceptor and here we're going to check if our application is running in the debug person then when we were going to print our network lock otherwise it is going to be securities here so let's say I stood to be logging interceptor dot label and we're going to say HTTP logon interceptor dot label dot body so let's go to the definition of body let's say what it says and it says it is going to print a request and response both along with their respective headers and bodies and if you had the headers inside a body then it is only going to print the headers of our request and response and if you print none then it is not going to print any loc and if your application is not running in the debug version then we're going to say none in here and then we're going to say ok HTTP client let's call it client new ok HTTP client start builder and then we're going to say add interceptor and here we're going to add our HTTP interceptor and let's fill this okay HTTP client and then we're going to check if our retrofit instance is null and then only we are going to create our retrofit instance otherwise we're going to directly return our retrofit instance like this so whenever our retrofit is null that is for the first time we want to create the retrofit instance like this so new retrofit builder dot base URL this is where we are going to write our base URL and dot client and let's pass our ok as did your client in here and then we're going to add the converter factory and remember we have used these decent converter right so here we can say decent converter dot create and finally let's build this retrofit so this is all ready to do in this API client so we don't need this anymore so let me close this now let's go to our package and we're going to create one interface and let's call it API service and then we're going to write a function called source wiki and it is good to take a special parameter call at the Requiem app and let's say map string a string let's call it params and we need to annotate this function with and get method and inside this get method we need to pass the part of our URL so let's go to our postman and this is gonna be our remaining path so let me copy that and let's paste that in here and here we're getting some error but let's leave it for now so just go to the Android studio setting and then go to plugins and then in a marketplace source for Robo pazzo generator and then install the plug-in and restart here and the studio so have already installed this plug-in so I'm not going to do that so once you install and restart around the studio come to this point okay now let me go to postman and I'm going to click this button to copy this in my clipboard now let's go to render studio and I'm going to create one package let's call it model and inside this model right click on that go to new and then at the button you will see an option called generate poser from jason from our recent install plugin and i'm going to paste that in here so this is our Justin response and here select Java and then select JSON because we are going to use this decent plugin and let's name this class name as source response and then hit generate and if you open the model you can see we have list of files so let me upon one of them and you can see our adjacent data is now automatically represented to a Java instance so you can see all of those classes like this and as you can see every JSON object is mapped to the sub object so this is a nice plugin to have instead of writing all of them manually now let's go to a pay service and this function is going to return this special type of data and it's going to be called and inside this angular bracket I'm going to say source response and make sure you have imported this class correctly and this is Oliver thing to cover in this part so catch you guys in the next part hello guys welcome back and in this episode of again to handle the button onclick listener and the facing of data from the network so inside our main activity let's say send button dot set on click listener so first of all let's get the query it now really takes so it's going to be elite text dot get text dot to a string and here we're going to check if query is empty then we're going to say enter your query first and we're going to return from this function and if there is something in this it takes then we're going to call our API it's the first of all let's so the progress bar is the progress bar dot set visibility as visible and from here working to call our API so here we need to say API service based services goes to API client dot and get a PA client dot create and then we'll just say hip a service dot class and let's create one map because our Appian needs those map so here I'm going to say string string let's call it parents new has map and let me open the postman now and here can see we need to pass acts on format list and source as the key and their respective value so let's do that in here so let me open this application side by side and let's call it parents dot put and when it is say action and our accent is going to be always constant so this way and our second key is gonna be format and it is also going to be always constant which is JSON in this case and let's say parent start put and it's gonna be list and here we need to say source and the value of this yes our source key is going to be different right so parents start put let's say yes our source which is our query in this case and this query is now dynamically coming up from our ear attacks now we didn't need to reference this anymore so let me go to full screen and here we can say call and let's say source response and if you remember this is the same data type that we are returning from our API call so that's why we're adding that in here so let's call it call and it's going to be a pay service dot source wiki and let's pass that hashmap in here and finally when it is say call dot in queue and then write new and then type call back and you will see auto cessation from retrofit make sure to select this one so double click on this option and our under studio is going to override the methods for us and this method is going to be called remember or abs service doesn't return the data so let's say could not retrieve data and if I ap call is successful then we will get the data inside our own response method and let's say progress bar dot set visibility has gone and let me copy this and let's paste that in here as well so in both case were going to hide that progress bar and from here we need to update our list view and we're going to update our list view in the next part but before that lets go to our Android manifest file and make sure I buried the internet permission and inside our application makes it ready uses clear text traffic as true and let's run this application and if we get the error like in book customs are only supported starting and at all just go to your builder cradle and then add this options in here and make sure to add these four lines so head sync and let's run this application and here is our application so let me type Nikola Tesla and let's it send and here's our progress bar and we got our data so let's go to our Lockett and then change this error to verbose and herds us type ok HTT P and I ok has to be lager is going to lock that data in our lock at and who can see we made the get request to this API and we caught the 200 and here is our list of data and in the next episode we're going to see what kind of data we're at ribbing and how we can add those Jedi now let's peel so catch you guys in the next one hello guys welcome back and in our previous video we faced the data in our locker so let me go to postman and if I hit Send and we got the same response in formatted way so let's see what it has so first of all we have the three JSON object please continue and query and we are not interested in the best complete and continue so let's forget about that and inside our JSON query object we have the asserts inference source and we are not going to make use of this source info as well we are only interested in this sort subject and as you can see we have this JSON object called title so we're going to make use of this title to so this in our ListView okay so let's do that so come to the main activity and this is where we need to parse those data right so in order to do that I'm going to create the error list of a string and let's call it results and it's going to be new ArrayList and I'm also going to create the array list of sorts item and this class was generated from our plugin and here let's call it sorts items and instead of new ArrayList were going to say response dot body dot so let's go - postman one more time so our required data is inside our query right so I'm going to say body dot and get query and let's say dot source and it says incompatible type so I'm going to make this ArrayList as least one Lee all right now we're going to pass this source list so it's gonna be sorts item let's say yes and let's pass this source item in here so inside this for loop we're going to say results dot add just dot and get title because we are one interested in title so once we complete with that we're going to say array adapter and it's gonna be of type string and let's say new array adapter and we need to pass the context and we need to pass our layout so layered is gonna be Android dot r dot layout dot simple list item underscore one and when to pass our array list which is result in this case so finally we can say list view dot set adapter and let's pass that array debris in here and this is all ready to do so let's run this application and here's our app listen so let me search for Nikola Tesla and let's hit Send and here's our data from our Wikipedia API so this is house and use retrofit library to perform the networking talks in Android so see you guys in the next one hello guys welcome back and in this section we're going to build this protocol your application or you can write you about yourself your experience the number of projects you have done your happy clients as well as the list of services that you provide and in our second tab we can add the list of projects that we have done or for the companies you have worked for and in our tour tab open to write our contact details so let's go and build this application in this section and to come to the under studio and then go to file new and then create the new project from here and I have already created the new project so I'm not going to do that in here and once you create your project come to your color stored XML and instead of default color we're going to use this color in this application so make these changes in your color store XML file now let me close this and then open the Builder Gradle and inside our builder Gradle file looking at this dependency for our application so these first two dependency is about navigation component and we need this second dependency for our recycler view and cut view and this is the image library for loading the images so read these dependencies in your App level builder file and hit sync and once you build this success will go to activity underscore min and let's replace this textbook with button navigation view so let me minimize this and with gonna be match parent and height gonna be rap content so let's give it the ideas navigation and we're gonna say constant start to the start of parent and we're gonna say constrain bottom to the bottom of parent and then we're going to say constraint end to the end of parent and let's say the background color as Android colon attribute window background and above this we're going to create one fragment and we're going to say height at 0 DB that is math constraint and hard can it be mask on front as well and then we're going to specify the attribute called name and we're going to say and root X dot navigation dot fragment dot NAB host fragment and make sure you have type this exactly otherwise it is not gonna work so let me format this and I'm going to assign the ideas let's say fragment and let's keep the constraint bottom to the top of parent and constant right to the right of parent and then we're going to say constant left to the left of parent as well and finally let's say constraint top to the top of parent now let's go to our resource folder and we're going to create the new and the resource directory and let's say that the navigation in here and inside this package working to create a new navigation resource file let's call this filename as app navigation graph ok so let's go to our design tab and here's an empty board so let's go to our in Java class and here let's create another package fragment and inside these fragments let's go and create our three fragments so let's keep the name of bagman as flagman home and I'll check this box and hit finish similarly let's go and create another fragment and I'm going to call this fragment as fragment projects and uncheck this option and hit finished and finally one great last fragment called fragment contact so fragment contact all right now let's go to our app navigation graph and let's add those fragments in here and we didn't get our fragment as often so let me close this project and let's reopen this and here's our under studio so let me click on this button and this time we got our fragments so let me click on this home fragment and let's add our fragment project and finally our fragment contact as well and here is our three fragments and make sure there is a home icon at the top of fragment home now let's go to our resource folder and right click on that go to new and select II and resource directory and let's select the menu in here and hit OK and inside this mini package we're going to create the menu for our bottom navigation view so let's call it bottom navigation minnow and hit OK and for our minnow we need some icons so let's go to resource and then fector assets so let's select or I can call home and let's name this as icon on the scholar home and hit next and let's get the icon for our project as well now let's sort the suitable icon and I'm going to select this icon called phone Android and let's seen these two icon underscore project and hit next and finish now let's get our final icon as well so here I'm going to say contact and let me select this icon and let's call it icon on the score contact and then hit next and finish now come to the bottom navigation menu and here we're going to say item well let's keep the ID as fragment home and let's keep the title as home and let's keep the icon as icon underscore home so let me format this and I'm going to copy this and paste it in here and here and instead of flagmen home let's say a fragment project and here we can say icon on the score project and here we're going to say fragment contact say I cannot underscore contact and let me go to this icon and this icon is in white colors so first of all I'm going to format this and let's change this white color to black color so let me close this let's go to icon underscore home and let's change this color to black as well and finally for our contact icon let's make this black as well all right so let me close this now now let's go to the activity underscore mean and in our button navigation view we're going to say menu has put a navigation menu now let's open the preview here and here is our layout so far and inside our fragment I'm going to say app nap graph at the red navigations last app navigation graph and I'm going to add one more parameter called app default nap host as true and this is our layout for activity underscore min now let's go to our layout and let's open the activity on the score home and I named this fragment as fragment underscore home too so let me factor that to fragment on the score home so I think I need to refactor in my Java class as well okay we have the correct name so we didn't need to refactor that now let's go to coding section and here instead of saying hello blank fragment let's say home fragment and I'm going to say gravity as Center so let me copy this text view let's open the projects and I'm going to place that in here and let's say projects fragment and for our contact as well let's do the same thing so this is our basic layout so far now let's go to our main activity and here let's get that Potter navigation view so button navigation theory is a cost to find few by ID hearted ID dot or button navigation view ID so it is navigation in this case and we're going to say nap controller in C cost to navigation dot and let's pass our activity and here we need to pass the ID of our fragment and RIT is fragment in this case so let me quickly verify that and here is a fragment ID and we need to say navigation UI dot set up with navigation controller and here we need to pass our butter navigation here and our nap controller and let's run this application and here's our application and our design is not visible so let's go to our ANA studio so let's go to activity underscore main and here is our constant and here is our navigation view okay so let me change this parent to navigation and let's also go to help navigation graph so let me copy that and let's go to button navigation menu and I'm going to paste that in here that's because RIT needs to be same otherwise it is not gonna work so let's go to a fragment projects so let's copy that ID and I'm going to paste that in here similarly for our fragment contact let's copy and paste that in here alright so let's give it a try and here's your application and you can see we are loading the home fragment as default now let's go to projects and has a project fragment now let's go to contacts and here's our contact fragment and let me change this to contact fragment so let's go to a fragment contact and lists in this to contact and this is all we're going to do in this episode and then the next episode were going to design our fragment home so I'll see you there and in this lecture we are going to design this topmost part of our layout and in my desktop I have a folder called portfolio and here I have some images and I'm going to copy these images now let's go to Anna studio and I'm going to paste them in my resource driver folder and I'm going to provide this folder as a resource file to you now come to the fragment underscore home and let's replace this frame layout for this goal here because we want to have a scrolling functionality in our application so let me remove this text view and inside this I'm going to add it constantly out so throughout this section we're going to make use of constant layout only so let's say math parent and our height gonna be wrap content now let's go and partition this is screen vertically into three different parts so for that I'm going to use the guideline and it's going to be wrap contained wrap until unless add the orientation as vertical and I'm going to ask Austen guide percentages 0.33 that is 33% is and who can see the blue dot in our screen so let's add another particle path friend and here I'm going to say 66 percentage and here's our second vertical guideline now let's assign the ideas VG that is vertical guideline and let's say six six and here we're gonna say ideas across to particle guideline three three now I'm going to add the two horizontal guideline first at the 20 percenters and second at the 97 percentage so let me copy this and I'm going to piss that here twice and he'll sit be horizontal and horizontal as well so let's say 20% is man here we're gonna say 97% is and here I'm going to say horizontal guideline 97 and here I'm going to say holds into a guideline Totti and here let's say a few and we're going to say 0 DP and height at 0 DP as well so we're going to design our height and width based upon the constraints so that's why we're adding the math constraint or 0 depending here and let's assign the idea as a few background and here let's add the constraint so I'm going to say constant bottom to bottom off horizontal guideline 30 and let's also give the background as color primary let's say cost and write to the writer parent and constrain top to the top of parent and we're gonna say constant left to the left of parent and let's say own Jason has vertical and our design is not visible as up now but let's keep on adding our widgets and once all the constraint are master then our design will be visible so let's say cart view and let's keep the width as 100 DP and hide as 100 DP as well and the reason we are going to add the card fields that we're going to make our image circular and we're not going to use any third-party library and just to make our image circular okay so we're going to achieve that functionality with the help of card view so I'm going to say a car corner radius as 50 DP and as you can see our card view is now circular now let's add some constraint I'm going to say a constant top to top of parent and let's say constant start to the start of parent and constraint in to the end of parent and let's also add the constraint horizontal biases 50% dates so that our image aligns to Center and inside this carp you can add the image Bo so image beer and let's say max parent math parent and let's assign the ideas profile image and working this a scaled try path center crop let's assign the source ass at the red Radl slash and John and I'm going to provide this image as your resource file or you can use your own image and in my cart view I'm going to add one more constraint and I'm going to say constraint vertical same style as that and whenever we add Patterson in here our child view will be at the center of our layout so if we add this spread so I'll be will try to occupy as much as a space possible and after this card view let's add two more text pane and it is going to represent our name and our post so let's go below our cart view and let's say Tex pure so rap contain wrap content and let's keep it the ideas a profile name and let's say the text gonna be John Deere and let's add the text size as 18 SP and we're going to make this as bold so textile as bald so let's change this color as white and we're going to say margin-top as hit DP and here we're going to say a constraint horizontal bias as 50 percentage and let's say constraint start to the start of parent and we want to how about text below Carpio so in here live at the ideas card view and here we're going to say a constant top to the bottom of our cart view now I'm going to copy this text view and let's paste that below it and let's say profile title and let's see the position gonna be Android developer and our text size is gonna be 15 SP and we're not going to make our text as a bold and let me replace this constant and I'm going to riad him one more time so let's say constraint but um to the bottom of our pew background and we're gonna say constraint top to the bottom of our profile name and let's say constant start to the start of parent and constant end to the end of parent and we're going to say constraint holds in Tobias as 50% days so our view gets aligned to the center so our profile name is still not visible so let's go to here and let's add some constraint and here we're going to say a constraint bottom to the top of our profile title and instead of adding constant bottom to bottom let's say constraint top to the bottom of our car view and in our Kart view we're gonna say constant bottom to the top of our profile name and this is all we're going to cover in this part so see you guys in the next one hello guys welcome back and in this episode were going to continue designing our fragment home and in this episode were going to design this part so let's go - understood yeah and before designing our second section I'm going to say scroll bars as none because we don't want this kind of vertical bar in our scroll view and we need to change this spread to pact so in a previous video I change back to the spread but I didn't report it to the packed and come to this person and let me copy this let's paste that in here and we're gonna say txt experience label and let's say five plus and our height going to be 0 DP and with canopy 0 DP as well so by the way let me format this first of all and listen at the text size as 20 SP and our color is gonna be color primary and let me remove all of this constraint from here and we're going to add the new Costin so let's say constant left to the left of parent and constant right to the right of our vertical guideline 33 and who can say constant top to the bottom of our horizontal guideline Tati and let's say it takes a linesman as Center and it says going to add layout gravity as well so alt + Enter and sit gravity as Center horizontal and I'm going to copy this text view and let's paste that in here and let's say takes experience and who can say years experience and I'm going to replace this constant with constant top to the bottom of takes experience label and our text view is still not feasible so let me change this hi to wrap content and instead of constant bottom to bottom off I'm going to say constant top to bottom off and here's our text view so let me remove this scholar and take size from here and here is our birth text so let me copy both of them and paste that in here and instead of text experience label I'm going to say text project level and here let's say 50 plus projects and I'm going to say text projects now let's modify some constant so in our left to left constant I'm going to say for tickle guideline 33 and you know right to write constant I'm going to say vertical guideline 66 and instead of text experience label I'm going to say text project level now let's see in some costume for this takes project level as well so here we're gonna say vertical guideline 33 and vertical khylin 66 okay so this is all ready to do so let me copy this to text me one more time and let's paste that in here and instead of text project level let's say text clients label and here I'm going to say 30 plus and you know constant left we left I'm going to say a vertical guideline 66 until now right - right constant I'm going to say parent and here we're going to say takes clients and let's change this to a vertical guideline 66 and let's call it parent and instead of text project level we're going to say text client level and let's see happy clients and let's change this text as well so here I'm going to say projects and here's our design so far so see you guys in the next part and in this episode walk into design in this part so let's go to our under studio and below this happy clients let's add one card view and we're going to say jeredy PS width and height gonna be wrap content and let's give the ideas card view about and we're gonna say elevation as a 5 DP and it will going to provide this side effect in our card view and let's say margin as ATP and who can say constant end to the end of parent and constant start to the start of parent and we're gonna say constant top to the bottom of our takes grinds and inside this card you're going to add to text below and with gonna be 0 DP and our height can be rep content so let's give the ID adds txt underscore bio and let's see it takes as about me and we're gonna say text color as color primary and let's say it takes style as bold and let's keep the text size as 18 SP and we need to add some constant so let's wrap this textview inside our constantly out so Matt's parent and wrap intent and let me put that text view inside our layout and let's add the constant as constant in to the IND of parent and we're going to say constant start to the start of parent and let's say constant top to the top of parent and here's our textview so far now I'm going to copy this text view and let me piss that in here and here I'm going to say in description and I'm going to add the alluring text in here so make sure to add your own version of description you can add your own bio or you can actually go to Google and search for lorem ipsum text and let's remove this text size and textile and we don't need this color as well so let me remove that and let's remove this constant width constant top to the bottom of our takes underscore bio and here is our description now I'm going to copy this card view and let's paste that in here and let's keep the ID to discard view as card view mobile and who can I say constant top to the bottom of our card view about and instead of text by oh let's say text app label and here we're going to say mobile app development and I'm going to copy this ID and let's paste that in here and here we're going to say text underscore app and here is a constant bottom to the bottom of our horizontal Garland 97 and finally let's add some padding let's say 8 DP and here also let's add 8 DP now let's go to our strings dot XML and here makes it add your name so let's run this application and here's our application with our name and I request you to change this a description and your services as per unit and in the next episode we're going to work on this project tabs so see you guys in the next one hello my dear wonderful people welcome back and in this episode we are going to build this UI so come to your under studio and open the fragment underscore projects and here we don't need this textview and let's say press this frame layout with grid view and we want to display three columns so let's say a number of columns as three and we're gonna say vertical spacing as 5 DP and let's say horizontal spacing as 5 DPS well and let's say it one more property called screeds mode and we're going to say column width and let's close this great view by adding for us this an angular bracket and this add the ID to discrete view as well so let's say grid view and we don't need to do anything in this file so let me close this one now let's go and design our item for our grid view so let me show you what I mean by that now let's go and design our layout for this particular item and we're going to replicate this same layout for all of our data so let's go down the studio and inside out layout and select layout resource file and we're going to say item client and let's replace this constant layout with card for you and I'm going to say wrap content and wrap content and inside this let's add one linear layout and I'm going to set the height and width as wrap intent and let's say the orientation as the particle and inside this let's add one textview so we're going to say wrap contain and drop content so let's assign the ideas txt client name and know Texas Charlie's gonna be bolder and this add it takes us let's say Amazon and let's keep the color as color primary and in our linear layout let's add some padding and let's say gravity as Center now below this textview I'm going to add one image view and now it's gonna be 100 DP + 180 PS well so let's keep the ideas image view client logo and let's keep the margin as 5 DP and looking at the source as let's say Amazon and I hope you have already added these images in your drawer folder and if you haven't added that file consider adding that in your gravel folder and let's say at this view pound as true and this is gonna be our layout so let's close this file as well now let's go to our package and let's create a file called client model and we're going to say string has a client name and increase your ads client logo and let's create the constructor as well so generate constructor and has a constructor and let's close this class as well now let's go to our fragment projects and wouldn't need this constructor so let me remove that and here I'm going to create a list of our client model let's say clients and after that let's get the gridview as well and here let's override one method call on pure created method and inside this we're going to say great few is a cost to view dot find view by D hundred ID dot grid view and we're gonna say clients modeled as new ArrayList and inside this client list let me add some of the data so I'm going to say new client model and we'll to pass his name and image ID so let's say amazin and our insight is our dot travel dot Amazon similarly let's do it for Apple now I'm going to pause this video and add them quickly and here I've added all those data in our ArrayList and this is all we're going to cover in this video and before going into the next video make sure you have added this data in your array list so catch you guys in the next part and in this episode we're going to create the adapter to bind our data into our view so let's go to our package and let's go to new and Java class and let's create a file called raptor client and this is going to extend the base adapter class so click on this red ball and implement methods and here I'm going to create context and a list of client models and let's create a constructor and in our get count method were going to return when modern start size and here we're going to return coins models dot kept and let's pass that position and from our get item ID method we're going to return the position and we don't need to create this default constructor so let me remove that and help need to bind out data to our adapter so before that let me the private static class let's call it freeholder and inside this we're going to get image view let's say client logo and our text view say client name and inside this gate view method we're going to use the view holder pattern and we already saw how we can implement that few holder pattern so here I'm going to say a client model and she cost to client model start yet and let's pass that puts in and here I'm going to clear the object of the holder and let's declare a one more variable called few and working to check if convertview is a cost to null then one leave we want to inflate our layout so if I were going to say if you hold her it's a cost to new view holder and let's say layout inflator because we want to inflate our layout here so layout inflator chart from context and we're gonna say convert via to cause to layout inflator dot inflate and inside this we need to pass our layout IDs so hardly out dot so let me go to a resource so it's going to be item on the score find and finally I'm going to pass the parent and false and we are getting the error even though we have that file and this is a bug in and studio if you want to solve this problem close this understudy and restart again so I'm not going to do that for now and let's say if you holder dot mind logo as convert view dot find V by D r dot ID dot IB underscore client logo and let's get our client name as well she cost to convert view dot fine PYD hundred ID dot txt client name and these two IDs are coming up from our item on ask or client who can see IB client logo and text client name and finally we're going to say if you is it cost to convert view and let's say convert view dot set tag and let's pass the view holder in here and if a converter is not null then we can say if you hold her it's a caster convert view dot get dad and let's cause that to our few holder and finally we're going to save you easy cost to convert view let's reach on that view from here and I think you know instead of creating this few like this so let me remove that so let me remove this as well and I'm going to return the convert view from here directly so we just got rid of that extra object and here we're gonna say glide the dot with let's pass our context and load and willing to load our image so it's gonna be client model chart client logo and we want to load this image into view holder dot client logo and finally let's also set out text so if you hold our dart my name dot said text and it's gonna be Klein model dot client name alright so we have completed the code in our wrapper class now let's go to fragment projects and this is where when it is set our adapter so I'm going to say adapter client C cause the new order pro client and let's pass the context and our client models let's say grid view dot state Raptor and let's pass the adapter client now let's run this application and has application now let's go to our project fragments and here's the design for our fragment projects so in the next part we're going to work on our contact fragments so see them hello guys welcome back and in this episode we're going to design our contact fragments so first of all we're going to need these three icons so let's go to under studio and in our resource folder let's go to vector and let me search for email and I'm going to change this color to black and let's say icon email hit next and finish so let's go and create the two more icons and let's search for a phone and I'm going to call it icon phone and let's go and create one last image so I'm going to source for a place so icon underscore place so it next and finish and we have prepared our troubles now let's go to layout and this upon the fragment underscore contact and let's remove this textview and instead of frame layout we're going to say a card view so let's say Martinez 16 DP and our height can be wrap content and inside this card view I'm going to add the linear layout this can be math spend and wrap content and let's say or intestine as particle and inside this linear layout working to add the relative layout so maths parent wrap content and let's keep the ideas phone wrapper and here we're going to say image view let's say 24 DP + 24 DP here as well and I'm going to assign the ideas I can phone and the set is source as I can underscore phone and in my rigidly hot I'm going to add deep padding as 10 DP and here is our design so far now let's go and add the text view so Matt spend and wrap content and let's keep the ID as txt fun and I'm gonna say Martin start as 16db and let's add margin left at 16 DP as well and let's add it takes as a random phone number and here is our text blue so far now let's align how to exclude towards the right of our phone and here we're gonna say layout to the right of icon phone and let's also say layout to the end of our icon on the score phone and here is our text view so I'm going to copy this entire relative layout and let me paste that twice and here we're going to say address rapper and let's say I can address let me copy that paste around here and here we're going to say icon place and let's change this to text address and let's say California USA and finally let's change this to email wrapper and let's give the ID name as icon email and in our trouble I can say icon email as well so let me copy that and I'm going to paste that in here and here as well and let's change this name to txt ml so let me change this email to let say admin at gmail.com and here is our final layout so let's run this up listen and here's our petition so let's go to our contact fragment and here is our contra catalyst and I'd like us you to add your own original address in here and I will see you guys in the next part hello my dear wonderful people welcome back and in this episode I will show you how can we do apk file so come to the tool dobson and here you can see we have two option called build bundles or apks and generate signed Epicure bundle so our first option called dual bundle or apk is going to generate the debug person of your application and this debug version of apk is very useful whenever you are working with your team or you need to send this apk file to your client then you need to go for debug a PK for most of the time and in order to build the debug applicators for easy just click on this menu and once you build is successful you will see this dialog so let me click on this locate or you can actually go to events lock and you can actually click on this option and the salir in this project you whatever you want so for now I'm just gonna say copy dot apk file now can send this file to whomever you want and they will be able to open your application but there is one problem with this a Deepak apk you cannot upload this file to the Google Play Store account so for that you need to go for the second option so let's go to a build and let's select generate sign bundle or apk so for now let me select the apk person so let me create a new path and human it is specify the path and I'm going to store this file in my desktop so let's say learning and hit save and here we need to provide the passwords so let me create the password and I'm going to add this same password in here as well and mixer you always remember this alias and password otherwise you will not be able to operate for application later so make sure to keep that in safe place so here I'm going to give the first and last name and I'm not going to fill up the rest of our detail so let me hit OK and if I didn't Windows there will be dot J key extension by default but in case of Mac there is no dot cheekiest file by default so make sure to add that manually and you can check this box if you want and hit next and here we can deselect the release Watson so hit finish and once you build is finished you will see a dialog in your button right-hand part or you can actually click on this event and here you will see often called locate and you can see we have a folder called release and it can actually rename this anything you want so let's say learning and also this folder you will see a file called learning dot shakiest file and this file is super important while updating our application in Google Play Store so you always need to save this file in the secure place and this is all we are going to cover in this video so see you guys in the next one
Info
Channel: Programming Path
Views: 26,051
Rating: undefined out of 5
Keywords: Android App Development Tutorial For Beginners, The complete Android Application development Course, How to make and Android app for beginners, Android Development for beginners, How to become an Android Developer 2020, Android course 2020, Android development Course, Android Studio tutorials for beginners
Id: I_-6TDZmCKY
Channel Id: undefined
Length: 216min 51sec (13011 seconds)
Published: Fri Jun 12 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.