Exploring the Android Project Files

You will now see a new Android project called Droidl in the Eclipse File Explorer. In addition to linking the appropriate Android SDK jar file, the following core files and directories are created:

AndroidManifest.xml—The central configuration file for the application.

► default.properties—A generated build file used by Eclipse and the Android ADT plug-in. Do not edit this file.

► /src folder—Required folder for all source code.

► /src/com.androidbook.droid1/DroidActivity.java—Main entry point to this application, named DroidActivity. This activity has been defined as the default launch activity in the Android manifest file.

► /gen/com.androidbook.droid1/R.java—A generated resource management source file. Do not edit this file.

► /assets folder—Required folder where uncompiled file resources can be included in the project.

► /res folder—Required folder where all application resources are managed. Application resources include animations, drawable graphics, layout files, data-like strings and numbers, and raw files.

/res/drawable—Application icon graphic resources are included in several different sizes.

/res/layout/main.xml—Layout file used by DroidActivity to draw onscreen. /res/values/strings.xml—The path where string resources are defined.

You can also add existing Android projects to Eclipse by using the Android Project Wizard. To do this, simply select Create Project from Existing Source instead of the default Create New Project in Workspace in the New Android Project dialog (refer to Figure 1.2). Several sample projects are provided in the /samples directory of the Android SDK, under the specific platform they support. For example, the Android SDK sample projects are found in the directory /platforms/android-xxx/samples (where xxx is the platform version number). You can also select a third option: Create Project from Existing Sample, which will do as it says. However, make sure you choose the build target first option to get the list of sample projects you can create.

0 0

Post a comment