Thursday, April 25, 2024
HomeAndroidHow to Test Android App on Emulator and setting up Android Virtual...

How to Test Android App on Emulator and setting up Android Virtual Device in New Android Studio

-

In this article we are going to learn how to set up and configure AVD (Android Virtual Device) and How to test Android App on Emulator. An Android Emulator is simply a software that duplicates the functions of an Android Device. To test Android App on a real device, refer to How to Test Android App using a Real Device discussed in our previous article. Now, let us begin by setting up an Android Virtual Device.

test android app on emulator
CC Image Courtesy: Flickr

 

 How to set up and Configure Android Virtual Device(AVD) in 5 Simple Steps:

Let us set up ourselves an Android Virtual Device in 5 simple steps.

1. To create an AVD, Click on AVD Manager shown in figure below:

test android app on emulator

2. Now a window pops up showing the available devices as shown in the image below. Let us create a fresh new Virtual Device. Since we may also need to test our app for a minimum API setting, let us configure for Android Gingerbread With API 10. So Click on ‘Create Virtual Device’.

test android app on emulator

3. Now select any device category you want. Here, I just selected Phone category, and Nexus 4 Device. Click Next.

test android app on emulator

4. The window now shows System Images of different APIs. You now select any system Image you want to test the Device. Make sure that you have downloaded the System Image. If not, Hit download link appearing in blue. Select your required System Image and hit Next.

test android app on emulator

 

5. The Window now displays verify Configuration settings. You need to be careful in this Setting as it is not configured for all Devices. By Default the System Image uses around 1500 MB of RAM! As this may result in the sluggish response of the system, for those who have less config pc,you may need to modify this amount of RAM used by the Emulator. So, click on ‘Show Advanced Settings’. There you can see the configurations allocated for the Virtual Device which is being created. Now modify the amount of RAM around ~ 500 MB.

Test Android App on Emulator

You can also customize any other settings like Enabling or disabling Keyboard settings, Camera settings,etc.. Also Check Mark the ‘Store a Snapshot for faster Start up’ so that your Emulator or Virtual Device will Start up fast when you restart it again for testing app. Now click Finish.

Now you can see a new Virtual Device in AVD Manager Menu.

test android app on emulator

 Test Android App on Emulator using newly created AVD:

1. Select the app project to be tested in Project Explorer. Here I am selecting the basic Hello World Project Created in our First article. Click Run.

Test android App on Emulator

2. Now Select the Newly Created AVD from Choose Device window and Click OK.test android app on emulator

Now your App Project will run on the New AVD we just Created!

 

 

 

 

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

LATEST POSTS

SOLID Principles in Android with Kotlin Examples

Recently I had an interview experience where I went blank when the interviewer posed an Interesting Question - Explain SOLID Principles and how they are...

Building a Multi Module App in Android | Modularization in Android #1

Recently, I was in requirement for developing a Multi Module app in Android and I was going through this great lecture on it. This article...

Lambda function in Kotlin with Examples

Lambda function is powerful feature in any Programming language and Lambda function in Kotlin is no exception. In this article, we will look at how...

Higher Order Functions in Kotlin with examples

There are many advanced features in Kotlin which gives an edge for the user using this language over Java. One such feature is Higher Order...

Follow us

1,358FansLike
10FollowersFollow
400SubscribersSubscribe

Most Popular