First Android App | Step 2 : first Hello World Application

Now that the ADT is installed, you can browse to the adt / eclipse folder and open eclipse.exe.

Once eclipse has opened, it is time to create a new project.

Go to File / New / Android Application Project. A pop up window will open up like below.



Please enter an application Name. In our case it is Basket.
Project Name is automatically populated.
Package Name is typically the reverse of your domain name followed by project name.

So if you domain name is www.zing.com, and your project name is basket, then the package name is typically kept as com.zing.basket. Remember, you can put more words to package name followed by . (dot) but convention is to keep it to 3 words only.

Next we need to select the Minimum Required SDK, Target SDK, Compile With and Theme.

For more detailed explanation of Min Required SDK, Target SDK and Compile with, please visit another detailed blog post of mine. Click here...

In our case, we are selecting Minimum Required SDK as API 14, Target SDK and compile with as API 18. The theme we selected is Holo Light with Dark Action Bar.

Next we need to select if we want to create a custom launcher icon and also create an activity. Leave these configurations as default and click on next.

On clicking Next, we have to select the icon for our application. If you have created an icon, you can browse and select it, alternatively you can select any icon for the time being and you can change it to another icon later on.

These icon file has the name ic_launcher and they are placed inside the res/drawable folders. These can be replaced later on if required.

Next, select blank activity and click next.

In our project, the first activity which will get called is named StartScreen.java. So change the name as StartScreen, the layout name will be activity_start_screen, let navigation type be none. On clicking next, your project will be created along with the following files

1. src / com.zing.basket / StartScreen.java

2. res/layout/activity_start_screen.xml

3. res/menu/start_screen.xml

4. res/values/string.xml

5. res/values/dimens.xml

6. res/values/styles.xml

7. res/drawable folders/ic_launcher.jpg

8. AndroidManifest.xml


Now you can rightclick on the Project Name 'Basket' on the left side menu and run it as Android Application. Make sure you have connected your Android phone to your computer using USB and also that you have activated Debugger Options in your Android Phone.

You can watch the entire tutorial through our Youtube Video as well.





No comments:

Post a Comment