Next lesson playing in 5 seconds

Cancel
  • Overview
  • Transcript

1.2 Setting Up Emulators and Hello World

Hey everyone. This is Paul with Tuts Plus, and you're watching the Developing for Android Wear course. In this lesson we're going to create our HelloWorld project as well as create our emulators just so we can kind of get started along with this course. So, I'm gonna assume you already have Android Studio installed, so we're gonna go ahead and go to start a new Android Studio project. And we're gonna go ahead and just call this HelloWorld. You can use whichever company domain and project location you wanna use. We'll go ahead and click next, we'll make sure that phone and tablet is selected as well as wear. For the minimum STK for phone and tablet we're gonna go with 18. So you can support before this, but the only phones that are able to work with an Android Wear device have to be at least API 18 or higher. As for Android Wear, API 20 is the lowest that was ever installed with Android Wear devices. So we'll just go with that as our minimum as well. So we'll go ahead and click Next. Let's go ahead and say no activity for the mobile side cuz we're gonna work strictly with at this point. So we'll go ahead and click Next. And then we'll go with a Blank Wear Activity for the actual Wear portion of this. So we'll click Next, we'll accept the defaults, and we'll go ahead and click Finish. We'll let that build out. And at this point we have our HelloWorld application already set up by Android Studio. And in a later lesson we'll go ahead and go over the actual structure of the ware application for HelloWorld, just so you can see what exactly what everything does. So the first thing we're gonna need to do is go into the STK manager. And let's just make sure that under API 22, which is Android 511, we have the STK platform, and the Android wear Intel x86 system image if you're running in x86 processor, or anything that is capable of running that. It just happens to be a lot faster as an emulator running on a computer. Again if you have a hardware device we will go over how to actually install one to your own physical devices because that is a fair bit better than actually running on an emulator, but for now we'll just go ahead and go with this. So what we're gonna do then is we're gonna go to the AVD manager, which is where we actually create our emulator. We'll go to create a virtual device. We're going to go down to Wear, and then we have round and square devices. So we'll start by creating an Android wear square device, with a 280x280 resolution, this is your typical LG G Watch, and I also want to say the Samsung Gear Life, so go ahead and click next, we're gonna go with the Lollipop 22 stk. If you don't have this, it'll give you this option where you can download it. So you can go ahead and do that as well. But we're gonna go with this x86 version simply because it will run on, at least my machine fairly well. And more than likely yours as well. So we'll click Next. We'll just accept the default for it. We'll click Finish. And then we'll click on the Run button. And we'll let this boot up. And while we're waiting for this, let's go ahead and create another one, for a round device. So we'll click on Create a New Virtual Device, we'll go down to Wear, and let's just go ahead and go with a 23 by 23 Android Wear Round device. We'll click Next. We'll use the same API level. Click Next again. We'll accept the defaults. And we will let this run as well. So, we should be all set now. So, we can open that. Let's go ahead and cancel the tutorial there. And let's go ahead and switch this module here at the top form mobile to wear. And we'll click on the Run button. We'll let this build. We'll go ahead and click on our square device, we'll hit OK, and we'll come back to that emulator. And as you see, we now have our HelloWorld application running. Now, if our round device is running, which it is still starting up, that's okay. Now, it's all done. So let's go ahead and swipe up on this card, and cancel their tutorial. And we'll rerun this application and we'll put this onto our round device. So, we'll hit OK. We'll come back to the round device and this should say HelloRoundWorld, compared to the square world. And there we go. So we now have our emulator set up, so we can start doing some development, so in the next lesson, I'm gonna go over how you can actually set up a physical device to work with your computer so you can install your applications on your own hardware. So I will see you then.

Back to the top