Android course
Lesson two
By Callum Taylor
with help from Tim Mathews and Matt Allen
Lesson 2
Introduction
• All slides can be found over at
slideshare.net/3sidedcube/android-course-lesson2-45477308
• Twitter/Github
@scruffyfox / @3sidedcube
• All code for this lesson can be found over at
github.com/3sidedcube/Android-BBCNews/tree/Lesson-2
Lesson 2
What we're making
Lesson 2
What we're making
• Fragments
• List views (and recycler views)
• ArrayAdapter/BaseAdapter
• ViewHolder pattern
• "Tablet" landscape handling
Lesson 2
IDE Tips
+
Lesson 2
IDE Tips
+
Lesson 2
IDE Tips
+
Lesson 2
IDE Tips
+
Lesson 2
How ListViews work
Lesson 2
Fragments
How adapters work
Lesson 2
Adapters are awesome
• It's an interface
• Standard, generic way to control a dataset and views
(MVC)
• Very customisable
• You can write your own "adapters"
Lesson 2
What an adapter looks like
Data Source ListView
Adapter
ArrayList SQL
Array Map
FragmentAdapter
LinearLayout
Lesson 2
Adapter methods
• getCount()
• getItem(int pos)
• getItemId(int pos)
• getView(int pos, View convertView, ViewGroup parent)
Lesson 2
Title Text
• getCount()
Exactly what it says, returns the number of items in the data
set
Lesson 2
Title Text
• getItem(int position)
Returns the item at the given position from the data set
Lesson 2
Title Text
• getItemId(int position)
Returns the an optional ID of the item at the given position.
ID/Representation of the item to increase performance of
the list view
Lesson 2
Title Text
• getView(int position, View convertView, ViewGroup
parent)
Returns the view in the list. This is where we do all of our
data/view inflation for the list to display on screen
position is the position of the item in the data list
convertView is the view that will be shown
parent is the parent view of the view being shown (usually
the list view)

More Related Content

PPTX
Native mobile applications with Eclipse Dirigible and Tabris.js
PPT
A Noob’S Guide To Android Application Development
PPTX
Android Application WebAPI Development Training
PPT
Android Application Development Basic
PDF
Webinar learn how to test any mobile app style from within eclipse using real...
ZIP
Android Application Development
PPT
Mobile Application Development With Android
PPT
Day: 2 Environment Setup for Android Application Development
Native mobile applications with Eclipse Dirigible and Tabris.js
A Noob’S Guide To Android Application Development
Android Application WebAPI Development Training
Android Application Development Basic
Webinar learn how to test any mobile app style from within eclipse using real...
Android Application Development
Mobile Application Development With Android
Day: 2 Environment Setup for Android Application Development

Similar to Android course Lesson2 (20)

PPTX
Introduction to Listview in Android
PPTX
Android Training (AdapterView & Adapter)
PDF
Day 8: Dealing with Lists and ListViews
PDF
Lab2-android
PPTX
chp 4 UI component hdjdjdduudfinalt.pptx
ODP
Android App Development - 11 Lists, grids, adapters, dialogs and toasts
PDF
Dinosaurs and Androids: The Listview Evolution
PPTX
Day 5 android app code advancement
DOCX
Android list view tutorial by Javatechig
PDF
List Views
PPTX
Lecture 4: Android All Kinds of Lists.pptx
PPTX
MDAD 4 - Lists, adapters and recycling
PPTX
MDAD 5 - Android - Lists, adapters and recycling
PDF
Adapter and cache technique
PPTX
List view1
PPTX
05 content providers - Android
PDF
Android ui adapter
PPTX
Android bootcamp 2013 Lists & Adapter
PPTX
List view5
Introduction to Listview in Android
Android Training (AdapterView & Adapter)
Day 8: Dealing with Lists and ListViews
Lab2-android
chp 4 UI component hdjdjdduudfinalt.pptx
Android App Development - 11 Lists, grids, adapters, dialogs and toasts
Dinosaurs and Androids: The Listview Evolution
Day 5 android app code advancement
Android list view tutorial by Javatechig
List Views
Lecture 4: Android All Kinds of Lists.pptx
MDAD 4 - Lists, adapters and recycling
MDAD 5 - Android - Lists, adapters and recycling
Adapter and cache technique
List view1
05 content providers - Android
Android ui adapter
Android bootcamp 2013 Lists & Adapter
List view5
Ad

Recently uploaded (20)

PDF
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
PDF
Solved Past paper of Pediatric Health Nursing PHN BS Nursing 5th Semester
PDF
Controlled Drug Delivery System-NDDS UNIT-1 B.Pharm 7th sem
PDF
M.Tech in Aerospace Engineering | BIT Mesra
PDF
Myanmar Dental Journal, The Journal of the Myanmar Dental Association (2013).pdf
PPTX
What’s under the hood: Parsing standardized learning content for AI
PPTX
Integrated Management of Neonatal and Childhood Illnesses (IMNCI) – Unit IV |...
PPTX
CAPACITY BUILDING PROGRAMME IN ADOLESCENT EDUCATION
PDF
Journal of Dental Science - UDMY (2020).pdf
PDF
Journal of Dental Science - UDMY (2022).pdf
PDF
African Communication Research: A review
PDF
Nurlina - Urban Planner Portfolio (english ver)
PDF
semiconductor packaging in vlsi design fab
PDF
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
PDF
Laparoscopic Colorectal Surgery at WLH Hospital
PDF
1.Salivary gland disease.pdf 3.Bleeding and Clotting Disorders.pdf important
PDF
Horaris_Grups_25-26_Definitiu_15_07_25.pdf
PDF
Everyday Spelling and Grammar by Kathi Wyldeck
PPTX
2025 High Blood Pressure Guideline Slide Set.pptx
PPTX
PLASMA AND ITS CONSTITUENTS 123.pptx
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
Solved Past paper of Pediatric Health Nursing PHN BS Nursing 5th Semester
Controlled Drug Delivery System-NDDS UNIT-1 B.Pharm 7th sem
M.Tech in Aerospace Engineering | BIT Mesra
Myanmar Dental Journal, The Journal of the Myanmar Dental Association (2013).pdf
What’s under the hood: Parsing standardized learning content for AI
Integrated Management of Neonatal and Childhood Illnesses (IMNCI) – Unit IV |...
CAPACITY BUILDING PROGRAMME IN ADOLESCENT EDUCATION
Journal of Dental Science - UDMY (2020).pdf
Journal of Dental Science - UDMY (2022).pdf
African Communication Research: A review
Nurlina - Urban Planner Portfolio (english ver)
semiconductor packaging in vlsi design fab
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
Laparoscopic Colorectal Surgery at WLH Hospital
1.Salivary gland disease.pdf 3.Bleeding and Clotting Disorders.pdf important
Horaris_Grups_25-26_Definitiu_15_07_25.pdf
Everyday Spelling and Grammar by Kathi Wyldeck
2025 High Blood Pressure Guideline Slide Set.pptx
PLASMA AND ITS CONSTITUENTS 123.pptx
Ad

Android course Lesson2