Quantcast

Start with 7 free days of training.

Gain instant access to our entire IT training library, free for your first week.
Train anytime on your desktop, tablet, or mobile devices.

This Java video training course with Ben Finkel helps you work to apply what you learned in the Java Essentials course as you develop an Android app with Java....
This Java video training course with Ben Finkel helps you work to apply what you learned in the Java Essentials course as you develop an Android app with Java. Recommended Experience
  • Basic familiarity with Windows, Linux, or Macintosh
Recommended Equipment
  • A desktop environment with an internet connection
Related Job Functions
  • Web developer
  • Software engineer
  • Programmer/analyst
Ben Finkel has been a CBT Nuggets trainer since 2014. His areas of expertise and certifications include Google Developer Expert, Google Certified Trainer, Microsoft ASP.NET (WebForms and MVC), Data Analysis and Design, Relational Database Architecture, MS SQL Server, Microsoft C#.NET, Javascript, jQuery, Microsoft Visual Basic .NET & 6.0, .NET Reporting Services, MS Access, and Python.

Note: Supplemental files and/or virtual labs are not available until the entire course is completed.
 show less
1. Installing Android Tools (9 min)
2. Your First Android App (16 min)
3. Deploying an App Locally (8 min)
4. XML Primer (14 min)
5. Introducing Activities (12 min)

10 additional videos are in-progress.

Installing Android Tools

00:00:00

Installing Android Tools. Hey, everyone, Ben Finkle, here. And in this Nugget, we're going to quickly walk through the two utilities that you need, the Java JDK and the Android Studio, in order to successfully develop Android applications. Once I've done that, I will also very quickly show you how to use our virtual lab environment and how we will be deploying applications in that virtual lab environment, as opposed to on your local client desktop.

00:00:23

We'll start off this Nugget inside of the virtual lab environment, although, as part of a virtual lab, you will not be installing these tools. They will be installed for you in every instance of the virtual lab that you access. If you want practice installing tools and setting it up on your own environment, I really encourage you to do that.

00:00:38

I just want to walk through the process very quickly and show you how easy it is to get up and going with the tools for Android development. Once we've done that, I will show you a little bit that you can practice in the virtual lab with actually executing and running an Android app.

00:00:51

And I'll show you how the virtual labs are going to be organized for this series. So just to begin with, we are going to download two products. You need two tools in order to develop with Android, and that is the Java SDK-- you need a Java development kit in runtime environment in order to develop Android apps-- and the Android Studio.

00:01:07

You can find the Java SDK here at oracle.com. Just run a web search for Java SDK. It will bring up this page. And just to show you here, we are going to download JDK 8. You can use 7 as well, either will work fine. I believe Android is also compatible with 6.

00:01:24

But unless you have a really good reason to use Java 6, I would not recommend it. It's old, it's not been updated in a while, and it's less secure than the newer versions of Java. So once you've done that, you're going to come here, accept the license agreement for the SDK, select the appropriate link to download the SDK for your environment.

00:01:41

If any of this is unfamiliar to you, you should be relatively familiar and comfortable with this. Check out my Java Essentials Nugget series. You really need to understand Java and how to work with it pretty well in order to develop Android apps. The second piece of software that we're going to need here is Android Studio.

00:01:55

And that can be found at developer.android.com. Now in the past, you had to use NetBeans or Eclipse or IntelliJ with some plug-ins in order to develop with Android. But a few years ago, Google started releasing this really cool software suite called Android Studio.

00:02:09

I believe it's based on IntelliJ. And this is really nice. I really recommend you do this. You can still use those third-party tools and those third-party plug-ins, but they don't always work right. They're not always up-to-date. You know, there can be different problems using those.

00:02:22

This is the official tool that you should be using. So I really recommend that you come here and you download studio. The current version is 2.3. Having downloaded both of those things, I already having here in my environment, they're very easy to install.

00:02:34

You just walk through the wizards to install those. I'll start with the Java JDK. And I'm just going to walk through the wizard and select all of the defaults. You're welcome to update or change anything that you want. But you do want to make sure that you install the entire thing and that it installs successfully before you install Android Studio.

00:02:52

Android Studio is going to be looking for the Java SDK on your system so that it can hook up to it. All right. And once that's complete, you can go ahead and launch the Android Studio installer as well. And again, this is just a wizard installer. It's going to be very simple and straightforward to install.

00:03:08

And one thing I want to point out here, when you choose the components, you want to ensure that you install the Android SDK-- those are the software development kit for Android itself, that's obviously very important. Without that Android SDK, you're not going to have access to the features and functions that you need to program on Android-- and also the enjoyed virtual device.

00:03:28

Now this is less important in our installation, because we are in the virtual lab environment. But if you are installing locally, that Android virtual device is where you're going to execute your app for testing. And that's covered more in our Nugget on the Android Virtual Device.

00:03:40

Other than that, you're just going to select the defaults, choose Install, and let it run its install. Now depending on when you download the software, there may be additional things that you have to download and install the first time you start it. I believe that 2.3 just came out, and is fully up-to-date.

00:03:57

But sometimes the SDK gets updated and the installer doesn't have that new SDK built in. And you'll need to download and install that SDK as well. But it's all wizard-based, Google hands all of it for you, you just need to execute the software and run it.

00:04:09

So once the installer has completed, you now have an environment that is ready to develop Android apps. And I'm going to show you very quickly here how that works. I want to show you inside of the virtual lab. If you fire up the virtual lab for this Nugget, just by clicking the link on the right-hand side of the web page here, you're going to get-- well, let me shrink this up a little bit so you can see what I'm looking at-- you're going to get this machine's tab on the right-hand side here.

00:04:31

