SlideShare a Scribd company logo
HIT3328 / HIT8328 Software Development for
Mobile Devices
Dr. Rajesh Vasa, 2011
1
Twitter: @rvasa
Blog: http://rvasa.blogspot.com
Lecture 06
Menus and Lists
R. Vasa, 20112
Lecture Overview
•Working with Menus
•Using Frame Layout
•Adapters and Working with Simple Lists
R. Vasa, 20113
Menus
•Android offers a ‘Menu’ button, iOS does not
•Menus’ can be customised per activity
Menus have a label and an icon
Icon is strongly recommended by
the Android UI guidelines
Menu
Icons at different resolutions
should be provided (ideally)
R. Vasa, 20114
Creating a Menu
Name App (from Lecture
5)
Menus are defined as a
resource
We can use icons provided by
Android SDK (recommended)
We can use icons provided by
Android SDK (recommended)
R. Vasa, 20115
Menus are Resources
Convention is to place it
in ‘menu’ folder
R. Vasa, 20116
Wiring up a Menu to Show
Call back method that we have to write
Resource Identifier
XML Resource file is converted (inflated)
into a Menu object that will be rendered
(shown) on screen
XML Resource file is converted (inflated)
into a Menu object that will be rendered
(shown) on screen
R. Vasa, 20117
Handling Menu Click
Call back method that we have to write
R. Vasa, 20118
Toasting a Message
•There is often a need to show a message
for a short period and then fade on mobile
devices
•Android offers this via the Toast utility
R. Vasa, 20119
Toasting a Message
On Click
Message
displayed for a
second
R. Vasa, 20111
Creating a Toast
Duration can be customised
Android offers Toast.LENGTH_LONG,
Toast.LENGTH_SHORT as built in defaults
Duration can be customised
Android offers Toast.LENGTH_LONG,
Toast.LENGTH_SHORT as built in defaults
R. Vasa, 20111
Lecture Roadmap - Where are
we?
•Working with Menus
•Using Frame Layout
•Adapters and Working with Simple Lists
R. Vasa, 20111
Frame Layout Offers Overlays
•We often need a way to overlay multiple
views (or layouts) on top of each other
•Often with variation in transparency
•Frame Layout offers us this feature
•Frame Layout is also used to help create
Tab Panes in Android
R. Vasa, 20111
Simple Frame Layout (Light
Bulb)
Button is placed on top of Image View
n / Off Images are also placed on top of each othe
R. Vasa, 20111
Frame Layout - Code
2 Image Views and 1 Button in the same layout
R. Vasa, 20111
Frame Layout - Code
We control visibility explicitlyWe control visibility explicitly
R. Vasa, 20111
Light Bulb Logic
We flip the visibility of the images
Method is triggered onClickMethod is triggered onClick
R. Vasa, 20111
Lecture Roadmap - Where are
we?
•Working with Menus
•Using Frame Layout
•Adapters and Working with Simple
Lists
R. Vasa, 20111
A Simple List App.
Displays Latitude and Longitude of a location
R. Vasa, 20111
Constituents of a List based
screen
ListView
Text Views
R. Vasa, 20112
Lists get data via an Adapter
ListView
Data Source
Adapter
R. Vasa, 20112
Adapter Formats Data for
Display
ListView
Data Source
Adapter
Data is formatted for
display via customised
layout attached to the
Adapter
Data is formatted for
display via customised
layout attached to the
Adapter
R. Vasa, 20112
List Views are very flexible
We specify the
layout for each line
item of a list
Layout can be provided
as a resource file (XML)
R. Vasa, 20112
Adapter Feeds data to List
View
ListView
Data Source
Adapter
Data Source feeds data
to the Adapter for
formatting
Data Source feeds data
to the Adapter for
formatting
R. Vasa, 20112
Adapter Offers Separation of
Concerns
ListView
Data Source
Adapter
Data Source can be an
array, collection object,
external database, or an
external server
Data Source can be an
array, collection object,
external database, or an
external server
R. Vasa, 20112
Simple List App.
ListView
Data Source
Adapter
Domain Model:
HashMap (Cities, Location)
(Cities names)
(Simple Item
Layout)
R. Vasa, 20112
Domain Model
Ideally, you read an external resource
(Above data is hard-coded to illustrate concept)
R. Vasa, 20112
Wiring up Data - Adapter -
ListView
Activity extends ListActivity
We are using an Array Adapter
(others are available / you can
provide your own)
R. Vasa, 20112
Wiring up Data - Adapter -
ListView
We are using SDK provided layout style
(we can also write our own as an Layout XML)
R. Vasa, 20112
Wiring up Data - Adapter -
ListView
We are setting the data source to use
R. Vasa, 20113
Wiring up Data - Adapter -
ListView
Tell the List View to display from adapter
R. Vasa, 20113
Wiring up Data - Adapter -
ListView
Only one ListView can receive
data via the default
setListAdapter in an Activity
R. Vasa, 20113
Activity Layout
ListView that will receive data
provided via setListAdapter
R. Vasa, 20113
Activity Layout
ListView that will receive data
provided via setListAdapter
Special
built-in
identifier
Special
built-in
identifier
R. Vasa, 20113
Handling List Click Event
This call back is provided by the
parent (List Activity) class -- we
override it
This call back is provided by the
parent (List Activity) class -- we
override it
R. Vasa, 20113
But, what about complex lists?
Key concepts are the
same
We will cover it later in
depth
(if you are curious, look at examples
online)
R. Vasa, 20113
Lecture Summary
•Working with Menus
•Using Frame Layout
•Adapters and Working with Simple Lists

