SlideShare a Scribd company logo
1 of 21
Download to read offline
Android Manchester
Week 6 - Loaders
Overview
● Sponsors message - Novoda
● Retro
○ Lesson 4c Loaders
● Looking Forward
○ Lesson 5 Rich and Responsive layouts
● Stickers + Booklets
● Questionnaire
● Next Tue 7-8pm SpacePortX
Energizer
Stand up and introduce yourself to
somebody around you, you don’t
know
Prime Directive
‘Regardless of where we are up to, we
understand and truly believe that
everyone did the best job he or she
could, given his or her skills and
abilities, the personal time available,
and the situation at hand.’
Difficulty Check
● Who completed the class?
● How long did it take?
● Hands up 1-10 difficulty of the weeks lesson
● Any specific areas of the lesson that require
particular focus?
Retro lesson 4c Loaders
What we learnt last week
● Problems
● Solution with loader
● Key methods
● How loaders fit into the bigger picture
Problems 1
Problem 2
● Loading data in UI/Main thread can take time and
make UI less responsive
○ Load data in AsyncTask why don’t we?
■ On orientation change we’ll re-create
AsyncTask and consume even more resources
● Loaders registered to LoaderManager via static ID
and live beyond lifecycle of Fragment or Activity
○ Monitor source changes and deliver new data.
(Cursor)Loader 1
● Available from HoneyComb (3.0+)
○ Available in compatibility library
● Load data in AsyncTask on the background thread
○ provides updates to UI thread.
● CursorLoader = AsynTaskLoader for content
providers
○ Returns cursor to UI
○ Monitors changes to data and notifies UI
○ On rotation when activity reconnects to loader
its passed the last Cursor
(Cursor)Loader 2
● Key components
○ Loader_ID
○ Interface to implement
■ LoaderManager.LoaderCallbacks<Cursor>
○ InitLoader
■ getLoaderManager().initLoader(ID, null, this);
○ Callbacks
■ public Loader<Cursor> onCreateLoader(int loaderID, Bundle bundle) //Build Uri and create new CursorLoader
■ public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) //update adapter with new cursor
■ public void onLoaderReset(Loader<Cursor> loader) // release resources
Without loaders
With Loaders
What went well
What went well
● Responsive
○ Hard work off UI/Main thread
Data retrieval not tied to Activity lifecycle
Saves resources/memory
● Makes observing data easier
○ Less coding
● Updates update the UI without us doing
anything!
What didn’t go so well
What didn’t go so well
● More coding
○ Time consuming
● Loaders are crayzay! initLoader() vs
restartLoader() ?!?
Q&A
Please pleassssse... fill in sruvey http://goo.gl/JHulAu
Next Week - Android
Jam
Rich Layouts (location: Store room)
Next Lesson - Rich Layouts
Learning Objectives:
- Screen densities
- Fragments
- Orientation change - preserving data
- 2 pane layout
- ActionBar
- Custom Views
See you next week..
- Time: Tuesday 7pm
- Place: SpacePort
- Things needed: You + Questions +
Feedback
- Can contact us if issues:
@blundell_apps / @android_mcr
Go forth and discuss

More Related Content

Similar to Android Jam - Loaders - Udacity Lesson 4c

Running Moodle for High Concurrent Users
Running Moodle for High Concurrent UsersRunning Moodle for High Concurrent Users
Running Moodle for High Concurrent UsersGLC Networks
 
Using GIT for Everyone
Using GIT for EveryoneUsing GIT for Everyone
Using GIT for EveryoneGLC Networks
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipsterJulien Dubois
 
Android Jam - Activity Lifecycle & Databases - Udacity Lesson 4a
Android Jam - Activity Lifecycle & Databases - Udacity Lesson 4aAndroid Jam - Activity Lifecycle & Databases - Udacity Lesson 4a
Android Jam - Activity Lifecycle & Databases - Udacity Lesson 4aPaul Blundell
 
Pavlo Yuriychuk — Switching to Angular.js. Silk way
Pavlo Yuriychuk — Switching to Angular.js. Silk wayPavlo Yuriychuk — Switching to Angular.js. Silk way
Pavlo Yuriychuk — Switching to Angular.js. Silk wayGlobalLogic Ukraine
 
Switching to angular.js silk way
Switching to angular.js   silk waySwitching to angular.js   silk way
Switching to angular.js silk wayPavlo Iuriichuk
 
Zabbix for Monitoring
Zabbix for MonitoringZabbix for Monitoring
Zabbix for MonitoringGLC Networks
 