That's going to show you two virtual machines. For this entire Nugget series, we are going to have two virtual machines in every lab. The first virtual machine is going to be a Windows 10 client with the tools installed that you just saw me set up. That's what I'm looking at right here.

00:04:44

Below that, you see there's an Android 4.4 virtual machine. And this is, yeah, this is a virtual Android device running in the virtual lab. This is where we're going to execute our applications. It's running a very clean, very plain version of Android 4.4, obviously.

00:04:58

I believe that's KitKat. And I've chosen 4.4 for two reasons. One, it's good to have your applications target a slightly older version of Android so that they are widely supported on a lot of different devices that are out there in the wild. And two, Android 4.4 is really the best version of Android that I could get up and working inside of our virtual lab environment.

00:05:17

So it's good that we have this nice mixture here. So when we go to run our applications, we are going to deploy them onto the Android 4.4 instance down here. I'll show you exactly how that works. To begin with though, we simply want to launch Android Studio.

00:05:31

I've got it down here in the Quick Launch bar. Of course, you can find it under the Start menu, if you'd like. The first time you launch Android Studio, you'll get this nice little Quick Launch wizard here with a couple of different options that you can choose.

00:05:44

We're simply going to choose to Start a New Android Studio Project and let it walk through the wizard and build us a fake blank application. I don't want you to worry about too much of these details. We're going to cover them in a later Nugget. We'll call it My First App, as an application name, just so you can see that come up on the screen here, click Next.

00:06:03

We will leave the phone and tablet checked and the minimum SDK Android 4.03. Remember we're going to run it in Android 4.4, so if you want to choose a newer version you can, but if you choose a newer version than 4.4, it may not work right on our operating system.

00:06:16

So I'm just going to leave it by default, click Next. And I will choose Empty Activity to create an empty activity for us, click Next. And I'll leave the defaults, MainActivity and activity_main. Again, don't worry about any of that. I'll click Finish, let Android Studio build my application, and I'll show you how we can deploy an app onto our second virtual machine.

00:06:36

When it finishes building that project and launches, you'll get the tip of the day here. I'm going uncheck that and say Close. I don't want my tips of the day showing up each time. And just to walk you through the Android Studio lab very quickly, you've got, of course, your Menu bars across the top.

00:06:49

On the left-hand side here, you may or may not see the Project window already flown out for you. You click this button right here, it says one project, and that'll fly out the Project Navigator for you. And here, underneath the app folder, there is a java folder.

00:07:02

That's where your Java code is going to go. And there's a res folder where your layouts and your information that lays out your actual screens, your activities, is going to go. If you want to look at any of that information, you can simply double-click it, and it shows up on the right-hand side.

00:07:15

So here's my MainActivity.java. You can see my main activity class is defined here. And if I go to res, layout, activity_main.xml, and I double-click that, well, I get a little graphical user interface of what my application is going to look like. And I'm just going to shrink up some things here, so that we get a little better view of it.

00:07:34

And you can see here that all it's going to do is say, "Hello World" if I select that. I've got a Text box right in the middle of my panel that says "Hello World." That's my entire application. How do we see this run in Android? Well, if you click the green Run button up here, we get this dialog that says Select Deployment Target.

00:07:53

And you'll notice there is a Microsoft Virtual Machine running Android 4.4. I Highlight that, I click OK, and it's going to build. You see down here, Gradle Build Running, it's going to build and deploy my application on that machine. Now where is that machine?

00:08:06

Yeah, that machine is running right next door in the virtual lab environment. So once that's completed, I come down here to my virtual machine, and check it out. My application is now running down here inside of Android. And this is just an Android interface that you're used to.

00:08:21

If I click the little button here to see, and I see yes, there's My First App running in there. I can go Home. And I can use different applications if I want in the Android interface. But it's always there running in the background until I close it. And that's it for getting an Android application up and running on the virtual lab environment.

00:08:39

Like I said, in another Nugget on Android Virtual devices, I will show you how you can get your Nugget running on your own local machine. But for now, you can launch this lab and play around with this application. You can even move things around and try out some different stuff if you want.

00:08:53

I could pull the "Hello World," so it's, instead of in the middle of a page, it's way up here. Give it a Run. It's going to rebuild and redeploy the application down onto my Android device. And when I bring that up, I can see now "Hello World" has moved up to the top of the screen.

00:09:07

So it's very easy to test out some different stuff here inside of this nice virtual lab playground. So that concludes this Nugget on installing Android tools. Just to recap, you only need two tools installed on your system in order to successfully develop with Android.

00:09:21

And that is a Java development kit JDK 7 or 8, and the Android Studio, the integrated development environment, IDE that Google supplies for developing Android. Once you've got those things up and running you are set to go. And you can follow along in this Nugget series with building your own awesome Android applications.

Your First Android App

Deploying an App Locally

XML Primer

Introducing Activities

Please help us improve by sharing your feedback on training courses and videos. For customer service questions, please contact our support team. The views expressed in comments reflect those of the author and not of CBT Nuggets. We reserve the right to remove comments that do not adhere to our community standards.

comments powered by Disqus

Training Features


Practice Exams
These practice tests help you review your knowledge and prepare you for exams.

Virtual Lab
Use a virtual environment to reinforce what you are learning and get hands-on experience.

Offline Training
Our iOS and Android mobile apps offer the ability to download videos and train anytime, anywhere offline.

Accountability Coaching
Develop and maintain a study plan with one-to-one assistance from coaches.

Supplemental Files
Files/materials that supplement the video training.

Speed Control
Play videos at a faster or slower pace.

Bookmarks
Included in this course
Pick up where you left off watching a video.

Notes
Included in this course
Jot down information to refer back to at a later time.

Closed Captions
Follow what the trainers are saying with ease.
Ben Finkel
Nugget trainer since 2014