Getting Started with Android Studio: Running Your ‘Hello World’ App in the Emulator (Part 3)
In this tutorial, I’ll show you how to run your application in the Android Studio using an Android emulator.
Project Hierarchy
Make sure you are working under the project hierarchy, which gives you a detailed view of your project. In our previous tutorial, we learned how the activity file (not XML) and the strings file (XML) are linked. The string “hello_world” in the strings file is what is displayed as “Hello World!” in our application. The activity file is linked to the XML file with the help of “setContentView(R.layout.activity_main.xml)”. The “R” stands for the “resource” file and the “layout” is a static field inside the “R” file that points to the “activity_main.xml”.
Import Methods
If the import method is not present or showing a red line, you can press “Alt + Enter” to see possible solutions. You can also enable auto import by going to “File > Settings > Editor > General > Auto Import” and selecting all the options.
Running the Application
To run the application in an emulator, you first need to create an Android Virtual Device (AVD). Open the SDK Manager and make sure you have installed the required system images for the emulator. If not, you can install them from the SDK Manager.
Then, open the AVD Manager and create a new virtual device. Select the device type and version you want, give it a name, and click “Finish”. You can also edit the device settings later if needed.
Get Birbal Jaat’s stories in your inbox
Join Medium for free to get updates from this writer.
Once the AVD is created, click on the play button to launch the emulator. It may take some time to load. After the emulator is launched, you can run your application by clicking on the run button. Gradle will execute its tasks and prompt you to choose a running device. Select the emulator and click “OK”.
Now, your application should be up and running in the emulator!
Conclusion
This is just the beginning of our Android tutorials journey. We will cover more topics in detail in the upcoming tutorial. Remember, the “java” folder contains the Java files and the “resource” folder contains all the resources that appear on the screen for the user.
Thank you for reading! Please comment, like, and share this tutorial to help us grow and create more content for you.
Stackademic
Thank you for reading until the end. Before you go:
- Please consider clapping and following the writer! 👏
- Follow us on Twitter(X), LinkedIn, and YouTube.
- Visit Stackademic.com to find out more about how we are democratizing free programming education around the world.










