SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
http://android.amberfog.com/?p=296
Join room on qicus
bit.ly/androiduii
Listview and Adapter
Arif Akbarul Huda
Android Developer di qiscus
Penulis buku “Livecoding! 9 Aplikasi Android
Buatan Sendiri”
omayib@gmail.com (email) | @omayib (Twitter)
“jika pelukis memilki kanvas untuk mencurahkan imajinasinya,
Maka programmer punya RAM yang bisa di manipulasi sesuai
imajinasi”
Good reference
● javatpoint.com/java-oops-
concepts
● oodesign.com
● c4learn.com
● Livecoding! 9 Aplikasi
Android Buatan Sendiri
Behind the screen
How it works?
● ListView asks adapter “give me a view”
(getView) for each item of the list
● A new View is returned and displayed
Q : what if we have one billion items? Create new
view for each item?
Q : what if we have one billion items? Create new
view for each item?
A : Android caches views for you :)
ListView is designed for scalability and
performance. In practice, this essentially means:
● It tries to do as few view inflations as possible.
● It only paints and lays out children that are (or
are about to become) visible on screencode.
http://lucasr.org/2012/04/05/performance-tips-for-androids-listview/
Add Item Clear
User : add item 1 and dispay it!
ListView : “hey adapter, give me a view..!”
Adapter : “ok, but we don't have”
“i will create a view by inflating selected layout”
“then I will keep this view on my scrapview collection
for use letter”
“wait a seconds..i set your data”
“oke done, there is a view for you”
ListView : “yah! Thanks, render was succedeed”
Item 1
View tag : 001
Add Item Clear
User : add item 2 and dispay it!
ListView : “hey adapter, give me a view..!”
Adapter : “ok, but the view I created before still used
for item 1 so we don't have any stock”
“i will create a view by inflating selected layout (again)”
“then I will keep this view on my scrapview collection
for use letter”
“wait a seconds..i set your data”
“oke done, there is a view for you”
ListView : “yah! Thanks, render was succedeed”
Item 1
Item 2
View tag : 001
View tag : 002
Add Item Clear
User : add item 11 and dispay it!
ListView : “hey adapter, give me a view..!”
Adapter : “i am sorry, the view will come outer space.
We no need to render it”
But I will keep current data (item 11) to set leter after
user scrolling down”
ListView : “oke noted!”
Item 1
Item 2
...
Item 9
Item 10
Item 11
View tag : 001
View tag : 002
View tag : 009
View tag : 010
Add Item Clear
Adapter : “Hei look, user move scrolling up!”
“the view with tag 001 has been released and not
used”
“i will use this view to display current data (item 11)
ListView : “oke rendered!”
Item 2
Item 3
...
Item 10
Item 11
Item 1
View tag : 001
Lets try to practice it!
See project on
https://github.com/omayib/ListviewInspection

Mais conteúdo relacionado

Mais procurados

Android Layout
Android LayoutAndroid Layout
Android Layoutmcanotes
 
Android app material design from dev's perspective
Android app material design from dev's perspectiveAndroid app material design from dev's perspective
Android app material design from dev's perspectiveDeSmart Agile Software House
 
Android Lollipop - Webinar vom 11.12.2014
Android Lollipop - Webinar vom 11.12.2014Android Lollipop - Webinar vom 11.12.2014
Android Lollipop - Webinar vom 11.12.2014inovex GmbH
 
Modules in AngularJs
Modules in AngularJsModules in AngularJs
Modules in AngularJsK Arunkumar
 
Migrating From Angular 1.x to Angular 2+
Migrating From Angular 1.x to Angular 2+Migrating From Angular 1.x to Angular 2+
Migrating From Angular 1.x to Angular 2+Asim Hussain
 
Migrating from AngularJS when you can't use the word "Big Bang@
Migrating from AngularJS when you can't use the word "Big Bang@Migrating from AngularJS when you can't use the word "Big Bang@
Migrating from AngularJS when you can't use the word "Big Bang@Asim Hussain
 
Introduction To Angular 4 - J2I
Introduction To Angular 4 - J2IIntroduction To Angular 4 - J2I
Introduction To Angular 4 - J2INader Debbabi
 
API Integration in Web Application
API Integration in Web ApplicationAPI Integration in Web Application
API Integration in Web Applicationijtsrd
 
