ACADGILD
Fundamentals of Android
Applications
1
ACADGILD
 Project Structure
 Android Manifest
 Resources
 Types of Resources
 Core Component – Activity
 Activity Life Cycle
 Summary
Contents
2Fundamentals of Android Applications
ACADGILD
. 1.idea - the project specific metadata is stored by
Android Studio.
2. Project Module (application) - This is the
project folder where your application code
resides. Its sub directories are:
1. build: This has all the output of the make
process i.e. classes.dex, compiled classes,
and resources, etc.
2. libs : This is a commonly seen folder in
eclipse land too, which optionally can hold
the libraries or .jar files.
3. src: The src folder can have both
application code (main) & android unit test
script(“androidTest”). The java folder
contains all the java codes and res contains
drawables, layouts, etc.
3. Gradle - This is where the gradle build system’s
jar wrapper i.e. this jar is how Android System
communicates with gradle installed in OS
4. External Libraries - A place where Referenced
Libraries are found and also target SDK Platform
Project Structure
3Fundamentals of Android Applications
1
2
3
4
a
b
c
ACADGILD
• Metadata of Android Application.
• Syntax :
<manifest>
<!-- Elements for Application properties should come here -->
<application>
<!-- Elements for application components should come here -->
</application>
</manifest>
Android Manifest
4Fundamentals of Android Applications
ACADGILD
• Resources are the additional files
and static content that your code
uses.
• For any type of resource, you can
specify default and multiple
alternative resources for your
application.
Resources
5Fundamentals of Android Applications
ACADGILD
1. Some attributes have values that can be displayed to users — for example, a label and
an icon for an activity.
• The values of these attributes should be localized and therefore set from a resource
or theme.
• Resource values are expressed in the following format : @[package:]type:name
2. The package name can be omitted if the resource is in the same package as the
application, type is a type of resource — such as "string" or "drawable" — and name is
the name that identifies the specific resource.
• For example: <activity android:icon="@drawable/smallPic" . . . >
3. Values from a theme are expressed in a similar manner, but with an initial '?' rather
than '@‘.
• For Example: ?[package:]type:name
Resources
6Fundamentals of Android Applications
ACADGILD
Animation Resources
• Tween animations are saved in res/anim/ and accessed from the R.anim class.
• Frame animations are saved in res/drawable/ and accessed from
the R.drawable class.
Color State List Resource
• Define a color resources that changes based on the View state.
• Saved in res/color/ and accessed from the R.color class.
Drawable Resources
• Define various graphics with bitmaps or XML.
• Saved in res/drawable/ and accessed from the R.drawable class.
Layout Resource
• Define the layout for your application UI.
• Saved in res/layout/ and accessed from the R.layout class.
Type of Resources
7Fundamentals of Android Applications
ACADGILD
Menu Resource
• Define the contents of your application menus.
• Saved in res/menu/ and accessed from the R.menu class.
String Resources
• Define strings, string arrays, and plurals (and include string formatting and styling).
• Saved in res/values/ and accessed from the R.string, R.array, and R.plurals classes.
Style Resource
• Define the look and format for UI elements.
• Saved in res/values/ and accessed from the R.style class.
More Resource Types
• Define values such as booleans, integers, dimensions, colors, and other arrays.
• Saved in res/values/ but each accessed from unique R sub-classes (such
as R.bool, R.integer, R.dimen, etc.)
Type of Resources
8Fundamentals of Android Applications
ACADGILD
Activity
 Every screen in an Android application is an Activity.
 Activity will always have a User Interface (abbreviated as UI).
 It is not possible to have an Activity without a UI.
Core Component Activity
9Fundamentals of Android Applications
ACADGILD
Activity Life Cycle
10Fundamentals of Android Applications
Save Important
Data
ACADGILD
 We have seen the initial project structure
– AndroidManifest,
– Resources.
 Activity and its Life Cycle.
 Importance of onPause method.
Summary
11Fundamentals of Android Applications
ACADGILD
Glossary
12
Terms Description
Tween animation Creates an animation by performing a series of
transformations on a single image with an Animation
Frame animation Creates an animation by showing a sequence of images in
order with an AnimationDrawable.

