It’s becoming increasingly important to be able to test your website – be it a standard version, responsive or a mobile specific version – on multiple devices. All of the major smartphone makers use Webkit (the basis of Chrome & Safari), except, of course, Microsoft.
Quite often websites will display the same in Google Chrome as they do on Android. However, sometimes they do not. Also, sometimes interactivity needs to be tested to see just how well it works on a touchscreen. Using the Android SDK helps you do that without having to have a huge range of devices with multiple versions of the Android OS at your disposal.
Step 1: Downloading and Installing the Android SDK
Personally I put the unzipped folder into my /Applications/Utilities directory.
Step 2: Preparing the Emulator
You’re going to notice there aren’t any applications you can just double click on and have them work. For non-Windows users, you’re going to be working inside the tools directory as well.
Windows: double-click on the SDK Manager.exe in the main Android SDK directory.
Mac or Linux: You will need to use the Terminal to start the emulator. Then you need to type ./android sdk from within the tools directory.
Step 3: Creating an “Android Virtual Device” (AVD)
– In the window, on the top right there’s a button for New… Click that
– Give it a name, and choose a Target – this is the version of android you want to use. I chose 2.3.3 as it’s very common right now. 4.0.3 is also becoming popular, so if you’re reading this a few months after publishing, I’d go with 4.0.3. (I currently use both.) You can also check for the current Android version marketshare.
– Set the resolution. I chose WVGA800
– IMPORTANT: Under Hardware, click New… and add Keyboard support. Then set the Value to Yes. Otherwise typing will be a pain 🙂 This will allow you use your computer keyboard with the Android SDK emulator.
Step 4: Start the Android Emulator
With the Android Virtual Device Manager still open, select the device and click Start… leave the settings on the next window as their default settings, then click Launch.
Step 5: Login and Launch the Default Android Browser
You will need to click and drag the lock icon to the right to login. After you do that, click the globe icon to launch the web browser.
Chances are you’ll quickly want to rotate the screen into landscape view, and there’s not a single UI element to help you do this (unlike the iOS SDK.) There’s several keyboard commands which may help you, including rotating the screen. They’re here http://developer.android.com/tools/help/emulator.html#controlling
Switch to previous layout orientation (for example, portrait, landscape)
Switch to next layout orientation (for example, portrait, landscape)