Angular components
Angular componentsAngular components
Angular componentsSultan Ahmed
 
How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...Appear
 
Designing REST API
Designing REST APIDesigning REST API
Designing REST APIJoseph Jude
 
Machine Learning Software Design Pattern with PredictionIO
Machine Learning Software Design Pattern with PredictionIOMachine Learning Software Design Pattern with PredictionIO
Machine Learning Software Design Pattern with PredictionIOTuri, Inc.
 
Introduce to PredictionIO
Introduce to PredictionIOIntroduce to PredictionIO
Introduce to PredictionIOWei-Yuan Chang
 
Beyond AngularJS: Best practices and more
Beyond AngularJS: Best practices and moreBeyond AngularJS: Best practices and more
Beyond AngularJS: Best practices and moreAri Lerner
 

Mais procurados (20)

Android Layout
Android LayoutAndroid Layout
Android Layout
 
Android app material design from dev's perspective
Android app material design from dev's perspectiveAndroid app material design from dev's perspective
Android app material design from dev's perspective
 
Android Lollipop - Webinar vom 11.12.2014
Android Lollipop - Webinar vom 11.12.2014Android Lollipop - Webinar vom 11.12.2014
Android Lollipop - Webinar vom 11.12.2014
 
Alloy backbone
Alloy backboneAlloy backbone
Alloy backbone
 
Dash of ajax
Dash of ajaxDash of ajax
Dash of ajax
 
Modules in AngularJs
Modules in AngularJsModules in AngularJs
Modules in AngularJs
 
Migrating From Angular 1.x to Angular 2+
Migrating From Angular 1.x to Angular 2+Migrating From Angular 1.x to Angular 2+
Migrating From Angular 1.x to Angular 2+
 
Angular material
Angular materialAngular material
Angular material
 
Advance Android Layout Walkthrough
Advance Android Layout WalkthroughAdvance Android Layout Walkthrough
Advance Android Layout Walkthrough
 
Migrating from AngularJS when you can't use the word "Big Bang@
Migrating from AngularJS when you can't use the word "Big Bang@Migrating from AngularJS when you can't use the word "Big Bang@
Migrating from AngularJS when you can't use the word "Big Bang@
 
Introduction To Angular 4 - J2I
Introduction To Angular 4 - J2IIntroduction To Angular 4 - J2I
Introduction To Angular 4 - J2I
 
API Integration in Web Application
API Integration in Web ApplicationAPI Integration in Web Application
API Integration in Web Application
 
Angular components
Angular componentsAngular components
Angular components
 
How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...
 
AngularJS
AngularJSAngularJS
AngularJS
 
Designing REST API
Designing REST APIDesigning REST API
Designing REST API
 
Machine Learning Software Design Pattern with PredictionIO
Machine Learning Software Design Pattern with PredictionIOMachine Learning Software Design Pattern with PredictionIO
Machine Learning Software Design Pattern with PredictionIO
 
Introduce to PredictionIO
Introduce to PredictionIOIntroduce to PredictionIO
Introduce to PredictionIO
 
Beyond AngularJS: Best practices and more
Beyond AngularJS: Best practices and moreBeyond AngularJS: Best practices and more
Beyond AngularJS: Best practices and more
 
Starting with angular js
Starting with angular js Starting with angular js
Starting with angular js
 

Semelhante a Listview and Adapter

Performance and Optmization - a technical talk at Frontend London
Performance and Optmization - a technical talk at Frontend LondonPerformance and Optmization - a technical talk at Frontend London
Performance and Optmization - a technical talk at Frontend Londonthomas alisi
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation Phan Tuan
 
A Big Picture Of AngularJS
A Big Picture Of AngularJSA Big Picture Of AngularJS
A Big Picture Of AngularJSNitin Pandit
 
Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshareSaleemMalik52
 
Angular1x and Angular 2 for Beginners
Angular1x and Angular 2 for BeginnersAngular1x and Angular 2 for Beginners
Angular1x and Angular 2 for BeginnersOswald Campesato
 
Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1フ乇丂ひ丂
 
angularjsmeetup-150303044616-conversion-gate01
angularjsmeetup-150303044616-conversion-gate01angularjsmeetup-150303044616-conversion-gate01
angularjsmeetup-150303044616-conversion-gate01Teo E
 