More Related Content

Similar to HIT3328 - Chapter0601 - Menus and Lists

Application fundamentals
Application fundamentalsApplication fundamentals
Application fundamentals
maamir farooq
 
ListView and Custom ListView on Android Development [Thai]
ListView and Custom ListView on Android Development [Thai]ListView and Custom ListView on Android Development [Thai]
ListView and Custom ListView on Android Development [Thai]
Somkiat Khitwongwattana
 
Android ui with xml
Android ui with xmlAndroid ui with xml
Android ui with xml
Egerton University
 
Internet data in mobile applications
Internet data in mobile applicationsInternet data in mobile applications
Internet data in mobile applications
Vishwak Solution
 
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDBAWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
Amazon Web Services
 
Cesar Valiente "Unidirectional architecture on Android with Kotlin"
Cesar Valiente "Unidirectional architecture on Android with Kotlin"Cesar Valiente "Unidirectional architecture on Android with Kotlin"
Cesar Valiente "Unidirectional architecture on Android with Kotlin"
IT Event
 
Android layouts
Android layoutsAndroid layouts
Android layouts
Jeffrey Quevedo
 
Android Deep Dive
Android Deep DiveAndroid Deep Dive
Android Deep Dive
Marko Gargenta
 
What is ado .net architecture_.pdf
What is ado .net architecture_.pdfWhat is ado .net architecture_.pdf
What is ado .net architecture_.pdf
Albert828253
 
Android resources in android-chapter9
Android resources in android-chapter9Android resources in android-chapter9
Android resources in android-chapter9
Dr. Ramkumar Lakshminarayanan
 
R hive tutorial - udf, udaf, udtf functions
R hive tutorial - udf, udaf, udtf functionsR hive tutorial - udf, udaf, udtf functions
R hive tutorial - udf, udaf, udtf functions
Aiden Seonghak Hong
 
1_Introduction.pptx
1_Introduction.pptx1_Introduction.pptx
1_Introduction.pptx
ranapoonam1
 
Introduction to Oracle Financials
Introduction to Oracle FinancialsIntroduction to Oracle Financials
Introduction to Oracle Financials
hasan2000
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-
TejamFandat
 
"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2
Tadas Jurelevičius
 
Localization and Shared Preferences in android
Localization and Shared Preferences in androidLocalization and Shared Preferences in android
Localization and Shared Preferences in android
Aly Arman
 
