Domanda

I've created AVD which emulates 7" tablet but it has status bar on bottom like on this image. I want to set phone layout like on this image (except buttons on the right side) - how to do it? I've written own skin based on generic skins (QVGA, WSVGA and WXGA800-7in), here is code:

parts {
    portrait {
        background {
            image   background_port.png
        }
    }
    landscape {
        background {
            image   background_land.png
        }
    }

    device {
        display {
            width   600
            height  1024
            x       0
            y       0
        }
    }

}

layouts {

    portrait {
        width     654
        height    1076
        color     0xe0e0e0
        event     EV_SW:0:1


        part1 {
            name    portrait
            x       0
            y       0
        }

        part2 {
            name    landscape
            x       1400
            y       0
        }

        part3 {
            name      device
            x         26
            y         29
        }
    }

    landscape {
        width     1076
        height    654
        color     0xe0e0e0
        event     EV_SW:0:0

        dpad-rotation 3

        part1 {
            name    portrait
            x       1400
            y       0
        }

        part2 {
            name    landscape
            x       0
            y       0
        }

        part3 {
            name    device
            x       29
            y       1050
            rotation  3
        }
    }

}

keyboard {
    charmap qwerty2
}

network {
    speed  full
    delay  none
}

and config file:

avd.ini.encoding=ISO-8859-1
hw.lcd.density=160
hw.dPad=no
sdcard.size=50M
hw.cpu.arch=arm
hw.device.hash=-612842536
disk.dataPartition.size=200M
skin.dynamic=no
skin.path=platforms\android-14\skins\SVGA_kp
hw.keyboard.lid=no
hw.keyboard=no
hw.cpu.model=cortex-a8
hw.ramSize=512
tag.id=default
tag.display=Default
hw.device.manufacturer=User
hw.sdCard=yes
hw.mainKeys=yes
hw.accelerometer=yes
skin.name=SVGA_kp
abi.type=armeabi-v7a
hw.trackBall=no
hw.device.name=IdeaTab A1000
hw.sensors.proximity=yes
hw.battery=yes
image.sysdir.1=system-images\android-14\armeabi-v7a\
hw.audioInput=yes
hw.sensors.orientation=no
hw.camera.front=none
hw.gps=yes
snapshot.present=true
vm.heapSize=32

Emulator starts in portrait mode but OS has bottom status bar like in Honeycomb.

È stato utile?

Soluzione

I've found solution. I think emulator calculates display size based on AVD resolution and density. Before, I was changing hw.lcd.density in AVD's config.ini but it didn't work. In skin folder, I've found hardware.ini file which contains skin specified parameters, I think these parameters overwrite settings from AVD's config.ini.

Solution

If you have set high screen resolution for AVD (i.e. 800x1280), choose skin which has high display density. Alternatively, in [SDK location]/platforms/android-[version]/skins/[skin-name]/hardware.ini set hw.lcd.density parameter to higher value (i.e. 300). Choose suitable skin for your AVD and emulator should load Android in phone mode.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top