SlideShare a Scribd company logo
1 of 18
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
Android
Lesson 2 by Callum Taylor
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
Introduction
• All code and presentation slides can be
found over at
https://github.com/scruffyfox/AndroidCours
e
• Twitter/app.net/github: @scruffyfox
• http://(blog.)callumtaylor.net
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
Introduction
https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
What we’re going to make
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
What we’re going to make
• ListView
• ArrayAdapter/BaseAdapter
• findViewById
• View Holder paradigm
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
IDE Tips
+
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
IDE Tips
+
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
IDE Tips
+
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
IDE Tips
+
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How R.java works
R.layout.list_item
R.id.name
R.drawable.ic_launcher
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How R.java works
R.string.hello_world
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How Adapters work
• getCount()
• getItem(int position)
• getItemId(int position)
• getView(int position, View convertView,
ViewGroup parent)
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How Adapters work
• getCount()
Exactly what it says – returns the number of
items in the current data set
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How Adapters work
• getItem(int position)
Returns the item from the data set at the
specific position
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How Adapters work
• getItemId(int position)
Returns the item’s id at the position. Can just
return 0, but return a reliable int
ID/representation of the item to increase
performance of the list view
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How Adapters work
• getView(int position, View convertView,
ViewGroup parent)
Returns the view in the list. This is where we do all of
our data inflating into the screen which the user sees.
Position is the position of the item in the dataset
ConvertView is the view that will be shown
Parent is the parent view of the view being shown
(usually the list view)
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How List Views work
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How List Views work
• getView(int position, View convertView,
ViewGroup parent)

More Related Content

Viewers also liked

Android Course - Lesson4
Android Course - Lesson4Android Course - Lesson4
Android Course - Lesson4Callum Taylor
 
Android Course - Lesson1
Android Course - Lesson1Android Course - Lesson1
Android Course - Lesson1Callum Taylor
 
A beginner’s guide to using an android phone
A beginner’s guide to using an android phoneA beginner’s guide to using an android phone
A beginner’s guide to using an android phonetechtoonist
 
Android app development lesson 1
Android app development lesson 1Android app development lesson 1
Android app development lesson 1Kalluri Vinay Reddy
 
Build your first android mobile app
Build your first android mobile appBuild your first android mobile app
Build your first android mobile appekipaco
 

Viewers also liked (6)

Android Course - Lesson4
Android Course - Lesson4Android Course - Lesson4
Android Course - Lesson4
 
Android Course - Lesson1
Android Course - Lesson1Android Course - Lesson1
Android Course - Lesson1
 
Why you should invest in Mobile Apps Development?
Why you should invest in Mobile Apps Development?Why you should invest in Mobile Apps Development?
Why you should invest in Mobile Apps Development?
 
A beginner’s guide to using an android phone
A beginner’s guide to using an android phoneA beginner’s guide to using an android phone
A beginner’s guide to using an android phone
 
Android app development lesson 1
Android app development lesson 1Android app development lesson 1
Android app development lesson 1
 
Build your first android mobile app
Build your first android mobile appBuild your first android mobile app
Build your first android mobile app
 

Similar to Android Course - Lesson2

Android Course - Lesson3
Android Course - Lesson3Android Course - Lesson3
Android Course - Lesson3Callum Taylor
 
Android course Lesson2
Android course Lesson2Android course Lesson2
Android course Lesson23sidedcube
 
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기Jeongkyu Shin
 
With a little help from my friends: Handy MongoDB Tools
With a little help from my friends: Handy MongoDB ToolsWith a little help from my friends: Handy MongoDB Tools
With a little help from my friends: Handy MongoDB ToolsStennie Steneker
 
iOSアプリのライブラリ依存管理ツールとして Swift Package Managerを使うのは まだしばらく先かなと思った話
iOSアプリのライブラリ依存管理ツールとして Swift Package Managerを使うのは まだしばらく先かなと思った話iOSアプリのライブラリ依存管理ツールとして Swift Package Managerを使うのは まだしばらく先かなと思った話
iOSアプリのライブラリ依存管理ツールとして Swift Package Managerを使うのは まだしばらく先かなと思った話将之 小野
 