Programming Without Coding Technology (PWCT) Environment
Programming Without Coding Technology (PWCT) EnvironmentProgramming Without Coding Technology (PWCT) Environment
Programming Without Coding Technology (PWCT) Environment
Mahmoud Samir Fayed
 
R Course Online
R Course OnlineR Course Online
R Course Online
bestonlinecoursescoupon
 
Abap dictionary 1
Abap dictionary 1Abap dictionary 1
Abap dictionary 1
venkata karthik
 
Abap dictionary 1
Abap dictionary 1Abap dictionary 1
Abap dictionary 1
venkata karthik
 

Similar to HIT3328 - Chapter0601 - Menus and Lists (20)

Application fundamentals
Application fundamentalsApplication fundamentals
Application fundamentals
 
ListView and Custom ListView on Android Development [Thai]
ListView and Custom ListView on Android Development [Thai]ListView and Custom ListView on Android Development [Thai]
ListView and Custom ListView on Android Development [Thai]
 
Android ui with xml
Android ui with xmlAndroid ui with xml
Android ui with xml
 
Internet data in mobile applications
Internet data in mobile applicationsInternet data in mobile applications
Internet data in mobile applications
 
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDBAWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
 
Cesar Valiente "Unidirectional architecture on Android with Kotlin"
Cesar Valiente "Unidirectional architecture on Android with Kotlin"Cesar Valiente "Unidirectional architecture on Android with Kotlin"
Cesar Valiente "Unidirectional architecture on Android with Kotlin"
 
Android layouts
Android layoutsAndroid layouts
Android layouts
 
Android Deep Dive
Android Deep DiveAndroid Deep Dive
Android Deep Dive
 
What is ado .net architecture_.pdf
What is ado .net architecture_.pdfWhat is ado .net architecture_.pdf
What is ado .net architecture_.pdf
 
Android resources in android-chapter9
Android resources in android-chapter9Android resources in android-chapter9
Android resources in android-chapter9
 
R hive tutorial - udf, udaf, udtf functions
R hive tutorial - udf, udaf, udtf functionsR hive tutorial - udf, udaf, udtf functions
R hive tutorial - udf, udaf, udtf functions
 
1_Introduction.pptx
1_Introduction.pptx1_Introduction.pptx
1_Introduction.pptx
 
Introduction to Oracle Financials
Introduction to Oracle FinancialsIntroduction to Oracle Financials
Introduction to Oracle Financials
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-
 
"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2
 
Localization and Shared Preferences in android
Localization and Shared Preferences in androidLocalization and Shared Preferences in android
Localization and Shared Preferences in android
 
Programming Without Coding Technology (PWCT) Environment
Programming Without Coding Technology (PWCT) EnvironmentProgramming Without Coding Technology (PWCT) Environment
Programming Without Coding Technology (PWCT) Environment
 
R Course Online
R Course OnlineR Course Online
R Course Online
 
Abap dictionary 1
Abap dictionary 1Abap dictionary 1
Abap dictionary 1
 
Abap dictionary 1
Abap dictionary 1Abap dictionary 1
Abap dictionary 1
 

More from Yhal Htet Aung

HIT3328 - Chapter0702 - Navigation Flow and Design Approach
HIT3328 - Chapter0702 - Navigation Flow and Design ApproachHIT3328 - Chapter0702 - Navigation Flow and Design Approach
HIT3328 - Chapter0702 - Navigation Flow and Design Approach
Yhal Htet Aung
 
HIT3328 - Chapter02 - Foundation and Tools
HIT3328 - Chapter02 - Foundation and ToolsHIT3328 - Chapter02 - Foundation and Tools
HIT3328 - Chapter02 - Foundation and Tools
Yhal Htet Aung
 
HIT3328 - Chapter01 - Platforms and Devices
HIT3328 - Chapter01 - Platforms and DevicesHIT3328 - Chapter01 - Platforms and Devices
HIT3328 - Chapter01 - Platforms and Devices
Yhal Htet Aung
 
