Starting Android Development Part 1: Setting Up a Project in Eclipse

December 30, 2009 3 Comments

So, you’ve got an Android Device.  You’ve got the SDK set up.  Now what?  In the next few posts, I’m going to walk you though creating your very own Android application from scratch.

To do that, I’m going to assume the following:

  • You have your Android SDK setup
  • You know a little something about programming in Java
  • You’re willing to leave comments if some of my instructions are unclear

All right . . . ready to start?

Setting up a new project in Eclipse
Each program you write for Android will be contained in its own ‘project’ from Eclipse’s point of view.  This makes sure that the code is stored properly in its own little folder.

  • Select File > New > Project
  • From the resulting wizard, chose Android > Android Project (See picture below)

Picture 3

  • The next screen will allow you to set up most of the important values that Eclipse needs.  Here’s a quick explanation on what they mean:
    • Project Name: This is the name that the project will have in your workspace.
    • The Contents box determines where the source files (your .java, .dex, and other files) are going to be stored.
    • The Build Target box allows you to select which version of Android you’re shooting for.  Since I’m using some old code for this project, I’m going to use Android 1.5 as the target — meaning that this program will theoretically run on all Android devices 1.5 and above .  As of right now, I build most of my projects to run on 1.5 / 1.6 and test for all versions of Android that are out there on devices (1.5 / 1.6 / 2.0).
    • Application Name: Give your application name here.  This will be stored under a special variable that we’ll see later.
    • Package Name: Java code is organized in packages.  Enter a package name here.  The package name will lend itself to the folder hierarchy in which source code is stored.  For example, a package name of com.droidweb.temperature means that the code will be stored in com/droidweb/temperature/.
    • Create Activity: Android program flow is controlled by activities.  Check the box if you want a default activity to launch when your program opens (99 times out of 100 you do), then give it a name in the text box.  See the picture below if this is unclear.
    • Min SDK Version: This will automatically fill in based on your Build Target chose.  This is the minimum SDK version code on which your program will run.  Each version of the Android SDK has a version number as outlined in the table below:
SDK Name Version Number
1.0 2
1.5 (Cupcake) 3
1.6 (Donut) 4
2.0 (Éclair) 5

Picture 4

Click Finish once you’ve filled in all the appropriate information.  Stay tuned for our next post: I’ll begin to explain the structure of your Android project.

Add to Del.cio.us RSS Feed Add to Technorati Favorites Stumble It! Digg It!
    www.sajithmr.com

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
Sphere: Related Content

Tags: , , , , , , Android Development Corner, Programming
3 Comments to “Starting Android Development Part 1: Setting Up a Project in Eclipse”
  1. [...] Starting Android Development Part 1: Setting Up a Project in … [...]

  2. [...] more: Starting Android Development Part 1: Setting Up a Project in … By admin | category: android, android sdk | tags: few-posts, sdk, the-next, [...]

  3. [...] Part One of Starting Android Development, we discussed setting up your project in Eclipse.  Now it’s [...]

Leave a Reply


Spam Protection by WP-SpamFree

Droidtip: Install e-mailed .apk files via tAttachApkInstaller

Ever received an .apk attachment via gmail?  As an application reviewer, I most certainly have. For the longest I’ve wished...

Protect your Android Device with Stealth Guards. For Free.

Here’s a limited time offer all you Android phone owners should jump on quickly. StealthGaurds.com is offering its...

TweetDeck for Android is Arriving and its Amazing!

If there’s one area that has no clear winner yet for Android, its Twitter apps.  We have seen apps...

Nexus One Revived as Next Android Developers Phone

In the (not so) recent news, Google announced the discontinuation of the Nexus One.  For many Android fans, this...

Android Development Made Simpler with Droid-fu

android,progrmaming When you program for Android you find yourself doing some of the same tasks repeatedly. As a programmer you know...