Loaders (and why we should use them)
Loaders (and why we should use them)Loaders (and why we should use them)
Loaders (and why we should use them)Michael Pustovit
 
Being Productive at Work
Being Productive at WorkBeing Productive at Work
Being Productive at WorkHitesh Patel
 
Data Analytics with DBMS
Data Analytics with DBMSData Analytics with DBMS
Data Analytics with DBMSGLC Networks
 
Piano Media - approach to data gathering and processing
Piano Media - approach to data gathering and processingPiano Media - approach to data gathering and processing
Piano Media - approach to data gathering and processingMartinStrycek
 
Building a Web Server with NGINX
Building a Web Server with NGINXBuilding a Web Server with NGINX
Building a Web Server with NGINXGLC Networks
 
OpenStack Cinder On-Boarding Education - Boston Summit - 2017
OpenStack Cinder On-Boarding Education - Boston Summit - 2017OpenStack Cinder On-Boarding Education - Boston Summit - 2017
OpenStack Cinder On-Boarding Education - Boston Summit - 2017Jay Bryant
 
Network Monitoring with The Dude and Whatsapp
Network Monitoring with The Dude and WhatsappNetwork Monitoring with The Dude and Whatsapp
Network Monitoring with The Dude and WhatsappGLC Networks
 
Labeling all the Things with the WDI Skill Labeler
Labeling all the Things with the WDI Skill Labeler Labeling all the Things with the WDI Skill Labeler
Labeling all the Things with the WDI Skill Labeler Kwame Porter Robinson
 
I have a Great Idea for a Drupal Module! Now What? - DrupalDevDays 2023
I have a Great Idea for a Drupal Module! Now What? - DrupalDevDays 2023I have a Great Idea for a Drupal Module! Now What? - DrupalDevDays 2023
I have a Great Idea for a Drupal Module! Now What? - DrupalDevDays 2023Martin Anderson-Clutz
 
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018Jay Bryant
 
Machine Learning with Python
Machine Learning with Python Machine Learning with Python
Machine Learning with Python GLC Networks
 
Series of Unfortunate Netflix Container Events - QConNYC17
Series of Unfortunate Netflix Container Events - QConNYC17Series of Unfortunate Netflix Container Events - QConNYC17
Series of Unfortunate Netflix Container Events - QConNYC17aspyker
 

Similar to Android Jam - Loaders - Udacity Lesson 4c (20)

Running Moodle for High Concurrent Users
Running Moodle for High Concurrent UsersRunning Moodle for High Concurrent Users
Running Moodle for High Concurrent Users
 
Using GIT for Everyone
Using GIT for EveryoneUsing GIT for Everyone
Using GIT for Everyone
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipster
 
Android Jam - Activity Lifecycle & Databases - Udacity Lesson 4a
Android Jam - Activity Lifecycle & Databases - Udacity Lesson 4aAndroid Jam - Activity Lifecycle & Databases - Udacity Lesson 4a
Android Jam - Activity Lifecycle & Databases - Udacity Lesson 4a
 
Pavlo Yuriychuk — Switching to Angular.js. Silk way
Pavlo Yuriychuk — Switching to Angular.js. Silk wayPavlo Yuriychuk — Switching to Angular.js. Silk way
Pavlo Yuriychuk — Switching to Angular.js. Silk way
 
Switching to angular.js silk way
Switching to angular.js   silk waySwitching to angular.js   silk way
Switching to angular.js silk way
 
Zabbix for Monitoring
Zabbix for MonitoringZabbix for Monitoring
Zabbix for Monitoring
 
Loaders (and why we should use them)
Loaders (and why we should use them)Loaders (and why we should use them)
Loaders (and why we should use them)
 
Being Productive at Work
Being Productive at WorkBeing Productive at Work
Being Productive at Work
 
Data Analytics with DBMS
Data Analytics with DBMSData Analytics with DBMS
Data Analytics with DBMS
 
Piano Media - approach to data gathering and processing
Piano Media - approach to data gathering and processingPiano Media - approach to data gathering and processing
Piano Media - approach to data gathering and processing
 
Building a Web Server with NGINX
Building a Web Server with NGINXBuilding a Web Server with NGINX
Building a Web Server with NGINX
 
OpenStack Cinder On-Boarding Education - Boston Summit - 2017
OpenStack Cinder On-Boarding Education - Boston Summit - 2017OpenStack Cinder On-Boarding Education - Boston Summit - 2017
OpenStack Cinder On-Boarding Education - Boston Summit - 2017
 
