How to create your own Android Virtual Device in order to test your app created with Android Studio?

Android Virtual Device (AVD) is meant for Android Studio, to test out the apps into a new phone so as to realize complete android virtual environment. In the upcoming series of tutorials, we will be learning about coding and other aspects. Prior to learning of Android Studio coding, t is important to learn all of these elements so that in the future when all of these are going to be implemented inside Android Studio there would be nothing difficult for you to attach and execute android apps.

There will be no confusions for you when you run apps and its related coding. In this tutorial, we will be learning about how to create our own AVD. In order to create AVD, we do need Android Studio (AS). First, click on the icon namely ‘AVD Manager’ which manages all of ours Android virtual devices at a single location.

After clicking on another window ‘Android Virtual Device Manager’ window will open. Now, in this Device manager earlier I had created two android virtual devices. One is ‘myAndroid’ which I have created from ‘Nexus 5’.

The original device manager is Nexus 5 and in order to keep the default settings intact, I have created another device from it so that even if when we simulate app on another device say here ‘myAndroid’ then, of course, the default settings of Nexus 5 will remain intact.

Now we are going to create the copy of the existing android virtual devices. Instead of editing the original one we will like to develop and create the copy of the device so that the original settings of the device remain as usual. From left side down of ‘Android Virtual Device Manager’ click on ‘Create Virtual Device’. The next window should pop up as ‘Select Hardware’ and then choose the device definition.

Here you will be given the choice of devices. Here we will choose ‘Nexus 5’. There is no compulsory to choose this device. You could choose any of these devices. Then go to the extreme right-hand side and below were written as ‘clone device’ and click on to it.

This simulator will clone the device of ‘Nexus 5’ and thus the original device configuration of ‘Nexus 5’ seems intact. Now ‘configure hardware profile’ window will open.

Here we will like to modify the RAM settings. In the original Nexus 5 device, the RAM setting is 1536 MB and we would like to reduce it so that simulator will work perfectly without taking too much load on system RAM.

In ‘Memory’ segment of ‘Configure Hardware Profile’ change the RAM into 1000 so that we could run the Nexus 5 modified device within 1000 RAM.

Then click ‘Finish’ and now inside ‘Select Hardware’ profile we have the new device named ‘Nexus 5 (Edited)1’ and then from the right-hand side and below of it click on ‘Next’.

Now, you will be reaching to another windows namely ‘System Image’ and here you will go to select Android Operating system images. If you have AMD processor then it is better to select or download ‘armeabi-v7a’ of Android 7 or Nougat. It should be there on the ‘Select a system image’ and inside ‘Other images’.

If your computer has Intel processor then you could choose from the list of recommended android system image from ‘Recommended tab’, Then click on ‘Next’ to reach to next window namely ‘verify configuration’. In the ‘Verify Configuration’ in the ‘AVD Name’ change the ‘Nexus 5(Edited)1 API 24’ to any of the names such as ‘MyEmulator’.

Verify Configuration

Here, we can find information related with which device is edited and which android system image and in this case we have installed ‘Android 7.0 armeabi-v7a’ and then the startup orientation of android device should be portrait or landscape, here we should select ‘portrait’ and make emulated performance of graphics to be set on ‘Automatic’ and it is your choice to enable or disable ‘Device frame’.

Device frame is the hardware side of viewing angle. You can expand ‘show advanced settings’ to go for advanced configuration but in most of the cases, this is not necessary. Then click ‘Finish ‘to return back to ‘Your Virtual Devices’.

Now, we reach the main windows of listings of virtual devices. Here, you will find our new android device such as ‘myEmulator’ and here you will see we have ‘Android 7.0’ arm central processing unit with 650MB RAM as we have distributed, 1000MB RAM as we would expect the system had taken 350 RAM so for the sake of other performs we have now 650 MB RAM.

In this way, we have created successfully our new android device namely ‘MyEmulator’. We can launch this AVD in emulator through the arrow button at the end of the name of the emulator. Click it and wait for sometime to the emulator to work.

Launching of emulator takes time in accordance with the speed of your computer and hardware configuration of the computer. Within some time one Android device will come up in a separate Window.

We have created a new AVD and launching of this AVD do take some time for the first run and subsequently, it does not take that much time to run from the second run onwards. While opening up android simulator two or more processes does run in the background and that can be seen from the footer of Android Studio.

After AVD runs and then gradle device runs and then the background process is waiting for the target device to come online which means the apps which we have just built within Android Studio will slowly be converted into apk files and then run within these console or android simulator.

Android files are apk files which are similar to that of dot exe files of windows computers. Sometimes running of preview do take longer time due to presence of infinite loops inside app and for this it is important to refresh the layout so that running and launching of app should come out within seconds inside of android app and it is important to run the android simulator once again without closing the window of android simulator in order to launch the entire android simulator and its functioning.

In the second series of the launching of simulator the installation of APK which is the form of the app which we have constructed, should take some time and after that you could see your app is running inside the simulator. Which means this will be the prototype of our app with android 7 which should be compatible with all the other android versions up to android 4.01.

In this simulator, we have completely new android 7 which work in the normal way, and most of the normal android works can be done and with its stacked android web browser even one can browse the internet and do other forms and this means it is a complete Android system.

In this way we can run ours android app and see how it is performing and that means in a completely wonderful way we can see and find, how ours apps are performing in an better or inferior way so that ultimately, we do not have to go to physical android device and then test side by side how ours app is running and instead we do not have to search for android 4, 5,6,7 devices as we could do this all here with this simulator and in the future we would be reading about how to create log files, and then see how the functioning of app is there with complete and clarity in finding out how the app is performing.

Originally published at mohanmekap.com on October 9, 2018.

freewarespace

Blogger by Choice