Videos

How to Make and Test and Your First Android App in Android Studio FAST!


Hey guys my name is Frank, I work for DMC, and I like things that go fast. I'll be showing you how to quickly install Android Studio, make your first app, and test it on a real and virtual device. 

First step is to download Android Studio, and while downloading that also download Java JDK. I picked Java Development Kit 8, and since I am running a 64-bit computer, I'll be downloading Windows x64. I’ll click right there. So I'll download that too, and it should download much faster than Android Studio. And once they are both downloaded, click and install the Java Development Kit. So go through the installation procedure for Java, it's important that you install the Java one first. You can close out of this once you're complete. 

Next after installing Java you install the Android Studio, and make sure you have the SDK on your virtual device and the Intel HXM checked off. Agree, Agree, Agree, agree to that all. Agree. Just continue all the way through these guys. Now my computer's super fast, look how fast that went. All right, Next, Finish. Everything should start up and run awesomely. So when I have it all installed and you can start Android Studio, you finish and it will start up. We can start a new Android project, we're going to make My Application, just leave it default, click Next. Leave it there since we're just designing a regular application, we are using a - Blank Activity's fine for us. Click Next, everything in default is okay. Click Finish, and now we’ll be creating the entire development environment for us – the allow access for that too. 

So now we are ready to go. I accept, if you got this message, no JV administration found, go check you have Java, type that into your Command Prompt, or you can just go check the file path. If indeed you have Java here's what you're going to have to do, go to your Control Panel, go to the Advanced Options, Advanced System Settings, Advance there, Settings, Environmental Variables. You're going to create a new one, New System Variable called Java Home, and the variable value is the location of Java so we just check that out right here, that's where Java is, paste that in. Okay, now you should start up Android Studio again, it should work, if not Google around and try to figure it out. 

All right, we started it up, we had some rendering problems, just drag a layout in here to make it work. Let's pick Relative layout, so drag and drop it in and look at that, Hello World. So this app is basically ready to go but let's take a look around and see what else we can change, so if we go up here there's some tabs, like Main Activity to Java that contains all the information, all the logic that's running on the app. This is the explorer over here, you can go check out the layout that we have. Drawable, these are all sorts of icons and pictures and strings and values, so these are all the things that come together to create the app in the final package. 

So I'm going to go back to Activity, and we're going to go from design to the text layout. So where it said Hello World, we're going to make it something more interesting. We're going to say Hello DMC. So right now it's looking for the string called Hello World and displaying that. So we're going to look for the string called Hello DMC, and I don't think it's going to happy because there will be no string called Hello DMC, so we're going to have to make one of those, and make it say Hello DMC. So it can't find it, so we're going to go to our strings and look it's looking for Hello World, we're going to switch that to Hello DMC, and we're going to make that say Hello DMC. So now we go check it back on the design tab, or still in text tab, it says Hello DMC and we're going to make it interesting too, we're going to throw a DMC image in here too. So I just copy and paste it into the Drawable’s folder, and everything's fine, and now I'll go back to the Layout, expand it out so you can see all the drag and droppable options. 

So when you're looking at the design view, you have all these options you can drag and drop in. So I'm going to pick Image view, I'll drag and drop that guy in, so this will let us put a picture in there, and you have to select which picture is displayed so I'll click that guy and tell the source and we just copy and paste it in that DMC picture, so I'll go search for that. It's in the drawables folder, so here we go drawables, scroll down and there's DMC, so hit Okay and look at that. We got a picture and some custom text, and now we have a cool custom app. Let’s go run it. But first let's make sure it's running on a virtual device and by default this is a virtual device. You can change the settings on here if you want to but this guy works fine. 

All right so Okay since this is fine for us and we will run it so just click that little bug there that stands for debug, and it starts up. It will much more of time than this since I have it all sped up on my end, so you run it and you have to swipe up to unlock it, just like any Android device, and if you're impatient like me you'll just click that play button again but it will start up on its own. Still going, okay, and look at that. The app is running, so now we have it on here, but in case it didn't start on your end you probably have a problem with that intel accelerator. Make sure it's installed so this is the intro SDK manager. If it’s not installed, go install it, figure out how to do that. If you're running not an Intel chip you're going to have to figure out something else, so just make a different Android virtual device for yourself that works better. 

And what would be debugging without doing it on actually device so here's my phone, you're going to have to turn on developers options so you have to click the bot phone and Settings, go down to the build number, tap it like five times, it will say build developer options available now. So now we go back to your Settings, you have developer options and you want to check off USB debugging. So that means whenever you plugged your cable in you can connect to your development environment and send applications over to it. 

So I'm going to try that, I turned on Developer mode, enabled USB debugging, I'm plugging it in now. If we try to debug the app, let's see. Actually, first we have to go make sure it runs on the USB device, so we're switching that over, and let's try it. Debug, and you can check all the outputs down here at the window, I’ll make it bigger. So it's running through, it built it, now it's going to send it over to the device and with that we have a problem. USB device not found, you guys can't read that, but it can't find anything. There is no USB connected even though I thought I did. The reason is we don't have the proper drivers, so we're going to have install the Google USB debugging drivers. 

So let's go over to Tools, actually no, it was AVD manager, nope SDK manager, click on that guy. Scroll down to the bottom of this, you'll see there is an option to install Google USB driver, install that. Make sure you check off, that you agree and accept everything they are telling you. Read through everything really quick, because you like fast stuff. Okay, and you can install it. It installs superfast on my computer at least. All right, done. So now if I try to run it, it will run only if my computer has the drivers for the phone, and it doesn't so it won't work again. So what I need to do is install the drivers for my phone, and I have a Motorola phone, so I need to search for Motorola ADB, and I'll show you the reason my computer will not recognize my phone still. If you go to your Device Manager, you'll see that my computer isn't recognizing my phone, there's no ADB interface for it, so I searched Motorola ADB, download it from the Motorola site, and I am going to install it. So my Motorola phone has a driver on the computer and I can talk to it. 

So you go through whatever phone you have and read through everything, accept everything, just go through the installation process for your phone. So search your phone plus ADB on Google and install whatever it is. All right, try it again. Plug my phone in, and it should recognize it now, and actually asks me if I am okay with this computer. So I'll say yeah, I want to enable debugging on this computer, I want it to recognize so hit Okay. So now my phone is connected to the computer, they're both talking, they're both happy. Now let's try debugging again, send this app over to the phone and it will probably work. And here we go. 

I'll just turn my screen on my phone so you can see it start up, and here comes the app. Look at that, the app is on my phone. So this app is now on my phone and on the virtual device, but if I close out of it, you can still start it up again. I'll show you what it looks like, this app we made is just like any other app on your Android device, you can start it up just by swiping through all your apps and finding it. Remember we called it My application, so I'll start it up on the virtual device here, you just bring up the apps you have, and try to find My application. There it is, you start it up and there you go. So now you have your first app set up and your Android Studio ready to go to make any app, so go try stuff out.