Tutorial:Creating an Eclipse project for Android

From Notes

Jump to: navigation, search

In this tutorial we will simply point you toward the Android hello world tutorial. It contains instructions for setting up the Android emulator and for creating a simple hello world project.

Prerequisites: Make sure you have correctly installed eclipse, android, android plugin for eclipse before continuing this tutorial. It can be found in the Installing Android SDK

Go To: http://code.google.com/android/intro/hello-android.html

Creating an Android Project from Scratch

If you simply want to create your own Android project (and not work through the Hello World tutorial), just follow these instructions:

  • Select File > New > Project
  • Select Android > Android Project, and press Next
  • Select the contents for the project:
    • Select Create new project in workspace to start a project for new code.
      • Enter the project name, the base package name (e.g., org.hfoss), the name of a single Activity class to create as a stub .java file, and a name to use for your application.
      • The package name is the standard java package name with the same conventions as used in standard java (e.g., org.hfoss).
      • By default, the stub .java Activity will be the first activity loaded by the application.
      • The application name is the human-readable name of the application that will be used for displaying it.
    • Select Create project from existing source to start a project from existing code.
      • In this case you must have an existing Android project stored somewhere on your system.
      • Browse to the directory containing the existing Android source code and click OK.
      • If the directory contains a valid Android manifest file(AndroidManifest.xml), the ADT plugin fills in the package, activity, and application names it for you.
  • Press Finish.
    • If all goes well, this should create an executable Android project in your workspace.
      • To run the project, right click on the project and select Run As > Android Application.
      • If you see a error message about a missing R.java file, try Project > Clean which will compile the project.

References

http://code.google.com/android/intro/hello-android.html

Installing the Android SDK

Personal tools
NSF K-12