SlideShare a Scribd company logo
HELLO
WE MEET AGAIN 
Android System
Architecture
Training Session 2 - Day 2
Android is built on top of Linux kernel.
Android is built on top of Linux kernel.
Android uses a number of libraries to perform various functionalities.
Android is built on top of Linux kernel.
Android uses a number of libraries to perform various functionalities.
Just like the Java Virtual Machine in our computers, Android has its
own Dalvik Virtual Machine optimized for itself.
Android is built on top of Linux kernel.
Android uses a number of libraries to perform various functionalities.
Just like the Java Virtual Machine in our computers, Android has its
own Dalvik Virtual Machine optimized for itself.
Higher-level services to applications in the form of Java classes:
Application Framework.
Android is built on top of Linux kernel.
Android uses a number of libraries to perform various functionalities.
Just like the Java Virtual Machine in our computers, Android has its
own Dalvik Virtual Machine optimized for itself.
Higher-level services to applications in the form of Java classes:
Application Framework.
We will write applications to be installed on the Application layer only.
Introduction to

xml	
  
Android’s defined tags

Introduction to

xml	
  

Used to define some of
the resources
-  Layouts
-  Strings
Used in Android
Manifest
Preferred way for
defining UI elements
-  Separation of
code
Simple UI
LO
AU
YT

Eclipse has a great UI creator
-  Generates all the xml for you
Composed of View objects

Can be specified for portrait or
landscape
-  Different designs for different
orientation.
VIEWS
A layout/activity is composed of
Views and ViewGroups.
View is something that is visible.
Examples:
- 
- 
- 
- 

TextViews,
Buttons,
TimePicker,
DatePicker
VIEWS
3 ways to declare width and height

a. 
b. 
c. 

fill_parent
wrap_content
match_parent

<Button
android:id = “@+id/button”
android:layout_width = “fill_parent”
android:layout_height = “wrap_content”
android:text = “Button”/>

