An Android Virtual Device (AVD) is an emulator configuration that allows developers to test the application by simulating the real device capabilities. We can configure the AVD by specifying the hardware and software options. AVD manager enables an easy way of creating and managing the AVD with its graphical interface. We can create as many AVDs as we need, based on the types of device we want to test for. Below are the steps to create an AVD from AVD manager graphical interface
- Go to Window ->AVD Manager and select Virtual Devices.
- Click on New to create a Virtual Device, give it some Name and select Target Android Platform from the drop down list
- Click “Create AVD” and we are done!
Note: API Levels generally mean that as a programmer, you can communicate with the devices’ built in functions and functionality. Choosing an API level for an application development should take at least two things into account:
- Current distribution – How many devices can actually support my application, if it was developed for API level 9, it cannot run on API level 8 and below, then “only” around 60% of devices can run it (true to the date this post was made).
- Choosing a lower API level may support more devices but gain less functionality for your app. you may also work harder to achieve features you could’ve easily gained if you chose higher API level.
Mocking location data
As you develop your application, you’ll certainly need to test how well your model for obtaining user location works. This is most easily done using a real Android-powered device. However, if you don’t have a device, you can still test your location-based features by mocking location data in the Android emulator.
Select Window > Show View > Other > Emulator Control.
In the Emulator Control panel, enter GPS coordinates under Location Controls as individual latitude and longitude coordinates, with a GPX file for route playback, or a KML file for multiple place marks. (Be sure that you have a device selected in the Devices panel—available from Window > Show View > Other > Devices.)
Note: Providing mock location data is injected as GPS location data, so you must request location updates from GPS_PROVIDER in order for mock location data to work.