Before we start, please read the Android developer blog post on getting ready for Nexus 7. It's a good start to our discussion. Getting Your App Ready for Jelly Bean and Nexus 7.
Now that you're up to date, you know the new tablet is one of the first to sport the tvdpi screen density. If your app isn't ready for it, you might be in trouble. So, what do we need to do to set up an emulator for this density?
- Open AVD Manager and create a new virtual device named "nexus_7".
- Unless you have set up the hardware accelerated emulator set the "Target:" to Android 2.3.3. This will run fast enough to test your apps for the display. Note that you're not creating a real Nexus 7 emulator but this will be sufficient to test your app for the display! If you really want to test Jelly Bean, you'll want to set up the hardware acceleration for your emulator. Hopefully we'll discuss that in another blog post.
- Set up a sufficient SD card size.
- Under "Skin:" choose resolution and specify the Nexus 7 resolution of 720 x 1280. Note that we put 720 first because we want the emulator to start up in portrait mode just like the device.
- Under "Hardware:", choose an Abstracted LCD density of 213. This is tvdpi!
Now you're set! When you start the emulator you will probably want to set the Launch Options to scale the display to 8 inches, especially if you're on a laptop screen. Now you should be able to test your layouts for the new Nexus 7. Have fun.