CSC1100 - Chapter11 - Programming Languages and Program Development
CSC1100 - Chapter11 - Programming Languages and Program DevelopmentCSC1100 - Chapter11 - Programming Languages and Program Development
CSC1100 - Chapter11 - Programming Languages and Program Development
Yhal Htet Aung
 
CSC1100 - Chapter10 - Information System
CSC1100 - Chapter10 - Information SystemCSC1100 - Chapter10 - Information System
CSC1100 - Chapter10 - Information System
Yhal Htet Aung
 
CSC1100 - Chapter09 - Computer Security, Ethics and Privacy
CSC1100 - Chapter09 - Computer Security, Ethics and PrivacyCSC1100 - Chapter09 - Computer Security, Ethics and Privacy
CSC1100 - Chapter09 - Computer Security, Ethics and Privacy
Yhal Htet Aung
 
CSC1100 - Chapter08 - Database Management
CSC1100 - Chapter08 - Database ManagementCSC1100 - Chapter08 - Database Management
CSC1100 - Chapter08 - Database Management
Yhal Htet Aung
 
CSC1100 - Chapter07 - Communications & Networks
CSC1100 - Chapter07 - Communications & NetworksCSC1100 - Chapter07 - Communications & Networks
CSC1100 - Chapter07 - Communications & Networks
Yhal Htet Aung
 
CSC1100 - Chapter06 - Operating System & Utility Programs
CSC1100 - Chapter06 - Operating System & Utility ProgramsCSC1100 - Chapter06 - Operating System & Utility Programs
CSC1100 - Chapter06 - Operating System & Utility Programs
Yhal Htet Aung
 
CSC1100 - Chapter05 - Storage
CSC1100 - Chapter05 - StorageCSC1100 - Chapter05 - Storage
CSC1100 - Chapter05 - Storage
Yhal Htet Aung
 
CSC1100 - Chapter04 - Output
CSC1100 - Chapter04 - OutputCSC1100 - Chapter04 - Output
CSC1100 - Chapter04 - Output
Yhal Htet Aung
 
CSC1100 - Chapter03 - Input
CSC1100 - Chapter03 - InputCSC1100 - Chapter03 - Input
CSC1100 - Chapter03 - Input
Yhal Htet Aung
 
CSC1100 - Chapter02 - Components of the System Unit
CSC1100 - Chapter02 - Components of the System UnitCSC1100 - Chapter02 - Components of the System Unit
CSC1100 - Chapter02 - Components of the System Unit
Yhal Htet Aung
 
CSC1100 - Chapter01 - Overview of Using Computers
CSC1100 - Chapter01 - Overview of Using ComputersCSC1100 - Chapter01 - Overview of Using Computers
CSC1100 - Chapter01 - Overview of Using Computers
Yhal Htet Aung
 
CSC1100 - Chapter12 - Flow Charts
CSC1100 - Chapter12 - Flow ChartsCSC1100 - Chapter12 - Flow Charts
CSC1100 - Chapter12 - Flow Charts
Yhal Htet Aung
 

More from Yhal Htet Aung (15)

HIT3328 - Chapter0702 - Navigation Flow and Design Approach
HIT3328 - Chapter0702 - Navigation Flow and Design ApproachHIT3328 - Chapter0702 - Navigation Flow and Design Approach
HIT3328 - Chapter0702 - Navigation Flow and Design Approach
 
HIT3328 - Chapter02 - Foundation and Tools
HIT3328 - Chapter02 - Foundation and ToolsHIT3328 - Chapter02 - Foundation and Tools
HIT3328 - Chapter02 - Foundation and Tools
 
HIT3328 - Chapter01 - Platforms and Devices
HIT3328 - Chapter01 - Platforms and DevicesHIT3328 - Chapter01 - Platforms and Devices
HIT3328 - Chapter01 - Platforms and Devices
 
CSC1100 - Chapter11 - Programming Languages and Program Development
CSC1100 - Chapter11 - Programming Languages and Program DevelopmentCSC1100 - Chapter11 - Programming Languages and Program Development
CSC1100 - Chapter11 - Programming Languages and Program Development
 