Network Monitoring with The Dude and Whatsapp
Network Monitoring with The Dude and WhatsappNetwork Monitoring with The Dude and Whatsapp
Network Monitoring with The Dude and Whatsapp
 
Mikrotik metarouter
Mikrotik metarouterMikrotik metarouter
Mikrotik metarouter
 
Labeling all the Things with the WDI Skill Labeler
Labeling all the Things with the WDI Skill Labeler Labeling all the Things with the WDI Skill Labeler
Labeling all the Things with the WDI Skill Labeler
 
I have a Great Idea for a Drupal Module! Now What? - DrupalDevDays 2023
I have a Great Idea for a Drupal Module! Now What? - DrupalDevDays 2023I have a Great Idea for a Drupal Module! Now What? - DrupalDevDays 2023
I have a Great Idea for a Drupal Module! Now What? - DrupalDevDays 2023
 
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
 
Machine Learning with Python
Machine Learning with Python Machine Learning with Python
Machine Learning with Python
 
Series of Unfortunate Netflix Container Events - QConNYC17
Series of Unfortunate Netflix Container Events - QConNYC17Series of Unfortunate Netflix Container Events - QConNYC17
Series of Unfortunate Netflix Container Events - QConNYC17
 

More from Paul Blundell

In 10 mins a software crafting journey
In 10 mins a software crafting journeyIn 10 mins a software crafting journey
In 10 mins a software crafting journeyPaul Blundell
 
The Novoda Craft University
The Novoda Craft UniversityThe Novoda Craft University
The Novoda Craft UniversityPaul Blundell
 
Http Caching for the Android Aficionado
Http Caching for the Android AficionadoHttp Caching for the Android Aficionado
Http Caching for the Android AficionadoPaul Blundell
 
My perspective on MVP and architecture discussions
My perspective on MVP and architecture discussionsMy perspective on MVP and architecture discussions
My perspective on MVP and architecture discussionsPaul Blundell
 
Java Patterns - Strategy
Java Patterns - StrategyJava Patterns - Strategy
Java Patterns - StrategyPaul Blundell
 
Survival of the Continuist
Survival of the ContinuistSurvival of the Continuist
Survival of the ContinuistPaul Blundell
 
Google I/O 2015 Android & Tech Announcements
Google I/O 2015 Android & Tech AnnouncementsGoogle I/O 2015 Android & Tech Announcements
Google I/O 2015 Android & Tech AnnouncementsPaul Blundell
 
Android Jam - Services & Notifications - Udacity Lesson 6
Android Jam - Services & Notifications - Udacity Lesson 6 Android Jam - Services & Notifications - Udacity Lesson 6
Android Jam - Services & Notifications - Udacity Lesson 6 Paul Blundell
 
Oh so you test? - A guide to testing on Android from Unit to Mutation
Oh so you test? - A guide to testing on Android from Unit to MutationOh so you test? - A guide to testing on Android from Unit to Mutation
Oh so you test? - A guide to testing on Android from Unit to MutationPaul Blundell
 
Jenkins project based authorization
Jenkins   project based authorizationJenkins   project based authorization
Jenkins project based authorizationPaul Blundell
 
Judge my gym - GymBabes Walkthrough
Judge my gym - GymBabes WalkthroughJudge my gym - GymBabes Walkthrough
Judge my gym - GymBabes WalkthroughPaul Blundell
 
Open Closed Principle kata
Open Closed Principle kataOpen Closed Principle kata
Open Closed Principle kataPaul Blundell
 

More from Paul Blundell (13)

In 10 mins a software crafting journey
In 10 mins a software crafting journeyIn 10 mins a software crafting journey
In 10 mins a software crafting journey
 
The Novoda Craft University
The Novoda Craft UniversityThe Novoda Craft University
The Novoda Craft University
 
Http Caching for the Android Aficionado
Http Caching for the Android AficionadoHttp Caching for the Android Aficionado
Http Caching for the Android Aficionado
 
My perspective on MVP and architecture discussions
My perspective on MVP and architecture discussionsMy perspective on MVP and architecture discussions
My perspective on MVP and architecture discussions
 
Java Patterns - Strategy
Java Patterns - StrategyJava Patterns - Strategy
Java Patterns - Strategy
 
Survival of the Continuist
Survival of the ContinuistSurvival of the Continuist
Survival of the Continuist
 
Google I/O 2015 Android & Tech Announcements
Google I/O 2015 Android & Tech AnnouncementsGoogle I/O 2015 Android & Tech Announcements
Google I/O 2015 Android & Tech Announcements
 
