I would like to create an AVD of the Samsung Galaxy S II. The sole purpose is to test websites with it's default web browser to see how they look in both portrait and landscape mode.
As it's now the most popular Android smartphone, I'd like to test it with my websites.
I would just like to know the most basic settings so I can get at least a rough idea. I'm using the Andriod SDK with the GUI frontend.
I'm looking for those settings that come up after you click "New" in the Andriod Virtual Device Manager.
For example:
Target:
SD Card:
Skin:
Hardware:
Abstracted LCD Density
Max VM application heap size
Device RAM size
Etc.
I tried Samsung's online remote test lab but I've found that too restrictive (can't seem to use it at Internet hotspots that have certain ports closed), slow to start and I just end up with blank black screens anyway. So, I'd really prefer to just run my own version as an AVD.
The interface to the AVD manager has changed. So there are changes needed to the process. Rather than a single file, there's now both a device definition and a virtual device definition. Unfortunately, the UI doesn't give full control over the contents of either.
These instructions work with the Android SDK Tools revision 21. They make reference to Windows 7 paths. If you're using a different OS, you'll need to figure out where the files live.
Follow the steps from mwalter up to step 6 (to get the appropriate skins). Then do the following:
Within the Android Virtual Device Manager, click on the Device Definitions tab and press "New Device"
Type the name "Samsung Galaxy SII" (the name must be exact for the following files to work. If you change it, be sure to make the equivalent changes to the names in the following files.)
Fill in the screen size, resolution and RAM. We're going to override the contents, so values don't really matter, but correct ones are:
Screen Size: 4.3
Resolution: 480 x 800
RAM: 1024
Density: hdpi
Buttons: Hardware
Hit Create Device, then close the AVD Manager
Open the file C:\Users\[user name]\.android\devices.xml in your favorite XML editor
Replace the <d:device>...</d:device> element having the name "Samsung Galaxy SII" with the following:
<d:device>
<d:name>Samsung Galaxy SII</d:name>
<d:manufacturer>Samsung</d:manufacturer>
<d:meta/>
<d:hardware>
<d:screen>
<d:screen-size>normal</d:screen-size>
<d:diagonal-length>4.30</d:diagonal-length>
<d:pixel-density>hdpi</d:pixel-density>
<d:screen-ratio>long</d:screen-ratio>
<d:dimensions>
<d:x-dimension>480</d:x-dimension>
<d:y-dimension>800</d:y-dimension>
</d:dimensions>
<d:xdpi>216.97</d:xdpi>
<d:ydpi>216.97</d:ydpi>
<d:touch>
<d:multitouch>jazz-hands</d:multitouch>
<d:mechanism>finger</d:mechanism>
<d:screen-type>capacitive</d:screen-type>
</d:touch>
</d:screen>
<d:networking>
Bluetooth
<!--NFC (put this back in if you have an S2 model that supports NFC-->
Wifi
</d:networking>
<d:sensors>
Compass
Accelerometer
GPS
ProximitySensor
LightSensor
Gyroscope
</d:sensors>
<d:mic>true</d:mic>
<d:camera>
<d:location>back</d:location>
<d:autofocus>true</d:autofocus>
<d:flash>true</d:flash>
</d:camera>
<d:keyboard>nokeys</d:keyboard>
<d:nav>nonav</d:nav>
<d:ram unit="GiB">1</d:ram>
<d:buttons>hard</d:buttons>
<d:internal-storage unit="GiB">16</d:internal-storage>
<d:removable-storage unit="GiB">32</d:removable-storage>
<d:cpu>Generic CPU</d:cpu>
<d:gpu>Generic GPU</d:gpu>
<d:abi>
armeabi-v7a
armeabi
</d:abi>
<d:dock/>
<d:power-type>battery</d:power-type>
</d:hardware>
<d:software>
<d:api-level>10-</d:api-level>
<d:live-wallpaper-support>true</d:live-wallpaper-support>
<d:bluetooth-profiles>
HSP
HFP
A2DP
AVRCP
OPP
PBAP
HID
</d:bluetooth-profiles>
<d:gl-version>2.0</d:gl-version>
<d:gl-extensions>
<!-- No clue why the tool is unhappy declaring these, but it is. (Doesn't complain about their presence in the 'official' devices.) Comment them out for now.
GL_OES_rgb8_rgba8
GL_OES_depth24
GL_OES_vertex_half_float
GL_OES_texture_float
GL_OES_texture_half_float
GL_OES_element_index_uint
GL_OES_mapbuffer
GL_OES_fragment_precision_high
GL_OES_compressed_ETC1_RGB8_texture
GL_OES_EGL_image
GL_OES_EGL_image_external
GL_OES_required_internalformat
GL_OES_depth_texture
GL_OES_get_program_binary
GL_OES_packed_depth_stencil
GL_OES_standard_derivatives
GL_OES_vertex_array_object
GL_OES_egl_sync
GL_EXT_multi_draw_arrays
GL_EXT_texture_format_BGRA8888
GL_EXT_discard_framebuffer
GL_EXT_shader_texture_lod
GL_IMG_shader_binary
GL_IMG_texture_compression_pvrtc
GL_IMG_texture_npot
GL_IMG_texture_format_BGRA8888
GL_IMG_read_format
GL_IMG_program_binary
GL_IMG_multisampled_render_to_texture
-->
</d:gl-extensions>
<d:status-bar>true</d:status-bar>
</d:software>
<d:state default="true" name="Portrait">
<d:description>The device in portrait orientation</d:description>
<d:screen-orientation>port</d:screen-orientation>
<d:keyboard-state>keyssoft</d:keyboard-state>
<d:nav-state>nonav</d:nav-state>
</d:state>
<d:state name="Landscape">
<d:description>The device in landscape orientation</d:description>
<d:screen-orientation>land</d:screen-orientation>
<d:keyboard-state>keyssoft</d:keyboard-state>
<d:nav-state>nonav</d:nav-state>
</d:state>
</d:device>
Re-open the AVD Manager and go back to the Device Definitions tab, select the Samsung Galaxy SII device and select Create AVD. Name it as you see fit and hit "ok". (Again, we're going to override this, so don't worry about the settings too much.)
Close the AVD Manager and open the file C:\Users\[user name]\.android\avd\[avd name]\config.ini in your favorite text editor
Replace the contents of the file with the following:
avd.ini.encoding=ISO-8859-1
abi.type=armeabi
hw.accelerometer=yes
hw.audioInput=yes
hw.battery=yes
hw.cpu.arch=arm
hw.device.hash=-1902399403
hw.device.manufacturer=Samsung
hw.device.name=Samsung Galaxy SII
hw.dPad=no
hw.gps=yes
hw.gsmModem=yes
hw.keyboard=no
hw.lcd.density=240
hw.mainKeys=yes
hw.ramSize=1024M
hw.sdCard=yes
hw.sensors.orientation=yes
hw.sensors.proximity=yes
hw.touchScreen=yes
hw.trackBall=no
image.sysdir.1=platforms\android-10\images\
skin.dynamic=yes
skin.name=galaxy_s2
skin.path=platforms\android-10\skins\GALAXY_S2
vm.heapSize=32
disk.dataPartition.size=2G
hw.camera.back=webcam0
sdcard.size=200M
You may want to edit the last 3 entries to change how much storage is available and how/whether the camera is changed. I've found that if I make the disk.dataPartition.size as big as it ought to be (16G), the simulator doesn't start properly. The same for sdcard.size, which can be as big as 32G. The hw.camera.back can be set to "None" or "Emulated" if you prefer. As well, check that the hw.device.hash value is the same as in the original file. If it's different, the file won't work.
Good luck.
Do the following to create the Samsung Galaxy S2 skin:
Download the skin from the Samsung page (follow the link posted by anshumans)
Go to directory [Android-SDK directory]/platforms/android-10/skins
Create a new directory named GALAXY_S2
Extract all files from the downloaded ZIP file to the new directory
Edit the file manifest.ini and change the line api=9 to api=10
Start the AVD and click "New..."
Under Target select "Android 2.3.3 - API Level 10"
Under Skin choose "GALAXY_S2" from the dropdown list
Click "Create AVD"
As you may have noticed the AVD will be based upon the Android API 10 level. So the Galaxy S2 skin won't show up if you choose the target Android API level 16 for example.
Samsung has the S II skin on their developer site here
You can download and add the s2 emulator from Samsung's dev site, http://developer.samsung.com/technical-doc/view.do?v=T000000075&pi=1&ps=10&pb=Y&ct=CT350000&sc=
there is also a detailed instruction on how to use them - http://developer.samsung.com/technical-doc/view.do?v=T000000095
While the top-voted answer is correct, you'll most likely end up having a resolution display problem which will hurt almost any App you'll want to test/develop.
In order to solve that specific issue you also need to change this settings:
hw.lcd.density
which is located in the hardware.ini of your AVD skin. You can find it here:
<ANDROID_SDK_PATH>\sdk\platforms\android-<APIversion>\skins\<YourSkin>\hardware.ini
from 300 to 218.
I'm not a big fan of blind copy-and-paste; also, the top answer references a 2nd which, in turn, references a 3rd; finally, there are some new changes in SDK Tools v24.1.2 which mean that absolutely no file editing is required if you are not testing BlueTooth. Hence, I thought I'd post an updated and consolidated solution. Full credit to anshumans, mwalter, Lloyd and the commenters
Paths use Windows conventions. OS X/Linux users can often just switch backslashes (\) to forward slashes (/), except for install folders. These environment variables may or may not be set on your system:
<ADT_HOME> is the location of AVD Manager.exe (and defaults to C:\Program Files (x86)\Android\android-sdk)
<ANDROID_SDK_HOME> is the location of the .android folder that AVD uses to store device definitions (and defaults to HOMEPATH [and is unrelated to your SDK's location :)])
Samsung skins
Samsung's developer's site contains links to a number of skins including the S2; it also has instructions for installing them using Eclipse with the ADT Plugin, which is unnecessary and superseded by Android Studio. To just get the S2 skin, use the link on the Samsung page and then click on the Zip file with a floppy disk symbol (or just click here).
If you didn't use Samsung's instructions for installing with Eclipse, the procedure is:
Decide which version of Android you are targeting. Note that the S2 was released on API level 9 (Gingerbread) and the skin reflects this. Later releases and updates included API levels 10, 15 and 16. (as per Wikipedia).
Where ?? is the target you selected in step 1 above, extract the contents of the downloaded zip file to a new folder (e.g. Galaxy_S2) under
<ADT_HOME>\platforms\android-??\skins
Edit the extracted manifest.ini, changing the line api=9 to reflect it's current location (e.g. api=15). (This doesn't actually seem to be necessary, but left in until I can confirm.)
Repeat steps 1-3 for each release you wish to test against.
Device Definition
Select the Device Definitions tab on the AVD Manager and then click Create Device... button. On the Create New Device screen,
Accept all defaults except where noted
Name: Samsung Galaxy SII (or whatever)
Screen Size: 4.3 (or 4.5 for I9210 model)
Resolution: 480x800
RAM: 1024 MiB (or 1 GiB)
Density: hdpi
Buttons: Hardware
Click on Create Device
<ANDROID_SDK_HOME>\.android\devices.xml will get updated with your new device definition.
As a general rule, unless you are creating a lot of AVDs based on it, you don't ever have to manually edit entries in devices.xml. Note also that many of edits proposed to match the SII's hardware actually have no net result. If you do wish to edit, first close the AVD Manager (and the Eclipse IDE if applicable).
Find the node for the d:device you just created with <d:name>Samsung Galaxy SII</d:name>
d:manufacturer (optional) change value from User to Samsung
d:networking (optional) delete/comment out NFC (e.g. <!-- NFC -->) unless you want to test against the rare models that included it
d:sensors delete Barometer line
d:internal-storage (optional) change value from 4 to 16 (or 32), but it is ignored anyways when creating the AVD
d:removable-storage no need to add this, as it is ignored
d:abi no need to pare this, as it is ignored
d:bluetooth-profiles replace self-closing tag with
<d:bluetooth-profiles>
HSP
HFP
A2DP
AVRCP
OPP
PBAP
HID
</d:bluetooth-profiles>
d:status-bar change value to true
d:nav-state change both entries (under Portrait and Landscape) to 'nonav'
Android Virtual Device (AVD) definition (finally)
Relaunch the AVD Manager
Select the Device Definition you just created
Click Create AVD...
or
Click Create... on the Virtual Devices tab
Select the definition you created under Device
then
Accept all defaults unless noted otherwise
AVD Name: AVD_for_Samsung_Galaxy_SII (or whatever)
Device: already set to your device definition's name
Target: choose the appropriate API level- I usually append this to the AVD Name at this point too
CPU/ABI: ARM
Keyboard: Uncheck/Disable 'Hardware keyboard present'
Skin: Galaxy_S2 (if you extracted skin under the chosen target API)
Back Camera: Webcam0 (or whatever; are you interacting with it?)
RAM: Consider lowering to 768 if on Windows
Internal Storage: Although the SII came in 16GB and 32GB varieties, consider leaving at 200MiB.
SD Card Size: leave blank unless it's part of your testing. The larger it is, the more resources required. (Consider 200MiB)
For faster emulation on Windows consider disabling HyperV in Windows Features and enabling HAXM. If you do, change the following:
CPU/ABI: Choose any Intel
Emulation: Check/Enable 'Use Host GPU'
Click OK.
<ANDROID_SDK_HOME>\avd\<AVD_NAME>.avd\config.ini reflects all of your settings above (where AVD_NAME is what you set in 4.). The example given by lloyd only shows one difference where skin.dynamic=yes - I cannot see a difference when running though.
Related
I am very new to android development. I have issues in Android AVD device display. It display the content very big. Here I cannot attach screenshot.
The lock screen looks like the very big font for Time and Date which
beyond the screen size.
Even I cannot see the lock icon to go to Home screen.
Device Definition:
Device : Nexus One(3.7", 480 x 800:hdpi)
Target : Android 5.1.1 - API Level 22,
CPU / ABI : ARM (armeabi - v7a),
SKIN : WVGA800,
RAM : 512 ,
VM Heap: 32 ,
Internal : 1024
I already searched for fix and deleted device and recreated the device, but same problem. But I cannot find the solution.
Thanks a lot.
Create a AVD having below configuration.
It is very fast for testing application.
See the image below.
I found that Device and Skin selection is somewhat an issue with newer Android SDK(not in 24.2.0 and lower, tested 24.4.1, 25.2.5 and has this issue). When I choose any named Device like Nexus *, then I have to choose only skin Skin with dynamic hardware controls and if I choose unnamed Device(with only size and resolution mentioned) then I can choose any of the Skin in the list.
Screenshot of how the problem is looking is at https://android.stackexchange.com/questions/96949/android-avd-not-displaying-appropriate-scale
if you match your laptop/computer resolution to your external monitor's resolution. Then you can return back to your PC's resolution.
On you laptop/Computer From Settings -> Display settings -> Decrease the screen layout (125%) or decrease the scale and layout of your screen and restart emulator.
This is how to change display settings
before result
Before changing the display settings
after result
After changing the display settings
P.S.It's temporary solution.
I'm trying to use the Nexus S API 21 emulator on android studio, It works, except that the Buttons of the smartphones don't work.
Here is a screenshot :
You are using hardware keys instead. So I think esc and Home will work. If you want to enable the keys on the device, try hw.mainKeys=no in the emulators .ini file:
On OS X and Linux, you can find this ~/.android/avd/<avd_name>/config.ini.
Change line hw.mainKeys=yes to hw.mainKeys=no then restart your emulator.
At one time, there was a checkbox when you were creating the emulator to select to use hardware keys or not. I have since moved on to Genymotion, an excellent android emulator replacement. If you can get this to work, I recommend trying that.
I am trying to create a Nexus 7 AVD. Regardless of the choices I make, I can not seem to actually create it since the OK button is greyed out.
The Choices I made:
AVD Name: Nexus7AVD
Device: Nexus 7
Target: Android 4.2 - API Level 17
Keyboard: Not present
Skin: Display
Front Camera: Emulated
Memory: RAM 1024, VM Heap: 32
Internal Storage: 200 MiB
SD Card: No selection
Emulation Options: Use Host GPU
What is wrong with the choices I made?
Thanks
Eric
Look at my picture, this worked for me.
I think you don't have system image installed in your IDE. Install System image by selecting Android SDK manager option and checked the system images for the targeted device you want.
You need the following:
AVD name - must exist and mustn't have any spaces (which is dumb cos you cant have 'Nexus 7')
Device
Target - API level, which you must have installed via Android SDK Manager
CPU/ABI - again needs to be installed via SDK manager (under your chosen API level you will have various system images eg ARM EABI v7a System image - these relate to CPU types. You need to install the one chosen i the dropdown, though I think if its not installed you dont get the option)
Skin - needed (choose WSVGA as the simplest, I think - but havent experimented with this)
The rest is optional I think. Have heard a suggestion that SDcard should be 'binary multiples' - eg 256, 1024 etc, but havent verified that (just added that as FYI - isnt needed to get the OK button visible).
With all that the OK button should be clickable.
I'm working to ensure my app is getting tested on ICS properly using the popular Galaxy Nexus as a basis. I'd like to emulate it as faithfully as possible.
I've created an AVD with the following parameters (from config.ini). This was mostly created using the GUI (disk.dataPartition.size is a hand-edited param based on other articles I've read). The memory values may be on the low side but that's not causing a problem for me at the moment.
Since the device had no external sdcard I've said "no" for hw.sdCard, but I'm clearly not seeing anything in the /mnt/scdcard (same as /sdcard) and cannot write to it (remounting isn't the issue AFAIK: that mount doesn't exist at all).
I've tested this a few different ways, including from the adb shell. And, yes, I've searched for an answer here... much of this setup is based on answers to this related question, which eventually led me to use disk.dataPartition.size as the equivalent to the command line option (per this site).
Edit: if I set hw.sdcard to yes it gives me an sdcard to work with, but I wonder if this is the correct way to go about this (assuming there IS a correct way within this version of the emulator). Plus, this doesn't really help when emulating an ICS device with an actual external sdcard...
So (since I don't actually have a Galaxy Nexus to work with):
What would I see for the internal "sdcard" area and mount point
(/mnt/sdcard, /sdcard, both, or something else?)
What might I do to emulate that "sdcard" correctly (since it's not really an sdcard per se)?
Bonus: What would I also see on a device with a physical sdcard? /Removable (like in Honeycomb)? Something else?
abi.type=armeabi-v7a
disk.dataPartition.size=512
hw.cpu.arch=arm
hw.cpu.model=cortex-a8
hw.keyboard.lid=no
hw.lcd.density=320
hw.mainKeys=no
hw.ramSize=512
hw.sdCard=no
image.sysdir.1=add-ons\addon-google_apis-google_inc_-15\images\armeabi-v7a\
image.sysdir.2=system-images\android-15\armeabi-v7a\
sdcard.size=64M
skin.name=WXGA720
skin.path=platforms\android-15\skins\WXGA720
snapshot.present=true
vm.heapSize=48
Here are the parameters:
Resolution : 720 x 1280
Abstracted LCD density : 316
Max VM application heap size : 48
Device ram size : 1024
When creating my AVD I put:
Name: Nexus_480x800HDPI
Target: Android 4.0.3 - API Level 15
SD Card - Size: 256 MiB
Snapshot: x Enabled
Skin: x Built-in: WVGA800
For me it is just working nicely.
Here you may also find some further info:
http://mobile.tutsplus.com/tutorials/android/common-android-virtual-device-configurations
I hope this help you.
You might want to have ram 768MB . Ram greater than that can cause problems on windows environment.
I a few days i will get a new Samsumg Galaxy SII and now i want to try developing apps for Android, so i installed eclipse and the ADT however the emulator seems to be painfully slow so i found a workaround: installing the generic x86 version in Oracle VirtualBox and connect it via adb connect <ip> to eclipse and it works extremely well.
However i am running in a "high res" version or something like that and i would like to scale it down to some more common resolution to imitate the resolution of smartphones like my Galaxy. Is anyone familiar with this customization?
I'm not sure how one can control the resolution at install. However, you if you run it live from the disk, you can highlight VESA mode. Then,
If you want to use higher resolution, you can edit the boot option by
pressing TAB, change vga=788 (800x600) to vga=791 (1024x768) or
vga=794 (1280x1024), and press Enter. You can also use vga=ask to see
all available modes. But please note Android will only work under
16-bit mode.
http://www.android-x86.org/documents/virtualboxhowto
For 800x480, you'll want video mode 375.
I've tested on 2.2 and 2.3: "android-x86-2.3-RC1-asus_laptop.iso" and http://code.google.com/p/android-x86/downloads/detail?name=android-x86-2.2-generic.iso&can=2&q= and i can get that video mode to work fine. After entering vga=ask, hit enter to see all the modes, then enter 375.