Comparing Angular and React JS for SPAs
Comparing Angular and React JS for SPAsComparing Angular and React JS for SPAs
Comparing Angular and React JS for SPAsJennifer Estrada
 
[143]Inside fuse deview 2016
[143]Inside fuse   deview 2016[143]Inside fuse   deview 2016
[143]Inside fuse deview 2016NAVER D2
 
Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps Ahmed Bouchefra
 
Projects In JavaScript And JQuery | Eduonix
Projects In JavaScript And JQuery | EduonixProjects In JavaScript And JQuery | Eduonix
Projects In JavaScript And JQuery | EduonixRakhi Lambha
 
Angular.js Talk at the November Meetup of the BerlinJS User Group
Angular.js Talk at the November Meetup of the BerlinJS User GroupAngular.js Talk at the November Meetup of the BerlinJS User Group
Angular.js Talk at the November Meetup of the BerlinJS User GroupManuel Kießling
 
Building a dashboard using AngularJS
Building a dashboard using AngularJSBuilding a dashboard using AngularJS
Building a dashboard using AngularJSRajthilakMCA
 

Semelhante a Listview and Adapter (20)

Performance and Optmization - a technical talk at Frontend London
Performance and Optmization - a technical talk at Frontend LondonPerformance and Optmization - a technical talk at Frontend London
Performance and Optmization - a technical talk at Frontend London
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
 
AngularJS 101
AngularJS 101AngularJS 101
AngularJS 101
 
A Big Picture Of AngularJS
A Big Picture Of AngularJSA Big Picture Of AngularJS
A Big Picture Of AngularJS
 
Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshare
 
Angular1x and Angular 2 for Beginners
Angular1x and Angular 2 for BeginnersAngular1x and Angular 2 for Beginners
Angular1x and Angular 2 for Beginners
 
Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1
 
angularjsmeetup-150303044616-conversion-gate01
angularjsmeetup-150303044616-conversion-gate01angularjsmeetup-150303044616-conversion-gate01
angularjsmeetup-150303044616-conversion-gate01
 
Angular js meetup
Angular js meetupAngular js meetup
Angular js meetup
 
Angularjs PPT
Angularjs PPTAngularjs PPT
Angularjs PPT
 
Angular js
Angular jsAngular js
Angular js
 
Comparing Angular and React JS for SPAs
Comparing Angular and React JS for SPAsComparing Angular and React JS for SPAs
Comparing Angular and React JS for SPAs
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
What are The Top Features of Angular 7?
What are The Top Features of Angular 7?What are The Top Features of Angular 7?
What are The Top Features of Angular 7?
 
[143]Inside fuse deview 2016
[143]Inside fuse   deview 2016[143]Inside fuse   deview 2016
[143]Inside fuse deview 2016
 
Angular js
Angular jsAngular js
Angular js
 
Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps
 
Projects In JavaScript And JQuery | Eduonix
Projects In JavaScript And JQuery | EduonixProjects In JavaScript And JQuery | Eduonix
Projects In JavaScript And JQuery | Eduonix
 
Angular.js Talk at the November Meetup of the BerlinJS User Group
Angular.js Talk at the November Meetup of the BerlinJS User GroupAngular.js Talk at the November Meetup of the BerlinJS User Group
Angular.js Talk at the November Meetup of the BerlinJS User Group
 
Building a dashboard using AngularJS
Building a dashboard using AngularJSBuilding a dashboard using AngularJS
Building a dashboard using AngularJS
 

Mais de Arif Huda

Spotify Recommender System
Spotify Recommender SystemSpotify Recommender System
Spotify Recommender SystemArif Huda
 
Startup Tanpa Mentor, Bisa?
Startup Tanpa Mentor, Bisa?Startup Tanpa Mentor, Bisa?
Startup Tanpa Mentor, Bisa?Arif Huda
 
Introducing Startup 101
Introducing Startup 101Introducing Startup 101
Introducing Startup 101Arif Huda
 
Solusi Mencegah Coding Ruwet
Solusi Mencegah Coding RuwetSolusi Mencegah Coding Ruwet
Solusi Mencegah Coding RuwetArif Huda
 
Bedah Teknologi Semacam Gojek
Bedah Teknologi Semacam GojekBedah Teknologi Semacam Gojek
Bedah Teknologi Semacam GojekArif Huda
 