Android Jam - Services & Notifications - Udacity Lesson 6
Android Jam - Services & Notifications - Udacity Lesson 6 Android Jam - Services & Notifications - Udacity Lesson 6
Android Jam - Services & Notifications - Udacity Lesson 6
 
Y U NO CRAFTSMAN
Y U NO CRAFTSMANY U NO CRAFTSMAN
Y U NO CRAFTSMAN
 
Oh so you test? - A guide to testing on Android from Unit to Mutation
Oh so you test? - A guide to testing on Android from Unit to MutationOh so you test? - A guide to testing on Android from Unit to Mutation
Oh so you test? - A guide to testing on Android from Unit to Mutation
 
Jenkins project based authorization
Jenkins   project based authorizationJenkins   project based authorization
Jenkins project based authorization
 
Judge my gym - GymBabes Walkthrough
Judge my gym - GymBabes WalkthroughJudge my gym - GymBabes Walkthrough
Judge my gym - GymBabes Walkthrough
 
Open Closed Principle kata
Open Closed Principle kataOpen Closed Principle kata
Open Closed Principle kata
 

Recently uploaded

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 2024The Digital Insurer
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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 2024Rafal Los
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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.pdfEnterprise Knowledge
 
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 AutomationSafe Software
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Recently uploaded (20)

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
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Android Jam - Loaders - Udacity Lesson 4c

  • 2. Overview ● Sponsors message - Novoda ● Retro ○ Lesson 4c Loaders ● Looking Forward ○ Lesson 5 Rich and Responsive layouts ● Stickers + Booklets ● Questionnaire ● Next Tue 7-8pm SpacePortX
  • 3. Energizer Stand up and introduce yourself to somebody around you, you don’t know
  • 4. Prime Directive ‘Regardless of where we are up to, we understand and truly believe that everyone did the best job he or she could, given his or her skills and abilities, the personal time available, and the situation at hand.’
  • 5. Difficulty Check ● Who completed the class? ● How long did it take? ● Hands up 1-10 difficulty of the weeks lesson ● Any specific areas of the lesson that require particular focus?
  • 6. Retro lesson 4c Loaders What we learnt last week ● Problems ● Solution with loader ● Key methods ● How loaders fit into the bigger picture
  • 8. Problem 2 ● Loading data in UI/Main thread can take time and make UI less responsive ○ Load data in AsyncTask why don’t we? ■ On orientation change we’ll re-create AsyncTask and consume even more resources ● Loaders registered to LoaderManager via static ID and live beyond lifecycle of Fragment or Activity ○ Monitor source changes and deliver new data.
  • 9. (Cursor)Loader 1 ● Available from HoneyComb (3.0+) ○ Available in compatibility library ● Load data in AsyncTask on the background thread ○ provides updates to UI thread. ● CursorLoader = AsynTaskLoader for content providers ○ Returns cursor to UI ○ Monitors changes to data and notifies UI ○ On rotation when activity reconnects to loader its passed the last Cursor
  • 10. (Cursor)Loader 2 ● Key components ○ Loader_ID ○ Interface to implement ■ LoaderManager.LoaderCallbacks<Cursor> ○ InitLoader ■ getLoaderManager().initLoader(ID, null, this); ○ Callbacks ■ public Loader<Cursor> onCreateLoader(int loaderID, Bundle bundle) //Build Uri and create new CursorLoader ■ public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) //update adapter with new cursor ■ public void onLoaderReset(Loader<Cursor> loader) // release resources
  • 14. What went well ● Responsive ○ Hard work off UI/Main thread Data retrieval not tied to Activity lifecycle Saves resources/memory ● Makes observing data easier ○ Less coding ● Updates update the UI without us doing anything!
  • 15. What didn’t go so well
  • 16. What didn’t go so well ● More coding ○ Time consuming ● Loaders are crayzay! initLoader() vs restartLoader() ?!?
  • 17. Q&A Please pleassssse... fill in sruvey http://goo.gl/JHulAu
  • 18. Next Week - Android Jam Rich Layouts (location: Store room)
  • 19. Next Lesson - Rich Layouts Learning Objectives: - Screen densities - Fragments - Orientation change - preserving data - 2 pane layout - ActionBar - Custom Views
  • 20. See you next week.. - Time: Tuesday 7pm - Place: SpacePort - Things needed: You + Questions + Feedback - Can contact us if issues: @blundell_apps / @android_mcr
  • 21. Go forth and discuss