so when it comes to actually, testing your application during development
one of the things you're definitely gonna wanna have is a virtual device or an emulator.
and this allows you to actually test your application here in the desktop environment instead of actually having to go out to a real device.
now it's important to know that, nothing can really replace testing your application on a real device,
because the emulator is actually pretty slow, you know so if you have things like animation and you really wanna get a feel for how your application behaves,
the emulator can do a pretty good job but nothing will replace actually going out to a real device. but that can take time.
so you defiantly gonna wanna have an emulator here.so from the SDK manager, we will click to virtual device,
and now we're gonna create a new virtual device, i'm gonna click new, and we wanna give this a name,
so now since we're targeting gingerbread here. i'm gonna call it Gingerbread,
and now we wanna create this virtual device at a specific resolution, we're gonna set it at WVGA resolution. which is 800 by 480.
so we're gonna put that in here just so that we know what size this actual emulator runs at.
so now under target we're gonna choose the API level that we wanna target on this emulator.
now again i've only installed Gingerbread so obviously i'm gonna choose that.
now for SDK card and again the emulator is able to emulate most features of a phone including the SD card.
so now it's asking us for a size for how big we want that SD card to be. i'm just gonna put in 10000 here, which is gonna be a 10 GB card.
so the next feature here is snapshot, and this is really important. so with snapshot enabled
we can, actually when we stop our virtual device from running, when we re-lunch it again we can re-lunch from a snapshot.
which is incredibly faster than having to have it boot up from the beginning. so we definitely want to enable that here.
now as far as a skin, basically it's asking us for the resolution. we could see we have a bunch of different options to choose from.
now when it comes to testing your application on multiple resolutions and screen sizes, you gonna wanna come in here and
create emulators for a bunch of different sizes so you can test against those, but for now we gonna leave it at the default here.
and now we have some additional properties that we can set, so just the density, ram size, we're gonna leave the rest of things here at the default
and actually this is telling us we have some invalid characters, so we actually need to put in an underscore here, we can't have space.
ok so with that done, i'm gonna click create AVD and it's gonna go ahead and create that virtual device.
now depending on your system, this could take a little while so we'll just wait for it to go ahead and create that emulator.
ok so when it's finished creating the virtual device, you should get this massage, which basically just means everything's ok. so i'm gonna click ok.
and now we can see it's listed here in our virtual devices's panel, so now the first thing we wanna do is to make sure everything running fine.
we're gonna go ahead and start it. so i'm just gonna select it and then choose start.
ok so now it's presenting us with some options about how we want to run the emulator, so one of the things we can do,
if the resolution of the emulator is ganna be too big for your desktop, which it is for mine,
800 height is actually gonna be too big for me to actually show here, we can scale it down by any amount that we want, so i'm gonna put in a screen size in inches of 7.
and it actually gonna scale it down to about 72 percent of it's real size. and this is just so that we can work with it easier.
and the next option is "wipe user data". so let's say we've used this particular emulator a bunch of times we have a bunch of apps installed,
and then we've messed with the settings, if we choose "wipe user data", it's basically gonna set it back to a factory reset, and if we want to do that!
now these next two, "lunch from snapshot" and "save to snapshot", again we wanna leave those checked so that in time that we wanna lunch it, it's actually gonna be much faster to start-up.
so when we click lunch here, and now we can see the emulator starting-up.
now remember that we didn't have a previous snapshot to lunch from, we're gonna have to wait here to android to actually boot-up.
ok so now everything has booted-up and if you've used an android phone before, this is gonna look really familiar to you.
and we have our desktop here or our home-screen, and our widget, i can click here on the app-luncher,
we can look on all the different applications. of course we'll be putting a lot of applications in here over this coarse,
but this works for the most part exactly like an android phone lookslike. it's pretty much like a full emulator here.
so what i'm gonna do now is that i'm gonna close this. and we'll wait for this to close.
now remember what it's doing here is actually saving a snapshot as well. so when we close this it saving out the snapshot, so next time when we start it, it's gonna be faster.
so now let's start it again. we'll click start and we wanna make sure "lunch from snapshot" is still selected.
we'll click lunch and you could see how incredibly faster that is!
we don't have to wait for android to start-up and go through all those initialization stuff,boom out right into the emulator.
so that's the basics of creating a virtual device, now remember you gonna wanna come through and create
you know, whole slue of them, they represent deferent resolution, screen sizes and also different SDK versions, when you doing real world android development.
AndroidApp.blog.ir