The Way To Android : Lesson 3
-----------------------------
- Agenda :
1 - Create your first android application
2 - Run your android application on simulator
3 - Examining your android project
1 - Create your first android application
------------------------------------------------------
- open your eclipse ( with ADT plugin installed and SDK integrated )
- from file menu choose --> new project
- Right click on your android project
- choose run as --> android application
- after run your project
3 - Examining your android project
------------------------------------------------------
when you create a new android application . you get some several items in the project root directory , including the following :
----------------------------------------------------------------------------------------------------
In addition to the preceding file and directories, you may find any of the following in Android projects :
The REST of Story
--------------------------
Now we will explain some subdirectories you will find under -----> res/:
- AndroidManifest.xml: An XML file that describes the application being built and what components (activities, services, etc.) are being supplied by that application
- bin/:The directory that holds the application once it is compiled
- libs/:The directory that holds any third-party JARs your application requires
- res/:The directory that holds resources, such as icons, GUI layouts, and the like, that are packaged with the compiled Java in the application.
- src/:The directory that holds the Java source code for the application.
----------------------------------------------------------------------------------------------------
In addition to the preceding file and directories, you may find any of the following in Android projects :
- assets/:The directory that holds other static files that you want packaged with the application for deployment onto the device.
- gen/:The directory in which Android’s build tools place source code that they generate
- build.xml and *.properties:Files that are used as part of the Ant based command-line build process, if you are not using Eclipse
- proguard.cfg:
A file that is used for integration with ProGuard to obfuscate your Android code
The REST of Story
--------------------------
Now we will explain some subdirectories you will find under -----> res/:
- res/drawable/: For images (PNG, JPEG, etc.)
- res/layout/: For XML-based UI layout specifications
- res/menu/: For XML-based menu specifications
- res/raw/:
For general-purpose files (e.g., an audio clip or a CSV file of account information) - res/value/: For strings, dimensions, and the like
- res/xml/: For other general-purpose XML files you wish to ship
-----------------------------------------------------------------------------------------
To Be Continued
One of the most important file in
your application is the manifest file : It
contain the basic info about
your application
The element supplies :
- android:name for the class implementing the activity
- android:label for the display name of the activity
- <intent-filter> :
child element describing under what conditions this activity will be displayed element sets up your activity to appear in the launcher, so users can choose to run it. As you’ll see later in this book, you can have several activities in one project, if you so choose.
Now we know how to create our first project and what is the project
structure