Android Application Fundamentals

  • 1.
  • 2.
    ACADGILD  Project Structure Android Manifest  Resources  Types of Resources  Core Component – Activity  Activity Life Cycle  Summary Contents 2Fundamentals of Android Applications
  • 3.
    ACADGILD . 1.idea -the project specific metadata is stored by Android Studio. 2. Project Module (application) - This is the project folder where your application code resides. Its sub directories are: 1. build: This has all the output of the make process i.e. classes.dex, compiled classes, and resources, etc. 2. libs : This is a commonly seen folder in eclipse land too, which optionally can hold the libraries or .jar files. 3. src: The src folder can have both application code (main) & android unit test script(“androidTest”). The java folder contains all the java codes and res contains drawables, layouts, etc. 3. Gradle - This is where the gradle build system’s jar wrapper i.e. this jar is how Android System communicates with gradle installed in OS 4. External Libraries - A place where Referenced Libraries are found and also target SDK Platform Project Structure 3Fundamentals of Android Applications 1 2 3 4 a b c
  • 4.
    ACADGILD • Metadata ofAndroid Application. • Syntax : <manifest> <!-- Elements for Application properties should come here --> <application> <!-- Elements for application components should come here --> </application> </manifest> Android Manifest 4Fundamentals of Android Applications
  • 5.
    ACADGILD • Resources arethe additional files and static content that your code uses. • For any type of resource, you can specify default and multiple alternative resources for your application. Resources 5Fundamentals of Android Applications
  • 6.
    ACADGILD 1. Some attributeshave values that can be displayed to users — for example, a label and an icon for an activity. • The values of these attributes should be localized and therefore set from a resource or theme. • Resource values are expressed in the following format : @[package:]type:name 2. The package name can be omitted if the resource is in the same package as the application, type is a type of resource — such as "string" or "drawable" — and name is the name that identifies the specific resource. • For example: <activity android:icon="@drawable/smallPic" . . . > 3. Values from a theme are expressed in a similar manner, but with an initial '?' rather than '@‘. • For Example: ?[package:]type:name Resources 6Fundamentals of Android Applications
  • 7.
    ACADGILD Animation Resources • Tweenanimations are saved in res/anim/ and accessed from the R.anim class. • Frame animations are saved in res/drawable/ and accessed from the R.drawable class. Color State List Resource • Define a color resources that changes based on the View state. • Saved in res/color/ and accessed from the R.color class. Drawable Resources • Define various graphics with bitmaps or XML. • Saved in res/drawable/ and accessed from the R.drawable class. Layout Resource • Define the layout for your application UI. • Saved in res/layout/ and accessed from the R.layout class. Type of Resources 7Fundamentals of Android Applications
  • 8.
    ACADGILD Menu Resource • Definethe contents of your application menus. • Saved in res/menu/ and accessed from the R.menu class. String Resources • Define strings, string arrays, and plurals (and include string formatting and styling). • Saved in res/values/ and accessed from the R.string, R.array, and R.plurals classes. Style Resource • Define the look and format for UI elements. • Saved in res/values/ and accessed from the R.style class. More Resource Types • Define values such as booleans, integers, dimensions, colors, and other arrays. • Saved in res/values/ but each accessed from unique R sub-classes (such as R.bool, R.integer, R.dimen, etc.) Type of Resources 8Fundamentals of Android Applications
  • 9.
    ACADGILD Activity  Every screenin an Android application is an Activity.  Activity will always have a User Interface (abbreviated as UI).  It is not possible to have an Activity without a UI. Core Component Activity 9Fundamentals of Android Applications
  • 10.
    ACADGILD Activity Life Cycle 10Fundamentalsof Android Applications Save Important Data
  • 11.
    ACADGILD  We haveseen the initial project structure – AndroidManifest, – Resources.  Activity and its Life Cycle.  Importance of onPause method. Summary 11Fundamentals of Android Applications
  • 12.
    ACADGILD Glossary 12 Terms Description Tween animationCreates an animation by performing a series of transformations on a single image with an Animation Frame animation Creates an animation by showing a sequence of images in order with an AnimationDrawable.