{

DO NOT FORGET

TO DEFINE US
VIEWS

{

<EditText
android:id = “@+id/number”
android:layout_width = “fill_parent”
android:layout_height = “wrap_content”
android:text = “number”/>

You can change
the type of
inputs as
necessary
VIEWS

<TextView
android:id = “@+id/result”
android:layout_height = “wrap_parent”
android:layout_weight = “fill_content”
android:text = “invisible”/>

3 ways to declare visibility

a. 
b. 
c. 

visible
invisible
gone
FrameLayout

4

One or more View can be
grouped into a ViewGroup

RelativeLayout

3

This is the <body> to your
view.

LinearLayout

2

ViewGroups

1

TableLayout

5

ScrollView, etc.
Each layout has something
unique to it.
Each layout has a purpose!
LinearLayout
Declaring the XML namespace (done
in the 1st ViewGroup)

<LinearLayout
xmlns:android=“http://schemas.android.com/apk/res/
android”
android:layout_width= “match_parent”
android:layout_height= “match_parent”
android:orientation= “vertical”>
… (TextViews, Buttons etc.)
</LinearLayout>
Unique for this ViewGroup
a.  Vertical
b.  Horizontal
RelativeLayout

Does not have any android:orientation.

Affects the layouts inside it

Views are arranged according to references.
RelativeLayout

<RelativeLayout ..>
<Button android:id= “@+id/btn”
android:layout_alignParentTop= "true" … />
<TextView android:layout_below = “@id/btn” … />
<TextView android:layout_toRightOf = “@id/btn” …/>
<TextView android:layout_toLeftOf = “@id/btn” …/>
<TextView android:layout_alignParentBottom =
“true” .../>
</RelativeLayout>
Various other positioning
techniques also there:
alignLeft
alignBaseLine
above, etc.
LinearLayout

vs

RelativeLayout
LETS UNITE!
<LinearLayout … >
<RelativeLayout … >
…
</RelativeLayout>
</LinearLayout>
You can use ViewGroup within ViewGroup

LAYOUTCEPTION!
INTENTS
ENTS

<a href= “target”>page 2</a>

Intent ~ Redirecting !

Intent is used to call into android's drivers,
other applications as well.

Powerful inter/intra application messagepassing framework.

While working with intents we also have to
work with the

Android Manifest
Android Manifest
Presents essential information
about the application to the
Android system
Information the system must have before it
can run any of the application's code.
Remember this?
Manifest
Name of the Java package for the
application.

It describes the components of
the application
the activities, services, broadcast receivers, and
content providers.
Manifest
It declares which permissions the
application must have in order to
access protected parts of the API and
interact with other applications.

It declares the minimum level of the
Android API that the application
requires … and much more.
MODIFICATION IN ANDROID MANIFEST

Declares an activity (an Activity
subclass) that implements part of the
application’s visual user interface.

<activity android:name=".OtherClass">
<intent-filter>
<action android:name="android.intent.action.NAME"/>
<category
android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
The types of intents that an app can
respond to

Adds an action to an intent filter

Adds a category name to an intent
filter
In MainActivity
Intent i = new Intent(MainActivity.this,
OtherClass.class); // Instantiating the intent
class
i.putExtra(“name”, value); // values to be sent
startActivity(i); // Starting the intent

In OtherClass
Intent i = getIntent(); //getting the intent
object
String name = i.getStringExtra(“name”); //
getting value from passed intent

Intents
HAVE YOU EVER WONDERED
WHAT HAPPENS WHEN YOU
PRESS THE BACK BUTTON/
HOME BUTTON ON ANDROID?
Activity
Life
Cycle
Activity
Life
Cycle

onCreate() :
instantiate views, setup
references, implement
listeners.

onPause() :
save data/state in the
application.

onResume() :
can be used to load the
saved state, is always
called when the application
comes into view.
THAT’S ALL FOLKS!
WE’LL SEE YOU TOMORROW

More Related Content

ODP
Day seven
ODP
Session 2- day 3
PDF
Training Session 2
PPTX
Android Tutorials - Powering with Selection Widget
PDF
Android appwidget
PPTX
Android Widget
PDF
Android L02 - Activities and Adapters
PPTX
iOS app dev Training - Session1
Day seven
Session 2- day 3
Training Session 2
Android Tutorials - Powering with Selection Widget
Android appwidget
Android Widget
Android L02 - Activities and Adapters
iOS app dev Training - Session1

What's hot (20)

DOCX
Android xml-based layouts-chapter5
PPTX
Android Training (Android UI)
PPTX
Angular js
PDF
Android Screen Containers & Layouts
DOCX
Filters in AngularJS
PPTX
Understanding angular js
PDF
Android L08 - Google Maps and Utilities
PDF
iOS Layout Overview
PDF
AngularJS - Services
PPTX
Angular Js Get Started - Complete Course
PDF
Solid angular
PPTX
AngularJs presentation
PDF
Design for succcess with react and storybook.js
PPT
Android Ui
PDF
Basic Android Layout
PDF
Violet Peña - Storybook: A React Tool For Your Whole Team
DOCX
Creation of simple application using - step by step
PDF
Introduction to React for Frontend Developers
PPTX
06. Android Basic Widget and Container
PDF
List Views
Android xml-based layouts-chapter5
Android Training (Android UI)
Angular js
Android Screen Containers & Layouts
Filters in AngularJS
Understanding angular js
Android L08 - Google Maps and Utilities
iOS Layout Overview
AngularJS - Services
Angular Js Get Started - Complete Course
Solid angular
AngularJs presentation
Design for succcess with react and storybook.js
Android Ui
Basic Android Layout
Violet Peña - Storybook: A React Tool For Your Whole Team
Creation of simple application using - step by step
Introduction to React for Frontend Developers
06. Android Basic Widget and Container
List Views
Ad

Similar to Training Session 2 - Day 2 (20)

PDF
Introduction to Android Development
ODP
Android training day 2
PPT
Android application development for TresmaxAsia
DOCX
Android Tutorial For Beginners Part-1
PPT
Part 2 android application development 101
PDF
Android Jumpstart Jfokus
PPTX
Android apps development
PPTX
Android app development
PPT
Lec005 android start_program
PPT
Introduction to Android Development
PPT
Android Training Ahmedabad , Android Course Ahmedabad, Android architecture
PPT
Android Tutorial
KEY
Android Workshop
PDF
Android Workshop_1
PPTX
Android beginners David
PPTX
Android components
PPT
"Android" mobilių programėlių kūrimo įvadas #2
PDF
Android development - Activities, Views & Intents
PPTX
Android apps development
PDF
Learn how to develop for Android, beyond the Hello World android app - Cape T...
Introduction to Android Development
Android training day 2
Android application development for TresmaxAsia
Android Tutorial For Beginners Part-1
Part 2 android application development 101
Android Jumpstart Jfokus
Android apps development
Android app development
Lec005 android start_program
Introduction to Android Development
Android Training Ahmedabad , Android Course Ahmedabad, Android architecture
Android Tutorial
Android Workshop
Android Workshop_1
Android beginners David
Android components
"Android" mobilių programėlių kūrimo įvadas #2
Android development - Activities, Views & Intents
Android apps development
Learn how to develop for Android, beyond the Hello World android app - Cape T...
Ad

More from Vivek Bhusal (11)

ODP
PDF
ODP
Android training day 5
ODP
Android training day 4
PDF
Android training day 3
ODP
Android training day 1
PPTX
Stores munk presentation_aug10 (1)
PPTX
Mybudget
PDF
Wisevote - opendataweek @
PDF
Android training at GDG kathmandu Startup weekend bootcamp
PPTX
My medical info
Android training day 5
Android training day 4
Android training day 3
Android training day 1
Stores munk presentation_aug10 (1)
Mybudget
Wisevote - opendataweek @
Android training at GDG kathmandu Startup weekend bootcamp
My medical info

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
Chapter 5: Probability Theory and Statistics
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
A Presentation on Touch Screen Technology
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Approach and Philosophy of On baking technology
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Encapsulation_ Review paper, used for researhc scholars
Enhancing emotion recognition model for a student engagement use case through...
Chapter 5: Probability Theory and Statistics
A comparative study of natural language inference in Swahili using monolingua...
Programs and apps: productivity, graphics, security and other tools
A Presentation on Touch Screen Technology
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A Presentation on Artificial Intelligence
Approach and Philosophy of On baking technology
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Zenith AI: Advanced Artificial Intelligence
Digital-Transformation-Roadmap-for-Companies.pptx
1. Introduction to Computer Programming.pptx
Tartificialntelligence_presentation.pptx
Web App vs Mobile App What Should You Build First.pdf
Getting Started with Data Integration: FME Form 101
Unlocking AI with Model Context Protocol (MCP)
NewMind AI Weekly Chronicles - August'25-Week II
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Training Session 2 - Day 2

  • 4. Android is built on top of Linux kernel.
  • 5. Android is built on top of Linux kernel. Android uses a number of libraries to perform various functionalities.
  • 6. Android is built on top of Linux kernel. Android uses a number of libraries to perform various functionalities. Just like the Java Virtual Machine in our computers, Android has its own Dalvik Virtual Machine optimized for itself.
  • 7. Android is built on top of Linux kernel. Android uses a number of libraries to perform various functionalities. Just like the Java Virtual Machine in our computers, Android has its own Dalvik Virtual Machine optimized for itself. Higher-level services to applications in the form of Java classes: Application Framework.
  • 8. Android is built on top of Linux kernel. Android uses a number of libraries to perform various functionalities. Just like the Java Virtual Machine in our computers, Android has its own Dalvik Virtual Machine optimized for itself. Higher-level services to applications in the form of Java classes: Application Framework. We will write applications to be installed on the Application layer only.
  • 10. Android’s defined tags Introduction to xml   Used to define some of the resources -  Layouts -  Strings Used in Android Manifest Preferred way for defining UI elements -  Separation of code
  • 12. LO AU YT Eclipse has a great UI creator -  Generates all the xml for you Composed of View objects Can be specified for portrait or landscape -  Different designs for different orientation.
  • 13. VIEWS A layout/activity is composed of Views and ViewGroups. View is something that is visible. Examples: -  -  -  -  TextViews, Buttons, TimePicker, DatePicker
  • 14. VIEWS 3 ways to declare width and height a.  b.  c.  fill_parent wrap_content match_parent <Button android:id = “@+id/button” android:layout_width = “fill_parent” android:layout_height = “wrap_content” android:text = “Button”/> { DO NOT FORGET TO DEFINE US
  • 15. VIEWS { <EditText android:id = “@+id/number” android:layout_width = “fill_parent” android:layout_height = “wrap_content” android:text = “number”/> You can change the type of inputs as necessary
  • 16. VIEWS <TextView android:id = “@+id/result” android:layout_height = “wrap_parent” android:layout_weight = “fill_content” android:text = “invisible”/> 3 ways to declare visibility a.  b.  c.  visible invisible gone
  • 17. FrameLayout 4 One or more View can be grouped into a ViewGroup RelativeLayout 3 This is the <body> to your view. LinearLayout 2 ViewGroups 1 TableLayout 5 ScrollView, etc.
  • 18. Each layout has something unique to it. Each layout has a purpose!
  • 19. LinearLayout Declaring the XML namespace (done in the 1st ViewGroup) <LinearLayout xmlns:android=“http://schemas.android.com/apk/res/ android” android:layout_width= “match_parent” android:layout_height= “match_parent” android:orientation= “vertical”> … (TextViews, Buttons etc.) </LinearLayout> Unique for this ViewGroup a.  Vertical b.  Horizontal
  • 20. RelativeLayout Does not have any android:orientation. Affects the layouts inside it Views are arranged according to references.
  • 21. RelativeLayout <RelativeLayout ..> <Button android:id= “@+id/btn” android:layout_alignParentTop= "true" … /> <TextView android:layout_below = “@id/btn” … /> <TextView android:layout_toRightOf = “@id/btn” …/> <TextView android:layout_toLeftOf = “@id/btn” …/> <TextView android:layout_alignParentBottom = “true” .../> </RelativeLayout> Various other positioning techniques also there: alignLeft alignBaseLine above, etc.
  • 23. LETS UNITE! <LinearLayout … > <RelativeLayout … > … </RelativeLayout> </LinearLayout>
  • 24. You can use ViewGroup within ViewGroup LAYOUTCEPTION!
  • 26. ENTS <a href= “target”>page 2</a> Intent ~ Redirecting ! Intent is used to call into android's drivers, other applications as well. Powerful inter/intra application messagepassing framework. While working with intents we also have to work with the Android Manifest
  • 27. Android Manifest Presents essential information about the application to the Android system Information the system must have before it can run any of the application's code.
  • 29. Manifest Name of the Java package for the application. It describes the components of the application the activities, services, broadcast receivers, and content providers.
  • 30. Manifest It declares which permissions the application must have in order to access protected parts of the API and interact with other applications. It declares the minimum level of the Android API that the application requires … and much more.
  • 31. MODIFICATION IN ANDROID MANIFEST Declares an activity (an Activity subclass) that implements part of the application’s visual user interface. <activity android:name=".OtherClass"> <intent-filter> <action android:name="android.intent.action.NAME"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity> The types of intents that an app can respond to Adds an action to an intent filter Adds a category name to an intent filter
  • 32. In MainActivity Intent i = new Intent(MainActivity.this, OtherClass.class); // Instantiating the intent class i.putExtra(“name”, value); // values to be sent startActivity(i); // Starting the intent In OtherClass Intent i = getIntent(); //getting the intent object String name = i.getStringExtra(“name”); // getting value from passed intent Intents
  • 33. HAVE YOU EVER WONDERED WHAT HAPPENS WHEN YOU PRESS THE BACK BUTTON/ HOME BUTTON ON ANDROID?
  • 35. Activity Life Cycle onCreate() : instantiate views, setup references, implement listeners. onPause() : save data/state in the application. onResume() : can be used to load the saved state, is always called when the application comes into view.
  • 36. THAT’S ALL FOLKS! WE’LL SEE YOU TOMORROW