An overview of JavaScript and Node.js
An overview of JavaScript and Node.jsAn overview of JavaScript and Node.js
An overview of JavaScript and Node.jsLuciano Mammino
 

Similar to Android Course - Lesson2 (7)

Android Course - Lesson3
Android Course - Lesson3Android Course - Lesson3
Android Course - Lesson3
 
Android course Lesson2
Android course Lesson2Android course Lesson2
Android course Lesson2
 
Evolution and AI
Evolution and AIEvolution and AI
Evolution and AI
 
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기
 
With a little help from my friends: Handy MongoDB Tools
With a little help from my friends: Handy MongoDB ToolsWith a little help from my friends: Handy MongoDB Tools
With a little help from my friends: Handy MongoDB Tools
 
iOSアプリのライブラリ依存管理ツールとして Swift Package Managerを使うのは まだしばらく先かなと思った話
iOSアプリのライブラリ依存管理ツールとして Swift Package Managerを使うのは まだしばらく先かなと思った話iOSアプリのライブラリ依存管理ツールとして Swift Package Managerを使うのは まだしばらく先かなと思った話
iOSアプリのライブラリ依存管理ツールとして Swift Package Managerを使うのは まだしばらく先かなと思った話
 
An overview of JavaScript and Node.js
An overview of JavaScript and Node.jsAn overview of JavaScript and Node.js
An overview of JavaScript and Node.js
 

Recently uploaded

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 

Recently uploaded (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Android Course - Lesson2

  • 1. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 Android Lesson 2 by Callum Taylor
  • 2. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 Introduction • All code and presentation slides can be found over at https://github.com/scruffyfox/AndroidCours e • Twitter/app.net/github: @scruffyfox • http://(blog.)callumtaylor.net
  • 3. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 Introduction https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
  • 4. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 What we’re going to make
  • 5. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 What we’re going to make • ListView • ArrayAdapter/BaseAdapter • findViewById • View Holder paradigm
  • 6. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 IDE Tips +
  • 7. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 IDE Tips +
  • 8. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 IDE Tips +
  • 9. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 IDE Tips +
  • 10. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How R.java works R.layout.list_item R.id.name R.drawable.ic_launcher
  • 11. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How R.java works R.string.hello_world
  • 12. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How Adapters work • getCount() • getItem(int position) • getItemId(int position) • getView(int position, View convertView, ViewGroup parent)
  • 13. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How Adapters work • getCount() Exactly what it says – returns the number of items in the current data set
  • 14. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How Adapters work • getItem(int position) Returns the item from the data set at the specific position
  • 15. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How Adapters work • getItemId(int position) Returns the item’s id at the position. Can just return 0, but return a reliable int ID/representation of the item to increase performance of the list view
  • 16. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How Adapters work • getView(int position, View convertView, ViewGroup parent) Returns the view in the list. This is where we do all of our data inflating into the screen which the user sees. Position is the position of the item in the dataset ConvertView is the view that will be shown Parent is the parent view of the view being shown (usually the list view)
  • 17. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How List Views work
  • 18. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How List Views work • getView(int position, View convertView, ViewGroup parent)

Editor's Notes

  1. This is what we’re going to make today
  2. This is what we’re going to make today
  3. Control + space will be the most popular shortcut you use, pressing it will bring up the codesense suggestion dialog when you type to allow you to find the method/variable you’re looking for. It will also bring up the documentation for the highlighted method. Press enter to auto complete
  4. Pressing alt and enter will open up the quick fix menu which will give you some useful functions such as refracting a string or reversing an if statement
  5. Pressing control and enter will bring up the generate menu which is useful when overriding methods from the super class you don’t know the name of
  6. Pressing control and p will bring up the parameters for a method as you’re typing.