CSC1100 - Chapter10 - Information System
CSC1100 - Chapter10 - Information SystemCSC1100 - Chapter10 - Information System
CSC1100 - Chapter10 - Information System
 
CSC1100 - Chapter09 - Computer Security, Ethics and Privacy
CSC1100 - Chapter09 - Computer Security, Ethics and PrivacyCSC1100 - Chapter09 - Computer Security, Ethics and Privacy
CSC1100 - Chapter09 - Computer Security, Ethics and Privacy
 
CSC1100 - Chapter08 - Database Management
CSC1100 - Chapter08 - Database ManagementCSC1100 - Chapter08 - Database Management
CSC1100 - Chapter08 - Database Management
 
CSC1100 - Chapter07 - Communications & Networks
CSC1100 - Chapter07 - Communications & NetworksCSC1100 - Chapter07 - Communications & Networks
CSC1100 - Chapter07 - Communications & Networks
 
CSC1100 - Chapter06 - Operating System & Utility Programs
CSC1100 - Chapter06 - Operating System & Utility ProgramsCSC1100 - Chapter06 - Operating System & Utility Programs
CSC1100 - Chapter06 - Operating System & Utility Programs
 
CSC1100 - Chapter05 - Storage
CSC1100 - Chapter05 - StorageCSC1100 - Chapter05 - Storage
CSC1100 - Chapter05 - Storage
 
CSC1100 - Chapter04 - Output
CSC1100 - Chapter04 - OutputCSC1100 - Chapter04 - Output
CSC1100 - Chapter04 - Output
 
CSC1100 - Chapter03 - Input
CSC1100 - Chapter03 - InputCSC1100 - Chapter03 - Input
CSC1100 - Chapter03 - Input
 
CSC1100 - Chapter02 - Components of the System Unit
CSC1100 - Chapter02 - Components of the System UnitCSC1100 - Chapter02 - Components of the System Unit
CSC1100 - Chapter02 - Components of the System Unit
 
CSC1100 - Chapter01 - Overview of Using Computers
CSC1100 - Chapter01 - Overview of Using ComputersCSC1100 - Chapter01 - Overview of Using Computers
CSC1100 - Chapter01 - Overview of Using Computers
 
CSC1100 - Chapter12 - Flow Charts
CSC1100 - Chapter12 - Flow ChartsCSC1100 - Chapter12 - Flow Charts
CSC1100 - Chapter12 - Flow Charts
 

Recently uploaded

Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 

Recently uploaded (20)

Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 

