Android Studio Tutorial - Part 1 (2020 Edition)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everybody its Danielle thanks for joining me today we're gonna build an Android app specifically an inventory management app so the first thing we need to build an Android app is Android studio so go ahead and google that and we can download it for free from developer.android.com so go ahead and go there it's about a gig so it may take a little bit to download you can learn more about it on this screen it kind of shows some screenshots but the important thing to note is that it is free number one it's free and it's available for both Windows Mac and Linux you can also do it on a Chromebook I haven't actually tried a Chromebook I have one but I just haven't tried it yet but I've tried all three platforms it works really well I'll assume you're on Windows kind of has some minimum specs there Mac but these all platforms working really well so go out to the top and go ahead and hit the download Android studio button and I actually already have it installed so just fast for a little bit you know waited and I wait to download it and I'm gonna go ahead and open it up so it looks like dad can go to your launcher or just go ahead and open up Android studio I'm on Mac here sital show up in applications on Windows just go to the Start menu has a nice little animation and the first thing we're gonna do is we're gonna go ahead and there's a couple of things you can do when you first open it up but for the first time you can just go oh and also this is gonna I'm using the light theme so this all maybe dark for you but it should look you should still have these options here so go ahead and do start a new Android studio project and again I'm using the light theme so it looks kind of light but I'll show you how to change that later let's go ahead and just select basic activity and there's a lot you can do here you can make you can create a new you know a watch app a TV app and Android Auto app and other things but right now let's just stick to phone and tablet cuz that's what we're gonna be doing if you're gonna be creating like a map app you can kind of do that or a login screen it kind of this is kind of like a little template to get just started but for us basic activity is exactly what we want so it kind of tells you a little bit about it let's go ahead and hit next and let's call this you know and then let's call this in it's called inventory management that can be called anything there now for your package name it might be comm dots example by default and that's fine so if you have already have a website and your website is you know Daniel Malone comm you just put it backward so you put you know comm Daniel Malone if you don't know what to put there comm that example is always safe that can always be changed later that can always be changed later that can also be changed later so this save location that's probably gonna be inside of some folder this is just where all your files are gonna be saved you don't really need to mess with that so make sure the language is Kotlin because this series is all going to be in Kotlin this inventory management half or yellow and products and you know kind of track things is all gonna be in Colin minimum API that's fine 21 is fine that should be checked by default and with all these settings filled out let's go ahead and hit finish and this should open up Android studio and we'll actually see the project and again there's a bunch of light.this I'm using the light theme so if you're using the dark theme it may look all dark but it's still gonna look similar to this so I'm gonna go ahead and close this pop-up it immediately you'll see some stuff running it says you know scanning indexing indexing resources so let's just go ahead and wait and this may take a couple of minutes depending upon how fast your computer is but eventually you should kind of see this screen here now one of the things with Android studio that's kind of cool is it's a bunch of panes so say I want to make that smaller I could kind of make that smaller I can make that bigger there in the middle you can close pane so on the bottom I'm gonna go ahead and see how this build kind of paint is open we go to dues terminal you can kind of play around with stuff but I'm going to go ahead and just close build on the bottom just so we have some more space here and you'll notice this kind of looks like an Android app you have your you know kind of toolbar there you've got some text in the middle it's kind of basic and you have your floating action button so if you've never programmed before this mailer is kind of daunting you know there's all these buttons and all these stuff you can fill out and you've got all these options and pains and stuff but in this series I'll try to keep it to the basics just so if you don't have much experience programming you can follow along or if you program maybe for the web or for iOS for a different platform hopefully you can follow along so the first thing we want to do is let's go ahead and try to run this in an emulator so this this and by the way if you don't see this screen here go ahead and go to the left and open up project pane and it should be Android by default and then on the left here we kind of have a series of folders you can open up and close so we can open up an app we can open up Java we can open up res but your layout file is going to be inside of here so say these two tabs were closed so you don't see anything there maybe you see this go ahead and open up app res or resources of a layout and then go ahead and open up double click content main and this is the file here this is our layout file and just as easily say we want to create another screen we can just go ahead and go into here and you know create a new screen but we'll get to that in the later in a later video so the first thing you want to do let's go ahead and try to run this on an Android device or an emulator so if you have a physical device you can plug it into your MacBook Pro or Windows or Linux or Mac Chromebook laptop or desktop your on your physical device you're gonna need to enable developer mode so on your device open up settings and click on build the build number seven times I think but in this case let's go ahead open up on an emulator so at the top left here you'll see a AVD manager you can also get to it through tools I think also tools AVD manager go ahead and open that up and right now I already have a device here but you won't see that so what you'll need to do is to create a virtual device or an emulator go ahead and click create a virtual device on the bottom and this is kind of like for development just so just so we can kind of play around with it on the computer so you don't have to use a physical device you can select a different device so I'm gonna select let's just do a do a pixel to pixel 3xl why not yes I'll select a phone pixel 3xl we can go ahead and go to neck and we can kind of select what what what version of Android we want our device to run or what we want our emulator to run so we can select queue that's fineries like the latest go ahead hit next and go ahead and hit finish there if you want you can name it to something else you know like a Daniel's first emulator there so I'm gonna go ahead and it can't soul and actually already have an emulator there so once you hit finished there it'll actually it may take a little bit oh and also one thing to note when you do go into if you don't have these downloaded already it may take a little bit to download so it may take it may be a little bit slow but you may have to download one of those but uh and it may take 20 minutes but I already have an emulator set up here so once you click finish you'll see your emulator there I want to go ahead and close that now to actually run this we need to hit the let's go ahead and hit the green play button right there so you'll see app you'll see your device name there if you have different devices or say you plugged in a device you can select it there but I'm gonna go ahead and just select the emulator we just created or the emulator you just created and whatever you named it you know Daniels emulator and I'm gonna hit the Run button now this may take a couple of minutes but if you notice from the bottom right it says two processes running that makes it that basically beans into the studio's doing something so just wait and you see it's opening an emulator up so just be patient here and boom here we go so here's our emulator so you notice it looks kind of like a phone and it's you know it's basically what a phone is it's just running on your computer here so if you don't if you just want to plug in your device through a USB cable you can do that Chuck I said go to settings on your phone tap look for the build number in settings and tap it seven times you need to enable developer mode on your phone or it's easier to just use an emulator like I'm doing right here so just be patient this can take oh if it's your first time it could take five minutes you know it's gonna be a little bit slow so here we are so we have our emulator you can notice you know you can swipe up here are some apps played with you have Gmail you've got you know photos app it's just basically like a phone so just you know be patient keep waiting waiting waiting and it says waiting for target device to come online this may take a minute or two but once once it finishes this app that we're building right here will show up as an app in our emulator so hopefully it's doing something but yeah I mean it's just like any other you know it's just like your regular phone you can you know open up dry we can open up messages now messages is not gonna work but yeah map should work you know you can open up you can't you can't make calls but you can use YouTube you can open up Chrome and browse the web you can do you know just and here so here we are so finally just open up our app so if you notice if I go back to into the studio here and notice we have hello world in the center and if I go to my emulator you'll notice hey you know here's our app now it doesn't do a whole lot like my default I can click on the floating action button and it says that's but it says our hello world there it has our inventory management title there in the toolbar we can do that so for the next you know 20 30 parts of this series you know we'll be working on this inventory management app and here it is so yes here it is oh so if you're on a physical device go ahead and open up settings so I can go to settings on your physical device well on your phone you can go to like system I think it is in advanced I think it's somewhere under like I don't think it's this to update but some are you know tap the bill number 7 times its I don't know exactly where it is where is it Oh a bad emulator maybe just yeah there's build number so far to tap this you know tap it again and again now it says four steps away from being a developer so tap on that seven times and then if you go back you should see somewhere in here you should see an option for developer options so I don't need to do that because I'm already on an emulator the simulator will work just fine and we'll be using this for the rest of this series so for the rest of this this video I'm gonna make it kind of short trying to make kind of short let's go ahead and change something so with content main open up here there are two modes there's text mode which is kind of like your code you can modify and we'll get into that later but to keep things simple go to design mode and let's just go ahead and click on the hello world you'll notice on the left side you'll have this attributes you can kind of open and close I'm gonna open up attributes and let's change it to something else so click on you know with it selected there we can change the text let's change text to add let's do you know add product below hit enter and instantly you'll notice add a product below shows up there so there's a lot we can do here we can do you know let's make it bigger so let's look for text size let's make that 24 now it's nice and big maybe what we want to change the color so let's go ahead and click on the color there let's make it let's make it green why not make it make it match the toolbar so I'm gonna go ahead and just close that and if you'll notice if we you know with our emulator selected there again if we go oops if we go ahead and hit that button again and that's going to change wait a minute or two but just wait for the emulator and it's gonna may take a minute then you should see it up on the emulator so here's your emulator so this is an app we can submit to the Google Play Store we can literally go open up into the studio we can go to build we can you know build the apk or however you run we're however you do it now these it's like under yeah we can build our bundle there and we could submit this app to Google Play now right now it doesn't do much but you know that's how you this is basically how you build an app and you've seen that you can you know put it on an emulator so I want to do I'm trying to think I'll try to keep this short but out but in the next couple of parts we'll continue on this so just one more thing what I want to do is I want to show you how to add something to our layout there so say we really don't want that I'm gonna go ahead and select it I'm gonna hit the Delete icon to get rid of that and on the left side you'll notice we have a palettes will have a palette pane we can open and close so I'm gonna go ahead and open it up and they're different stuff we can add to our layout so I'm gonna go to common and here's a button so I'm just gonna click and drag the button and I'm gonna put it I'm just gonna put it right there for now and we can basically lay this out anywhere we want to put our button so say we want to add a button to add a products everyone into the top left it's not quite enough to put it there we're using constraint layout something we'll get to in a future video but for now just place it somewhere and you'll notice you'll have these little circle icons on the left right top and bottom that's because it's gonna straight layout it's what you need to do is click so see the little eyeglass circle put your mouse over there click hold down drag and then let go and it kind of puts it near the top left so now click drag let go and now it puts it there so if you want to put it in the middle top we can do the same thing to the right side so click drag and let go and it puts it in the middle say we want to put it exactly in the middle of the screen we could constrain it to the bottom as well so see on the bottom one click drag and let go now it's in the center and this is kind of what's going on behind the scenes is kind of complex but for now you know we'll get to that maybe in the next part maybe in part three or four but for now you have our button there so if we go back to our attributes let's change it to something else so let's so look for text now let's change it from button to add a product or add two to inventory so this is where we'll add our inventory and let's go ahead and see thing do background tents let's change that can we change it something else let's change it to a nice blue color there we go there's our button actually the notes let's make it green why not just make it green let's go ahead with that dark green button now it's kind of hard to read the tag so let's make the text white let's click on there again and let's do text color let's make it if you don't see a good color there you can only just click and drag you know let's make it you know red let's make it it's like it white did it make it white well let's change that to 100 that's the Alpha we'll get into that later but if you just have these same values here and also you know it's like so that's not up stands for red green and blue so say I want less red it goes from 0 to 255 some of you want less red so we won't say we want only 100 red it'll change it to a little you know it changes the color but we want full red full green and full blue which makes it you know 2 5 5 for everything and we want our transparency to be a hundred percent or you type in that but that's now that should make it white and again you can just check any color you want you know you can make it purple you can make it you know whatever color so there we go so one last thing I'm going to go ahead and click the Run button go back to the emulator and wait a couple of minutes or a couple of seconds because I'm kind of on a fast Mac here and boom there it is so there's our inventory management app so again we have like 20 or three more parts to go but if you click Add to inventory it doesn't do anything right now but we have our button in the middle of the screen there's a lot we can do so maybe in the next part must be click on it we want to add we want it to go to a new screen where we can type out hey I want to add my you know I'm looking at my Olivia or maybe I want to add a couch and a sofa and a chair and maybe a Dell laptop that sitting next to me maybe I wanted to add an ipod or my pixel phone we can click on that and then just type in you know pixel I bought it and you know 2004 whatever my first iPod may be and so then maybe we'll we'll have a list of products that you have in your living room or your a couch or whatever maybe your office and this is kind of an example app just so you can kind of get a feel for how to add built in turn apps so I'm trying to think of what else we can do it's getting kind of long hopefully you figure it out how to open up an to the studio open up content main drag in a button to your back to your screen we talked a little bit about going from text to design mode we'll get into text mode later so don't worry about that but we learned how to run it in the emulator we went to tools abd manager we created a new device or you can always plug in your phone with a USB cable go and you need to enable developer mode on your device but since we're using a emulator here we don't need to do that we just create it there there's our emulator go ahead and select it there hit the Run button that's right there it'll run the app open up your emulator and boom there's the app one word of caution just be patient if you're on a slower machine this you know when you hit the button there for the first time it can take five minutes you know androids loading up it's loading all your resources it's loading the operating system it can just take five minutes so if you're on a slower machine just be patient now one last word I'm on a Mac but you can do this the exact same thing on Windows it should look pretty identical some of the stuff is maybe like I'd say 98% of Android studio is the same for Mac Windows or Linux there's some small differences keyboard shortcuts are a little bit different so hopefully you learned something and I really want to see when the next part so stay tuned if you want to subscribe you can subscribe to next parts and I guess with that hopefully you learn something hopefully this wasn't a waste of your time I'm trying to keep it paced well so you know I'm not too basic but you know not too advanced you know hopefully you can follow along and I'll see you in part two so stay tuned
Info
Channel: DJ Malone
Views: 798,123
Rating: undefined out of 5
Keywords: tutorial, android, studio, kotlin
Id: Ob4vSoWud9k
Channel Id: undefined
Length: 19min 2sec (1142 seconds)
Published: Fri Feb 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.