Rahasia Mendapatkan Investasi Milyaran Rupiah Sebelum Usia 30 Tahun
Rahasia Mendapatkan Investasi Milyaran Rupiah Sebelum Usia 30 TahunRahasia Mendapatkan Investasi Milyaran Rupiah Sebelum Usia 30 Tahun
Rahasia Mendapatkan Investasi Milyaran Rupiah Sebelum Usia 30 TahunArif Huda
 
Membuat Media Edukasi Daring
Membuat Media Edukasi DaringMembuat Media Edukasi Daring
Membuat Media Edukasi DaringArif Huda
 
Single responsibility pattern
Single responsibility patternSingle responsibility pattern
Single responsibility patternArif Huda
 
5 jalan rahasia mewujudkan ide startup
5 jalan rahasia mewujudkan ide startup5 jalan rahasia mewujudkan ide startup
5 jalan rahasia mewujudkan ide startupArif Huda
 
programmersworld
programmersworldprogrammersworld
programmersworldArif Huda
 
5 Langkah Jitu Melejitkan Ide Bisnis Startup
5 Langkah Jitu Melejitkan Ide Bisnis Startup5 Langkah Jitu Melejitkan Ide Bisnis Startup
5 Langkah Jitu Melejitkan Ide Bisnis StartupArif Huda
 
getting started startup in millenial era
getting started startup in millenial eragetting started startup in millenial era
getting started startup in millenial eraArif Huda
 
Fingertip Detection
Fingertip DetectionFingertip Detection
Fingertip DetectionArif Huda
 
Protocol oriented programming
Protocol oriented programmingProtocol oriented programming
Protocol oriented programmingArif Huda
 
an implementation of repository pattern for mobile application
an implementation of repository pattern for mobile applicationan implementation of repository pattern for mobile application
an implementation of repository pattern for mobile applicationArif Huda
 
Inovasi Teknologi Berkemajuan
Inovasi Teknologi BerkemajuanInovasi Teknologi Berkemajuan
Inovasi Teknologi BerkemajuanArif Huda
 
Git workflow
Git workflowGit workflow
Git workflowArif Huda
 
Media pembelajaran audio untuk tunanetra
Media pembelajaran audio untuk tunanetraMedia pembelajaran audio untuk tunanetra
Media pembelajaran audio untuk tunanetraArif Huda
 
Tobe a superstar programmer
Tobe a superstar programmerTobe a superstar programmer
Tobe a superstar programmerArif Huda
 
clean code for high quality software
clean code for high quality softwareclean code for high quality software
clean code for high quality softwareArif Huda
 

Mais de Arif Huda (20)

Spotify Recommender System
Spotify Recommender SystemSpotify Recommender System
Spotify Recommender System
 
Startup Tanpa Mentor, Bisa?
Startup Tanpa Mentor, Bisa?Startup Tanpa Mentor, Bisa?
Startup Tanpa Mentor, Bisa?
 
Introducing Startup 101
Introducing Startup 101Introducing Startup 101
Introducing Startup 101
 
Solusi Mencegah Coding Ruwet
Solusi Mencegah Coding RuwetSolusi Mencegah Coding Ruwet
Solusi Mencegah Coding Ruwet
 
Bedah Teknologi Semacam Gojek
Bedah Teknologi Semacam GojekBedah Teknologi Semacam Gojek
Bedah Teknologi Semacam Gojek
 
Rahasia Mendapatkan Investasi Milyaran Rupiah Sebelum Usia 30 Tahun
Rahasia Mendapatkan Investasi Milyaran Rupiah Sebelum Usia 30 TahunRahasia Mendapatkan Investasi Milyaran Rupiah Sebelum Usia 30 Tahun
Rahasia Mendapatkan Investasi Milyaran Rupiah Sebelum Usia 30 Tahun
 
Membuat Media Edukasi Daring
Membuat Media Edukasi DaringMembuat Media Edukasi Daring
Membuat Media Edukasi Daring
 
Single responsibility pattern
Single responsibility patternSingle responsibility pattern
Single responsibility pattern
 
5 jalan rahasia mewujudkan ide startup
5 jalan rahasia mewujudkan ide startup5 jalan rahasia mewujudkan ide startup
5 jalan rahasia mewujudkan ide startup
 
programmersworld
programmersworldprogrammersworld
programmersworld
 
