Saturday 19 July 2014

5. Creating Simple HelloWorld Android Application

Before creating the app, first we need to create a virtual device on which we can run and test our applications. We can also run apps directly on physical device by simply connecting that through USB.

Create Android Virtual Device in Eclipse

1. Go to Window -> Android Virtual Device Manager.
2. Select 'New' from 'Android Virtual Devices' tab and provide details for example as shown below and click Ok. Here we can set the device type, target android platform, memory and other such properties:


3. This will create a new AVD. To launch this device, select this newly created device, click on start and then launch.

4. For the first time, it will take some time to launch the device. This is how the virtual device would appear:


Creating HelloWorld Application

As we are done with creating the device, we can proceed with creating the HelloWorld app:

1. Go to File -> New -> Project. Select project type as 'Android Application Project'. Here, provide application name, project name and package name.

2. Click on next and leave defaults on configure project window and configure launch icon window.
3. On create activity window, give activity name and layout name:

4. Click on finish and you should see a new simple android application project popping up. Save all and click on Run As -> Android Application

5. The app will start on the AVD we created:












No comments:

Post a Comment