Tutorial for Building Your First Android Application

Monday, February 27, 2012

Creating and Configuring a New Android Project

You can create a new Android project in much the same way as when you added the
Snake application to your Eclipse workspace.

The first thing you need to do is create a new project in your Eclipse workspace.The
Android Project Wizard creates all the required files for an Android application. Follow
these steps within Eclipse to create a new project:

1. Choose File,New,Android Project, or choose the Android Project creator icon,
which looks like a folder (with the letter a and a plus sign), on the Eclipse
toolbar.


2. Choose a Project Name. In this case, name the project MyFirstAndroidApp.

3. Choose a Location for the project files. Because this is a new project, select the
Create New Project in Workspace radio button. Check the Use Default Location
checkbox or change the directory to wherever you want to store the source files.

4. Select a build target for your application. Choose a target that is compatible with
the Android handsets you have in your possession. For this example, you might use
the Android 2.2 target.

5. Choose an application name.The application name is the “friendly” name of the
application and the name shown with the icon on the application launcher. In this
case, the Application Name is My First Android App.

6. Choose a package name. Here you should follow standard package namespace conventions
for Java. Because all our code examples in this book fall under the com.androidbook.*
namespace,we will use the package name com.androidbook.myfirstandroidapp, but you are free to choose your own package name.

7. Check the Create Activity checkbox.This instructs the wizard to create a default launch
activity for the application. Call this Activity class MyFirstAndroidAppActivity.
Your project settings should look like Figure 3.8.

8. Finally, click the Finish button.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.