5 Langkah Jitu Melejitkan Ide Bisnis Startup
5 Langkah Jitu Melejitkan Ide Bisnis Startup5 Langkah Jitu Melejitkan Ide Bisnis Startup
5 Langkah Jitu Melejitkan Ide Bisnis Startup
 
getting started startup in millenial era
getting started startup in millenial eragetting started startup in millenial era
getting started startup in millenial era
 
Fingertip Detection
Fingertip DetectionFingertip Detection
Fingertip Detection
 
Protocol oriented programming
Protocol oriented programmingProtocol oriented programming
Protocol oriented programming
 
an implementation of repository pattern for mobile application
an implementation of repository pattern for mobile applicationan implementation of repository pattern for mobile application
an implementation of repository pattern for mobile application
 
Inovasi Teknologi Berkemajuan
Inovasi Teknologi BerkemajuanInovasi Teknologi Berkemajuan
Inovasi Teknologi Berkemajuan
 
Git workflow
Git workflowGit workflow
Git workflow
 
Media pembelajaran audio untuk tunanetra
Media pembelajaran audio untuk tunanetraMedia pembelajaran audio untuk tunanetra
Media pembelajaran audio untuk tunanetra
 
Tobe a superstar programmer
Tobe a superstar programmerTobe a superstar programmer
Tobe a superstar programmer
 
clean code for high quality software
clean code for high quality softwareclean code for high quality software
clean code for high quality software
 

Último

SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 

Último (20)

SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 

Listview and Adapter

  • 1. http://android.amberfog.com/?p=296 Join room on qicus bit.ly/androiduii Listview and Adapter
  • 2. Arif Akbarul Huda Android Developer di qiscus Penulis buku “Livecoding! 9 Aplikasi Android Buatan Sendiri” omayib@gmail.com (email) | @omayib (Twitter) “jika pelukis memilki kanvas untuk mencurahkan imajinasinya, Maka programmer punya RAM yang bisa di manipulasi sesuai imajinasi”
  • 3. Good reference ● javatpoint.com/java-oops- concepts ● oodesign.com ● c4learn.com ● Livecoding! 9 Aplikasi Android Buatan Sendiri
  • 4.
  • 6. How it works? ● ListView asks adapter “give me a view” (getView) for each item of the list ● A new View is returned and displayed
  • 7. Q : what if we have one billion items? Create new view for each item?
  • 8. Q : what if we have one billion items? Create new view for each item? A : Android caches views for you :)
  • 9. ListView is designed for scalability and performance. In practice, this essentially means: ● It tries to do as few view inflations as possible. ● It only paints and lays out children that are (or are about to become) visible on screencode. http://lucasr.org/2012/04/05/performance-tips-for-androids-listview/
  • 10.
  • 11. Add Item Clear User : add item 1 and dispay it! ListView : “hey adapter, give me a view..!” Adapter : “ok, but we don't have” “i will create a view by inflating selected layout” “then I will keep this view on my scrapview collection for use letter” “wait a seconds..i set your data” “oke done, there is a view for you” ListView : “yah! Thanks, render was succedeed” Item 1 View tag : 001
  • 12. Add Item Clear User : add item 2 and dispay it! ListView : “hey adapter, give me a view..!” Adapter : “ok, but the view I created before still used for item 1 so we don't have any stock” “i will create a view by inflating selected layout (again)” “then I will keep this view on my scrapview collection for use letter” “wait a seconds..i set your data” “oke done, there is a view for you” ListView : “yah! Thanks, render was succedeed” Item 1 Item 2 View tag : 001 View tag : 002
  • 13. Add Item Clear User : add item 11 and dispay it! ListView : “hey adapter, give me a view..!” Adapter : “i am sorry, the view will come outer space. We no need to render it” But I will keep current data (item 11) to set leter after user scrolling down” ListView : “oke noted!” Item 1 Item 2 ... Item 9 Item 10 Item 11 View tag : 001 View tag : 002 View tag : 009 View tag : 010
  • 14. Add Item Clear Adapter : “Hei look, user move scrolling up!” “the view with tag 001 has been released and not used” “i will use this view to display current data (item 11) ListView : “oke rendered!” Item 2 Item 3 ... Item 10 Item 11 Item 1 View tag : 001
  • 15. Lets try to practice it! See project on https://github.com/omayib/ListviewInspection