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 (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

그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기
그렇게 커미터가 된다: Python을 통해 오픈소스 생태계 가르치기
Jeongkyu Shin
 

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

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

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.