September 9, 2011

The Default files of Eclipse Package Explorer

Last week, we discussed how to set up a new program on Android with the Eclipse IDE. When you look at the Package Explorer, you will see that Eclipse has automatically generated files.

Let’s go through them one at a time. The first is src, a source folder for the program for the java code that drives an application. You might notice that the package name will be the first line on the file.

The gen file has all the Java files generated by ADT as well as the res directory. It isn’t recommended to mess with this manually, as your application might not compile by itself.

The android.jar is the one that matches your build target that lines up with the ADT.

The assets file is empty by default, but it is made to store raw asset files. These raw assets are required to get the application to work, such as an SQLite database.

The res file is for resources, and this is a place for a lot of important subdirectories. Most of them are XML files which include animations, colors, and menu. You will also find a layout for a user interface layout, and drawable for bitmap files. The drawable hdpi is for high-density DPI screen images, mdpi is for medium density DPI screen images, and the ldpi is for low-density DPI screen images. These will become more important as we discuss screen resolutions, a topic that we will discuss next week.

The AndroidManifest.xml file is the file that the Android application seeks out first when running. It does several things such as referencing the Java code that you will write for your application so the code can be run. It also has definitions of permissions of application security for talking with other Android applications, as well as definitions of compons of the Android application. It also has a declaration of the minimum level of Android operating system version support.

To check out any of these files, simply open it up by double-clicking on the file, right-clicking on the file and hit open. You can also select the file, and hit F3, a popular shortcut.

About the Author



yourDSA, your number one source of assistance and support.



Be the first to comment!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>