Skip to main content

Creating Custom Device Definition Using AVD Manager

As discussed in the previous chapter of How to Create an Android Virtual Device using Android Emulator that theAndroid Emulator is not a real device but a replica of the android device simulating the android system. This can be configured differently for simulating different android devices. With the help of AVD configurationAndroid Emulator can simulate:
  • Different Target platforms Versions
  • Different Screen sizes
  • Different Resolutions
  • Different input methods
  • Different Hardware configurations
  • Different external storage sizes for SD card
Although there are a good number of defaults device configurations are present in AVD Manager but still if you have any particular device in mind that you want to emulate you need to create an AVD that resembles the features of your target device. For example, you need to know the screen size and resolution and so on. In this chapter we will understand the importance of Device Definition and learn How to Create Default Device Definition and Creating Custom Device Definition Using AVD Manager.

Creating Default Device Definition

It is an easy task to create an Android virtual device (AVD) from the default device configurations available under Device Definitions tab. If you go into the AVD manager, you’ll see a list of preset devices in Device Definitions. These cover a variety of Google products and some generic devices.
1) To get started, first go to Device Definitions tab and select one of these presets and click ‘Create AVD’.
CreatingDefinition_1

2) Every default device will provide you some preset AVD and that can be changed according to your need.
CreatingDefinition_1_1
Note: Notice that the OK button is disabled, just because under CPU/ABI it says that “No system Images installed for this target“. To avoid this, select different Device configuration from Device & select any skin or select none for skin and proceed.

Below are the list of optional and mandatory settings:
  • AVD NAME: Choose a name for the AVD like NexusSix-4.4 that refer to your device configuration
  • Device: Select the AVD resolution as per the device options
  • Target: Select the Android version / Test Environment or Target Platform
  • CPU/ABI: Select Intel Atom (x86) for 32-bit and ARM (armeabi-v7) for 64-bit.
  • Keyboard: Select this box to use the keyboard in the AVD
  • Skin: Select this box to get the hardware buttons
  • Front Camera: If the system have a webcam, that can be used with AVD
  • Back Camera: If the system have a webcam, that can be used with AVD
  • Memory Options: Set RAM & VM Heap for the device according to your need
  • Internal Storage: Set this as per your need and Select GiB/MiB from the drop down
  • SD Card: Set this as per your need and Select GiB/MiB from the drop down
  • Emulation Options
    • Snapshot: Select this to persist, it lets you quickly start the emulator after the first startup.
    • Use Host GPU: Select this to use the computers graphics

3) After you complete above steps, the emulator will be displayed under the Android Virtual Devices tab, configured on the AVD Manager. Now Select the newly added AVD name and click on Start on the right.
4) This would launch the pop up with few options, you may choose as you want. Once done click on Launch, this will launch the emulator.
AVD_Manager_5
  • Scale display to real size: This causes the resolution of the emulator’s display to be scaled to match the screen size
  • Wipe user dataThis would wipe any previous app installation you have done and would launch a plain fresh emulator. Wipe user data
  • Launch from snapshot: This cause the emulated device to be started from a previously saved snapshot of the device’s state. The emulator launches much faster when launched from a snapshot
  • Save to snapshot: This causes the emulated device’s state to be saved to a snapshot upon device exit
Once done, Emulator will launch, it would take few minutes to display the Home Screen of the virtual android device.


Creating a Custom Device Definition

In case the available device definitions do not match the device type you’d like to emulate, you can create a custom device definition for your AVD. If the AVD manager is opened, go to Device Definitions.
1) Click on Create Devices.
CreatingDefinition_2

2) The following Configure Hardware Profile window will display and it allows you to specify various configurations such as the screen size, memory options, input type, and sensors.
CreatingDefinition_3
Note: Once all the information is filled properly, Create Device button will get enabled and you may proceed then.

3) After you complete above steps, the emulator will be displayed under the Device Definition tab, configured on the AVD Manager. Now Select the newly created AVD name and click on Create AVD on the right.
CreatingDefinition_4

Hardware options

If you are creating a new AVD, you can specify the following hardware options for the AVD to emulate:
Emulator_Settings

Comments

Popular posts from this blog

JMeter Exceeded Maximum Number of Redirects Error Solution

While running performance test, JMeter allows maximum 5 redirects by default. However, if your system demands more than 5 redirects, it may result in JMeter exceeded maximum number of redirects error. In this post, we have listed down steps to overcome this error. Actual error in JMeter: Response code: “Non HTTP response code: java.io.IOException” Response message: “Non HTTP response message: Exceeded maximum number of redirects: 5” This error is noticed because  JMeter  allows maximum 5 redirects by default and your system may be using more than 5 redirects. You need to increase this count to more than 5 in jmeter.properties file. Follow below steps to achieve this. Navigate to /bin directory of your JMeter installation. Locate jmeter.properties file and open it in any editor. Search for “httpsampler.max_redirects” property in opened file. Uncomment the above property by removing # before it. Change to value to more than 5 Eg. 20. Save the file and restart JMeter. If

SSO with SAML login scenario in JMeter

SAML(Security Assertion Markup Language) is increasingly being used to perform single sign-on(SSO) operations. As WikiPedia puts it, SAML is an XML-based open standard data format for exchanging authentication and authorization data between parties, in particular, between an identity provider and a service provider. With the rise in use of SAML in web applications, we may need to handle this in JMeter. This step-by-step tutorial shows SAML JMeter scenario to perform login operation. First request from JMeter is a GET request to fetch Login page. We need to fetch two values ‘SAMLRequest’ and ‘RelayState’ from the Login page response data. We can do this by using  Regular Expression Extractor . These two values need to be sent in POST request to service provider. Refer below image to see how to do this. We will get an HTML login page as a response to the request sent in 1st step. We need to fetch values of some hidden elements to pass it in the next request. We can do this b

A Tutorial to Send Email using JMeter

Sending email is a mundane activity in any professional’s life. It’s a common medium for communication nowadays. Therefore performance testing of email server is not only important but necessary for an organization. JMeter can be helpful to perform load testing in such scenarios. In this tutorial, we will see how JMeter can be used to send email. We will use SMTP Sampler of JMeter to send an email. JavaMail API is needed to enable email functionality in JMeter. Download it from  here  and paste the jar in JMeter’s lib folder. Now, perform below steps to configure SMTP Sampler. Add a new Thread Group under Test Plan. Right click on Thread Group and select Add–>Sampler–>SMTP Sampler. We need to populate SMTP server’s details in this sampler. We will use GMail for sending an email. For this, enter these values in SMTP Sampler fields. Server: smtp.googlemail.com, Port: 587. Provide values in Email Address From and To fields of Mail Settings section to specify sender and reci