简体   繁体   中英

How do I configure the Android 4.0+ emulator to behave as a tablet?

I have been developing Android application for Android 3.x and now I want to support Android 4.0.

So I created a new AVD from AVD Manager with a target of Android 4.0.3 and API Level 15, resolution 1280 x 800.

The emulator runs normally, but its UI is in phone mode, not tablet, and my app (for tablets) UI is collapsed. ie, notification bar sets top, not bottom.

How do I make the emulator recognize that it should run as a tablet?

Use your tablet skin. For example WXGA (default skin for 3.x). You can change skin via AVD manager. Or by command line. For example to run device name :

[me@pc]# emulator @name -skin WXGA

The skin must be supported. You can find skins in [SDK]/platforms/<platform-name>/skins .

Android Emulator detects automatically in which mode to run. As I see, the main criteria is resolution and, maybe, screen density.

That's how I've created Asus Transformer emulator:

  • AVD Manager -> New... -> Skin, select "Resolution" -> 1280x800

  • Hardware Properties: Abstracted LCD Density set to 160 (actually, Transofrmer's one is 149).

After I run it, I've got Tablet UI!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM