SlideShare a Scribd company logo
Android

UI development
Android

UI development
Menu
Android basic app components
- Activity
- Fragments
User Interface components
- Views
- Layouts
- Linear Layout
- Relative Layouts
- List Views
- Grid Views
What to expect?

At the end of this presentation you’ll never
see an android app in the same way again.
You should be able to identify in apps
different types of layouts, components,
lifecycles, activities and fragments.
Have better knowledge about crossplatform
design: tablets, smartphones, different
screen sizes.
Android Components
App components

Activities:
An activity represents a single screen with a user
interface. For example, an email app might have
one activity that shows a list of new emails,
another activity to compose an email, and
another activity for reading emails. It is not
possible to have more than one activity per
screen
App components

Activities Lifecycle:
App components
Fragments:
A Fragment represents a behavior or a portion of user interface in an Activity. You can combine
multiple fragments in a single activity. You can think of a fragment as a modular section of an
activity, which has its own lifecycle, receives its own input events, and which you can add or
remove while the activity is running.
App components
Activities + Fragment Lifecycle:
App components
App components
App components
App components
Manifest Files:
Before the Android system can start an app component,
the system must know that the component exists by
reading the app's AndroidManifest.xml file (the "manifest"
file). Your app must declare all its components in this file,
which must be at the root of the app project directory.
App components
Resources:
An Android app is composed of more than just code, it
requires resources that are separate from the source code,
such as images, audio files, and anything relating to the
visual presentation of the app. For example, you should
define animations, menus, styles, colors, and the layout of
activity user interfaces with XML files.
Exercise:

How many fragments and Activities do
I have in this screen?
Exercise:

How many fragments and Activities do
I have in those screens?
Exercise:

How many fragments and Activities do
I have in those screens?
Exercise:

How many fragments and Activities do
I have in those screens?
Exercise:

How many fragments and Activities do
I have in those screens?

1 Activity
3 Fragments
Evernote App:
Tablet App

Fragments on the phone and tablet

Smartphone App
Exercise:

How buzz app is using fragments until
now?
Exercise:

How buzz app is using fragments until
now?
User Interface
User Interface
All user interface elements in an Android app are built using View
and ViewGroup objects. A View is an object that draws something
on the screen that the user can interact with. A ViewGroup is an
object that holds other View (and ViewGroup) objects in order to
define the layout of the interface.
User Interface
Layouts:
A layout defines the visual structure for a user interface, such as
the UI for an activity or fragment. You can declare a layout in two
ways:
●

Declare UI elements in XML. Android provides a
straightforward XML vocabulary that corresponds to the
View classes and subclasses, such as those for widgets
and layouts.

●

Instantiate layout elements at runtime. Your application
can create View and ViewGroup objects (and manipulate
their properties) programmatically.
User Interface
Android XML:

Using Android's XML vocabulary, you can quickly design UI layouts
and the screen elements they contain, in the same way you create
web pages in HTML — with a series of nested elements.
User Interface
Android UI Components:
Button
Text Field
Checkbox
Radio Button
Toogle Button
Spinners
Pickers
User Interface
Common Layouts:

Linear Layout:
LinearLayout is a view group that aligns all
children in a single direction, vertically or
horizontally. You can specify the layout direction
with the android:orientation attribute.
User Interface
Linear Layout Example
User Interface
Common Layouts:

Relative Layout:
RelativeLayout is a view group that displays child
views in relative positions. The position of each
view can be specified as relative to sibling
elements (such as to the left-of or below another
view) or in positions relative to the parent
RelativeLayout area (such as aligned to the
bottom, left of center).
User Interface
Relative Layout Example
User Interface
Layouts Main Attributes
Size Attributes

Possible values

Or specific ones (Ex: “300dp”)
Exercise:

Which layout am I using on this view?
Exercise:

Which layout am I using on this view?

Linear Layout
With 9 text views
and
1 image button
Challenge:

The last component is another
linear layout with a orientation
“horizontal” with a image button
inside aligned to right

Why didn’t I use a Relative Layout
which would avoid the need of a
second linear layout and would be
more flexible?
User Interface
Common Layouts:

List Views:
ListView is a view group that displays a list of
scrollable items. The list items are automatically
inserted to the list using an Adapter that pulls
content from a source such as an array or
database query and converts each item result
into a view that's placed into the list.
User Interface
List View Adapters:
The Adapter provides access to the data items. The Adapter is also
responsible for making a View for each item in the data set.
User Interface
List View Example:

1 - Search Emails on the server.
2 - Parse the result to a list of Email objects (Ex: List<EmailRow> listEmails).
3 - Set the list of objects in the adapter and then set the adapter on the list.
4 - For each object on the list, the method getView will be called, where the view
for the row must be created and returned.
5 - Inside the method getView check
- If the object is of the type email then create this view: (Ex: Type.Email.
equals(emailRow.getType())

- If the object is of the type category then create this view: (Ex: Type.
EmailCategory.equals(emailRow.getType())
Exercise: Which layout this view is using?
Exercise: Which layout this view is using?
Relative Layout
Exercise:

Which layout this view is using?

What if it was Linear Layout
Exercise: Which layout this view is using?

What if it was Linear Layout
Exercise: Which layout this view is using?

What if it was Linear Layout
Exercise: Which layout this view is using?

Too Expensive
User Interface
Common Layouts:

Grid Views:
GridView is a ViewGroup that displays items in a
two-dimensional, scrollable grid. The grid items
are automatically inserted to the layout using a
ListAdapter.
It works just like ListView, only the pattern
to display the information changes
Exercise:

How many ListViews and GridView do I
have in this screen?
Exercise:

How many ListViews and GridView do I
have in this screen?

At least 3 List Views
and
3 Grid Views
Exercise:

Draw this layout in the paper
Exercise:

Draw this layout in the paper
Exercise:

Draw this layout in the paper
Exercise:

Draw this layout in the paper
Putting everything together
Putting everything together
Supporting multiple screen
sizes and formats.
When you do a
on the method on create on your activity,
the android operating system will look for
the layout according to the configurations
of the device.
For example, if the device is a Nexus 10
where the width is bigger than 720p, the R.
layout.login will be the one from the folder
layout-sw720dp
Exercise:

How would you design this app for
tablets?
Exercise:

How would you design this app for
tablets?

More Related Content

PPTX
Content provider in_android
PDF
Android datastorage
PPTX
Day: 1 Introduction to Mobile Application Development (in Android)
PPT
SQLITE Android
PPTX
Java applet
PPTX
Presentation on Android application life cycle and saved instancestate
PDF
Layouts in android
PPTX
Python variables and data types.pptx
Content provider in_android
Android datastorage
Day: 1 Introduction to Mobile Application Development (in Android)
SQLITE Android
Java applet
Presentation on Android application life cycle and saved instancestate
Layouts in android
Python variables and data types.pptx

What's hot (20)

PPTX
Inheritance in java
PDF
Fragments In Android
ODP
Android permission system
PPTX
Android app development ppt
PPTX
Android Layout.pptx
PPT
Mobile application development
PDF
Computer graphics lab report with code in cpp
PDF
Location-Based Services on Android
PPTX
GUI programming
PPT
Java-java virtual machine
PPT
Inheritance in java
PDF
Android Telephony Manager and SMS
PPTX
INHERITANCE IN JAVA.pptx
PPT
RichControl in Asp.net
PPTX
Android User Interface
PPTX
Decision Making & Loops
PPT
Visual Studio IDE
PPTX
AGE AND GENDER DETECTION.pptx
PPT
Introduction to Android Fragments
PDF
Introduction to fragments in android
Inheritance in java
Fragments In Android
Android permission system
Android app development ppt
Android Layout.pptx
Mobile application development
Computer graphics lab report with code in cpp
Location-Based Services on Android
GUI programming
Java-java virtual machine
Inheritance in java
Android Telephony Manager and SMS
INHERITANCE IN JAVA.pptx
RichControl in Asp.net
Android User Interface
Decision Making & Loops
Visual Studio IDE
AGE AND GENDER DETECTION.pptx
Introduction to Android Fragments
Introduction to fragments in android
Ad

Viewers also liked (20)

PDF
Mobile User Interface Development Challenges and Trade-offs
PDF
Introdução ao Sistema de Controle de Versão
PPTX
Transformando a experiência dos times de DEV, OPS & BIZ nos Sistemas Financei...
PDF
Workshop sistema de versionamento de código - git
PDF
Controle de versão com GIT
PPT
Joomla!Day Brasil 2008 - FláVio Kubota - Gsoc Version Control
PDF
QConSP: Vivenciando dev ops para além da automação de infraestrutura
PDF
Apresentação do SAEO na Administração Pública
PPT
GCS - Aula 09 - GCS Ágil
PDF
Wine.com.br - De zero a 300 milhões de faturamento na mesma plataforma
PPT
GCS - Aula 02 - Conceitos Principais
PDF
Controle de Mudanças com GitHub
PDF
Controle de Versão e Monitoramento de Projetos com SVN + WebSVN + StatSVN
PDF
[Mini-curso] Sistema de Controle de Versão
PDF
Alm open source
PDF
Vivenciando dev ops para além da automação de infraestrutura 2.0
PDF
Controle de versão com Git e BitBucket
PPTX
Mini aula-sublime-text-git-e-github
PDF
Controle de versão utilizando git
PDF
O futuro dos WebApps com AngularJS 2.0
Mobile User Interface Development Challenges and Trade-offs
Introdução ao Sistema de Controle de Versão
Transformando a experiência dos times de DEV, OPS & BIZ nos Sistemas Financei...
Workshop sistema de versionamento de código - git
Controle de versão com GIT
Joomla!Day Brasil 2008 - FláVio Kubota - Gsoc Version Control
QConSP: Vivenciando dev ops para além da automação de infraestrutura
Apresentação do SAEO na Administração Pública
GCS - Aula 09 - GCS Ágil
Wine.com.br - De zero a 300 milhões de faturamento na mesma plataforma
GCS - Aula 02 - Conceitos Principais
Controle de Mudanças com GitHub
Controle de Versão e Monitoramento de Projetos com SVN + WebSVN + StatSVN
[Mini-curso] Sistema de Controle de Versão
Alm open source
Vivenciando dev ops para além da automação de infraestrutura 2.0
Controle de versão com Git e BitBucket
Mini aula-sublime-text-git-e-github
Controle de versão utilizando git
O futuro dos WebApps com AngularJS 2.0
Ad

Similar to Android UI Fundamentals part 1 (20)

PPT
"Android" mobilių programėlių kūrimo įvadas #2
PDF
Mobile Application Development -Lecture 07 & 08.pdf
PDF
04 user interfaces
PPTX
creating User interface in mobile and app dev
PPTX
Unit 2 part for information technology1 4.pptx
PPTX
Building a simple user interface lesson2
PPTX
Android Training (Android UI)
PPTX
UNIT5newpart2pptx__2024_11_13_09_52_11 (1).pptx
PPT
Android Presentation for fundamental.ppt
DOCX
How to create ui using droid draw
PPTX
Android apps development
PPTX
Android application componenets for android app development
PDF
Android Application Development - Level 1
PPTX
Android ui with xml
PDF
Android Lesson 2
PPTX
mobile application development -unit-3-
PPTX
INTRODUCTION AND BASICS OF Android NOTES.pptx
PPT
Day 3: Getting Active Through Activities
PPT
Day 3: Getting Active Through Activities
PDF
Android Introduction
"Android" mobilių programėlių kūrimo įvadas #2
Mobile Application Development -Lecture 07 & 08.pdf
04 user interfaces
creating User interface in mobile and app dev
Unit 2 part for information technology1 4.pptx
Building a simple user interface lesson2
Android Training (Android UI)
UNIT5newpart2pptx__2024_11_13_09_52_11 (1).pptx
Android Presentation for fundamental.ppt
How to create ui using droid draw
Android apps development
Android application componenets for android app development
Android Application Development - Level 1
Android ui with xml
Android Lesson 2
mobile application development -unit-3-
INTRODUCTION AND BASICS OF Android NOTES.pptx
Day 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
Android Introduction

Recently uploaded (20)

PPTX
Spectroscopy.pptx food analysis technology
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
KodekX | Application Modernization Development
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPT
Teaching material agriculture food technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Machine learning based COVID-19 study performance prediction
PDF
Empathic Computing: Creating Shared Understanding
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
Spectroscopy.pptx food analysis technology
Advanced Soft Computing BINUS July 2025.pdf
Modernizing your data center with Dell and AMD
KodekX | Application Modernization Development
Network Security Unit 5.pdf for BCA BBA.
Chapter 3 Spatial Domain Image Processing.pdf
Teaching material agriculture food technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
Sensors and Actuators in IoT Systems using pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Understanding_Digital_Forensics_Presentation.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Spectral efficient network and resource selection model in 5G networks
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Machine learning based COVID-19 study performance prediction
Empathic Computing: Creating Shared Understanding
Mobile App Security Testing_ A Comprehensive Guide.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Reach Out and Touch Someone: Haptics and Empathic Computing

Android UI Fundamentals part 1