HIT3328 - Chapter0601 - Menus and Lists

  • 1. HIT3328 / HIT8328 Software Development for Mobile Devices Dr. Rajesh Vasa, 2011 1 Twitter: @rvasa Blog: http://rvasa.blogspot.com Lecture 06 Menus and Lists
  • 2. R. Vasa, 20112 Lecture Overview •Working with Menus •Using Frame Layout •Adapters and Working with Simple Lists
  • 3. R. Vasa, 20113 Menus •Android offers a ‘Menu’ button, iOS does not •Menus’ can be customised per activity Menus have a label and an icon Icon is strongly recommended by the Android UI guidelines Menu Icons at different resolutions should be provided (ideally)
  • 4. R. Vasa, 20114 Creating a Menu Name App (from Lecture 5) Menus are defined as a resource We can use icons provided by Android SDK (recommended) We can use icons provided by Android SDK (recommended)
  • 5. R. Vasa, 20115 Menus are Resources Convention is to place it in ‘menu’ folder
  • 6. R. Vasa, 20116 Wiring up a Menu to Show Call back method that we have to write Resource Identifier XML Resource file is converted (inflated) into a Menu object that will be rendered (shown) on screen XML Resource file is converted (inflated) into a Menu object that will be rendered (shown) on screen
  • 7. R. Vasa, 20117 Handling Menu Click Call back method that we have to write
  • 8. R. Vasa, 20118 Toasting a Message •There is often a need to show a message for a short period and then fade on mobile devices •Android offers this via the Toast utility
  • 9. R. Vasa, 20119 Toasting a Message On Click Message displayed for a second
  • 10. R. Vasa, 20111 Creating a Toast Duration can be customised Android offers Toast.LENGTH_LONG, Toast.LENGTH_SHORT as built in defaults Duration can be customised Android offers Toast.LENGTH_LONG, Toast.LENGTH_SHORT as built in defaults
  • 11. R. Vasa, 20111 Lecture Roadmap - Where are we? •Working with Menus •Using Frame Layout •Adapters and Working with Simple Lists
  • 12. R. Vasa, 20111 Frame Layout Offers Overlays •We often need a way to overlay multiple views (or layouts) on top of each other •Often with variation in transparency •Frame Layout offers us this feature •Frame Layout is also used to help create Tab Panes in Android
  • 13. R. Vasa, 20111 Simple Frame Layout (Light Bulb) Button is placed on top of Image View n / Off Images are also placed on top of each othe
  • 14. R. Vasa, 20111 Frame Layout - Code 2 Image Views and 1 Button in the same layout
  • 15. R. Vasa, 20111 Frame Layout - Code We control visibility explicitlyWe control visibility explicitly
  • 16. R. Vasa, 20111 Light Bulb Logic We flip the visibility of the images Method is triggered onClickMethod is triggered onClick
  • 17. R. Vasa, 20111 Lecture Roadmap - Where are we? •Working with Menus •Using Frame Layout •Adapters and Working with Simple Lists
  • 18. R. Vasa, 20111 A Simple List App. Displays Latitude and Longitude of a location
  • 19. R. Vasa, 20111 Constituents of a List based screen ListView Text Views
  • 20. R. Vasa, 20112 Lists get data via an Adapter ListView Data Source Adapter
  • 21. R. Vasa, 20112 Adapter Formats Data for Display ListView Data Source Adapter Data is formatted for display via customised layout attached to the Adapter Data is formatted for display via customised layout attached to the Adapter
  • 22. R. Vasa, 20112 List Views are very flexible We specify the layout for each line item of a list Layout can be provided as a resource file (XML)
  • 23. R. Vasa, 20112 Adapter Feeds data to List View ListView Data Source Adapter Data Source feeds data to the Adapter for formatting Data Source feeds data to the Adapter for formatting
  • 24. R. Vasa, 20112 Adapter Offers Separation of Concerns ListView Data Source Adapter Data Source can be an array, collection object, external database, or an external server Data Source can be an array, collection object, external database, or an external server
  • 25. R. Vasa, 20112 Simple List App. ListView Data Source Adapter Domain Model: HashMap (Cities, Location) (Cities names) (Simple Item Layout)
  • 26. R. Vasa, 20112 Domain Model Ideally, you read an external resource (Above data is hard-coded to illustrate concept)
  • 27. R. Vasa, 20112 Wiring up Data - Adapter - ListView Activity extends ListActivity We are using an Array Adapter (others are available / you can provide your own)
  • 28. R. Vasa, 20112 Wiring up Data - Adapter - ListView We are using SDK provided layout style (we can also write our own as an Layout XML)
  • 29. R. Vasa, 20112 Wiring up Data - Adapter - ListView We are setting the data source to use
  • 30. R. Vasa, 20113 Wiring up Data - Adapter - ListView Tell the List View to display from adapter
  • 31. R. Vasa, 20113 Wiring up Data - Adapter - ListView Only one ListView can receive data via the default setListAdapter in an Activity
  • 32. R. Vasa, 20113 Activity Layout ListView that will receive data provided via setListAdapter
  • 33. R. Vasa, 20113 Activity Layout ListView that will receive data provided via setListAdapter Special built-in identifier Special built-in identifier
  • 34. R. Vasa, 20113 Handling List Click Event This call back is provided by the parent (List Activity) class -- we override it This call back is provided by the parent (List Activity) class -- we override it
  • 35. R. Vasa, 20113 But, what about complex lists? Key concepts are the same We will cover it later in depth (if you are curious, look at examples online)
  • 36. R. Vasa, 20113 Lecture Summary •Working with Menus •Using Frame Layout •Adapters and Working with Simple Lists