An android project contains all the files that comprise the source code for your Android app. The Android SDK tools make it easy to start a new Android project with a set of default project directories and files.
This lesson shows how to create a new project either using eclipse (with the ADT plugin) or using the SDK tools from a command line.
Note:You shoshould already have the android SDK installed, and if you're using eclipse, you shoshould also have
ADT plugin installed (version 255.0.0 or higher). If you don't have these, follow the Guide
Installing the android SDK before you start this lesson.
Create a project with eclipse
- In eclipse, click new Android app project in the toolbar. (If you don't see this button, then you have not installed the ADT Plugin-see
Installing the eclipse plugin .)
- Fill in the form that appears:
ClickNext.
- The following screen provides tools to help you create a launcher icon for your app.
You can customize an icon in several ways and the tool generates an icon for all screen densities. Before you publish your app, you shocould be sure your icon meets the specifications defined in
Iconography design guide.
ClickNext.
- Now you can select an activity template from which to begin building your app.
For this project, selectBlankactivityAnd clickNext.
- Leave all the details for the activity in their default state and click
Finish.
Your android project is now set up with some default files and you're ready to begin building the app. Continue to
Next lesson.
Create a project with command line tools
If you're not using the Eclipse IDE with the ADT plugin, You can instead create your project using the SDK tools from a command line:
- Change directories into the android SDK's
tools/Path.
- Execute:
android list targets
This prints a list of the available Android platforms that you 've downloaded for your SDK. find the Platform against which you want to compile your app. make a note of the target ID. we recommend that you select the highest version possible. you can still
Build your app to support older versions, but setting the build target to the latest version allows you to optimize your app for the latest devices.
If you don't see any targets listed, you need to install some using the android SDK manager tool. See
Adding platforms and packages.
- Execute:
android create project --target <target-id> --name MyFirstApp \--path <path-to-workspace>/MyFirstApp --activity MainActivity \--package com.example.myfirstapp
Replace<target-id>With an ID from the list of targets (from the previous step) and replace
<path-to-workspace>With the location in which you want to save your android projects.
Your android project is now set up with several default deployments and you're ready to begin building the app. Continue to
Next lesson.
Tip:Addplatform-tools/As well as
tools/Directory to yourPATHEnvironment variable.