---
title: "Create and Run an Android Application"  
description: "In this article I am going to explain how to create and run an Android application in Android Emulator. In order to run an application we have to crea"  
author: "Chris Anderson"  
published: 2011-10-14  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/780/create-and-run-an-android-application  
category: "android"  
tags: ["android"]  
reading_time: 3 minutes  

---

# Create and Run an Android Application

In this [article](https://yourviews.mindstick.com/view/81489/kashmir-now-after-an-year-of-abrogation-of-article-370) I am going to explain how to create and run an [Android application](https://www.mindstick.com/articles/1653/creating-libraries-for-android-applications) in Android Emulator. In order to run an application we have to create an Android [Virtual](https://yourviews.mindstick.com/view/81602/top-5-virtual-credit-card-providers-in-india) Device (AVD). An AVD defines the system image and device [settings](https://answers.mindstick.com/qa/99336/how-can-i-configure-gmail-imap-settings) used by the emulator.\

##### Perform the following steps to create an AVD:

##### In Eclipse, select Window à Android SDK and AVD Manager.

- Select Virtual Devices in the left panel.
- Click New.
- The Create New AVD dialog appears.
- Type the name of the AVD, such as "MyAVD_Device".
- Choose a target.
- The target is the [platform](https://www.mindstick.com/articles/13080/wikipedia-the-most-powerful-advertising-platform-of-the-digital-age) (that is, the version of the Android SDK, such as 2.3.3) you want to run on the emulator.
- Click Create AVD.
- When you start your AVD, it seems like below:

![Create and Run an Android Application](https://www.mindstick.com/mindstickarticle/9edc0ae7-0e19-4ab5-a284-894667d848ce/images/dab1fda8-50f2-48aa-abb6-20806a42d84c.png)

##### Create a New Android Project

After creating an AVD move to the next step and create a new project in Eclipse.

1) In Eclipse, select **File** à **New** à **Project**.

2) Select Android Project and click next.

3) After click on next, you have to enter the project details in the **New Android Project** dialog box. Fill in the project details with the following values:

Project name: FirstAndroidApp

Build Target: Select a platform version that is equal to or lower than the target you chose for your AVD.

Application name: FirstAndroidApp

Package name: com.example.firstApp (or your own private namespace)

Create Activity: HelloAndroid

4) Click Finish.

![Create and Run an Android Application](https://www.mindstick.com/mindstickarticle/9edc0ae7-0e19-4ab5-a284-894667d848ce/images/0cf5ea63-5df8-4be0-ada3-bf0230dabbd8.png)

Your Android [project](https://yourviews.mindstick.com/story/1788/things-to-ensure-your-construction-project-is-successful) is now ready. It should be visible in the Package [Explorer](https://yourviews.mindstick.com/view/81617/now-it-is-time-to-say-goodbye-to-internet-explorer) on the left. Open the HelloAndroid.java file, located inside ***FirstAndroidApp*** à ***src*** à ***com.example.firstApp***). Add some lines of code in order to change the UI ([User Interface](https://www.mindstick.com/blog/302016/what-is-user-interface-and-what-are-its-benefits)):

```
package com.example.firstApp;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloAndroid  extends Activity {
     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         TextView tv=new TextView(this);
        tv.setTextSize(20);
        tv.setText("Welcome in the world of Android");
         setContentView(tv);
    }
}
```

##### Run the Application

Now after creating an application, run an application.

Right click on the project (FirstAndroidApp) which is shown in the Package Explorer à Select Run As à Android Application.

##### Output

![Create and Run an Android Application](https://www.mindstick.com/mindstickarticle/9edc0ae7-0e19-4ab5-a284-894667d848ce/images/b1e9cef0-7d4a-42fc-a239-34bac6b742d8.png)

After performing the above steps you can easily learn how to create and run and simple Android application by using Eclipse IDE..

Thanks.

---

Original Source: https://www.mindstick.com/articles/780/create-and-run-an-android-application

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
