Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Samsung Galaxy S II AVD (Android Virtual Device) Basic Settings?

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.

like image 895
Frank Stallone Avatar asked May 17 '12 18:05

Frank Stallone


People also ask

How do I change my AVD configuration?

Edit the config. ini file of the AVD. Under Linux it's located under /home/<user>/. android/avd/<AVD-name>/config.

What is Android Virtual Device AVD?

An Android Virtual Device (AVD) is a configuration that defines the characteristics of an Android phone, tablet, Wear OS, Android TV, or Automotive OS device that you want to simulate in the Android Emulator. The Device Manager is an interface you can launch from Android Studio that helps you create and manage AVDs.

How do I get Android Virtual Device?

In Android Studio go to “Tools (Menu Bar) >Android > AVD Manager. Click on the “Create Virtual Device” button. Select “Phone” or “Tablet” as Category and select the device which you want to use to make a Virtual Device. Then click on the “Next” button.

Why the virtual device is not working in Android Studio?

If the Android Emulator does not start properly, this problem is often caused by problems with HAXM. HAXM issues are often the result of conflicts with other virtualization technologies, incorrect settings, or an out-of-date HAXM driver. Try reinstalling the HAXM driver, using the steps detailed in Installing HAXM.


4 Answers

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:

  1. Within the Android Virtual Device Manager, click on the Device Definitions tab and press "New Device"

  2. 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.)

  3. 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

  4. Hit Create Device, then close the AVD Manager

  5. Open the file C:\Users\[user name]\.android\devices.xml in your favorite XML editor

  6. 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> 
  7. 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.)

  8. Close the AVD Manager and open the file C:\Users\[user name]\.android\avd\[avd name]\config.ini in your favorite text editor

  9. 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 
  10. 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.

like image 86
Lloyd Avatar answered Sep 22 '22 14:09

Lloyd


Do the following to create the Samsung Galaxy S2 skin:

  1. Download the skin from the Samsung page (follow the link posted by anshumans)
  2. Go to directory [Android-SDK directory]/platforms/android-10/skins
  3. Create a new directory named GALAXY_S2
  4. Extract all files from the downloaded ZIP file to the new directory
  5. Edit the file manifest.ini and change the line api=9 to api=10
  6. Start the AVD and click "New..."
  7. Under Target select "Android 2.3.3 - API Level 10"
  8. Under Skin choose "GALAXY_S2" from the dropdown list
  9. 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.

like image 29
mwalter Avatar answered Sep 23 '22 14:09

mwalter


Samsung has the S II skin on their developer site here

like image 31
anshumans Avatar answered Sep 21 '22 14:09

anshumans


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

like image 41
cainstir Avatar answered Sep 20 '22 14:09

cainstir