Android Project Directory
Structure
Internal Details of Android Application:
Internal Details of Android Application (Continued….):
• Activity:
– Activity is a java class that creates and default window on the
screen where we can place different components such as
Button, EditText, TextView, Spinner etc.
– It is like the Frame of Java AWT.
– It provides life cycle methods for activity such as onCreate,
onStop, OnResume etc.
– The onCreate() method is called when Activity class is first
created.
– The setContentView (R.layout.activity_main) gives information
about our layout resource.
– Here, our layout resources are defined in activity_main.xml file.
Internal Details of Android Application (Continued….):
• R.java:
– It is the auto-generated file that contains IDs for all the
resources of res directory.
– It is generated by AAPT (Android Asset Packaging Tool).
– Whenever you create any component on activity_main, a
corresponding ID is created in the R.java file which can be used
in the Java Source file later.
Internal Details of Android Application (Continued….):
• APK File:
– An .apk file is created by the framework automatically.
– If we want to run the android application on the mobile, transfer
this file and install it.
• Resources File:
– It contains resource files including activity_main, images, strings,
styles etc.
• Manifest File:
– It contains information about package including components such
as activities, services, content providers etc.
– It is responsible to protect the application to access any protected
parts by providing the permissions.
– It also declares the android api that the application is going to use.