SlideShare a Scribd company logo
Android Manchester
Week 4 - Activity Lifecycle & Databases
Overview
● Retro
o Lesson 4a Activity Lifecycle & Databases basics
● Looking forward
o Lesson 4b ContentProviders
o Lesson 4c Loaders?
● Stickers + Booklets
● 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 Activity Lifecycle & Databases
What we learnt last week
● Why the Activity Lifecycle is important
● The Activity Lifecycle
● Data persistence methods in Android
● SQLite
● ContentProvider
● Testing basics
Lesson 4a - Activity Lifecycle
● Why we need to know the Activity LifeCycle?
o Interruptions
o Memory issues
o Saving state
o User exits app
● Activity LifeCycle Methods come in pairs
o onDestroy - ?
o onStart- ?
o onResume - ?
● How often are the following methods called
o onResume?
o onStart?
o onCreate?
Lesson 4a - Answers
● Activity LifeCycle Methods come in pairs
o onDestroy() - onCreate
o onStart() - onStop
o onResume() - onPause
● How often are the following methods called
o onResume - multiple time
o onStart - multiple time
o onCreate/onDestroy - once
o onSavedInstanceState, onRestoreInstanceState
Lesson 4a - Lifecycle of an Activity
Lesson 4a - Termination of activity in
onStop()
or
onPause()
pre-honeycomb
Lesson 4a - Activity LifeCycle
● Save state in onPause
or in onSavedInstanceState
● Restore in onCreate
or in onRestoreInstanceState
Activity Lifecycle Visibility
Difference between onStop/onStart & onPause/onResume
is visibility
● onPause for overlays
● onStop for background
UX of the exit button
- Android doesn’t have a concept of exit
- What does exit even mean
https://www.youtube.com/watch?v=631T7B8HOv4
Lesson 4a: Databases
● SharedPreferences Key-Value pairs for primitives -
covered last week
o Don’t work with complex data
o Can’t query
● Databases
o SQLite
 Easier to Query, Update, Delete
Lesson 4a: Why Save Data
● Just fetch it from the cloud every time?
● Responsive (fast) application
● Responsible (sensible) application
Lesson 4a: Why Databases
● Efficient to find things
● Easy to organise
● Indexing
● Tables
VS
Lesson 4: Databases Overview
Three main components in the data storage methodology for this course
Contract
DbHelper
ContentProvider
Lesson 4a: Databases Helper
● Most important class
o Extends SQLiteOpenHelper
● onCreate()
o creates the tables using SQL query
o Called only the first time database is created.
● onUpgrade
o If the database updated you can call “Alter Table” SQL here to
ensure data is not lost during transition
● Other methods of note
o onDowngrade, getDatabaseName, getWriteableDatabase or
getReadableDatabase, onOpen, close.
Lesson 4a: Contract
● Define Table names & columns
o Also define URI helper methods
 More on this next week.
● DbHelper will become unreadable if you had Col names, types, util
methods in an encompassing class.
● ContentProviders
o Hook to access database from anywhere
in the app in a safe manner
 More next week!
Lesson 4a: Testing
● Convenient way of ensuring database is valid
o deals with edge cases
o Gives devs confidence in data validity
● TestSuite subclass specifies which tests to run
● AndroidTestCase subclass specifies x tests
● Test methods are prefixed with “test”
o i.e. testLocationInput
What went well
What went well
● Understanding the android lifecycle
● Restoring state
● Contract pattern in DB’s/ContentProvider
● Public Contracts (knowing what to do)
o http://developer.android.com/reference/android/provider/ContactsContract.html
● Code written for you
● Testing
o Saved a lot of time & pain
What didn’t go so well
What didn’t go so well
● Optional SQLite tutorial to read
● Code written for you
● Threading issues with the database
● Upfront talk of foreign keys & joins
o didn’t understand why until much later
● Testing
o caused a lot of time and pain
Q&A
Next Week - Android Jam
ContentProviders
Next Lesson - Content Providers
Learning Objectives:
- Creating a content providers
- URI, Uri Matcher, Uri Builder
- Bulk inserts
- Efficient updates.
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

Viewers also liked

Android activity lifecycle
Android activity lifecycleAndroid activity lifecycle
Android activity lifecycle
Soham Patel
 
Multimedia on android
Multimedia on androidMultimedia on android
Multimedia on android
Ramesh Prasad
 
The android activity lifecycle
The android activity lifecycleThe android activity lifecycle
The android activity lifecycle
Eng Chrispinus Onyancha
 
Android Life Cycle
Android Life CycleAndroid Life Cycle
Android Life Cycle
mssaman
 
08 android multimedia_framework_overview
08 android multimedia_framework_overview08 android multimedia_framework_overview
08 android multimedia_framework_overview
Arjun Reddy
 
Plagiarism for Faculty Workshop
Plagiarism for Faculty WorkshopPlagiarism for Faculty Workshop
Plagiarism for Faculty WorkshopCathy Burwell
 
Java titles 2015 2016
Java titles 2015 2016Java titles 2015 2016
Java titles 2015 2016
SHPINE TECHNOLOGIES
 
PROJECTS FROM SHPINE TECHNOLOGIES
PROJECTS FROM SHPINE TECHNOLOGIESPROJECTS FROM SHPINE TECHNOLOGIES
PROJECTS FROM SHPINE TECHNOLOGIES
SHPINE TECHNOLOGIES
 
IEEE PROJECT CENTER IN CHENNAI
IEEE PROJECT CENTER IN CHENNAIIEEE PROJECT CENTER IN CHENNAI
IEEE PROJECT CENTER IN CHENNAI
SHPINE TECHNOLOGIES
 
Introduction to iOS and Objective-C
Introduction to iOS and Objective-CIntroduction to iOS and Objective-C
Introduction to iOS and Objective-C
Daniela Da Cruz
 
ANDROID IEEE PROJECT TITLES 2014
ANDROID IEEE PROJECT TITLES 2014ANDROID IEEE PROJECT TITLES 2014
ANDROID IEEE PROJECT TITLES 2014
SHPINE TECHNOLOGIES
 
Marshmallow
MarshmallowMarshmallow
Marshmallow
shubham kanojia
 
Android ieee project titles 2015 2016
Android ieee project titles 2015 2016Android ieee project titles 2015 2016
Android ieee project titles 2015 2016
SHPINE TECHNOLOGIES
 
Scopus Overview
Scopus OverviewScopus Overview
Scopus Overview
FSC632
 
Why publish in an international journal?
Why publish in an international journal?Why publish in an international journal?
Why publish in an international journal?
Anindito Subagyo
 
Matlab titles 2015 2016
Matlab titles 2015 2016Matlab titles 2015 2016
Matlab titles 2015 2016
SHPINE TECHNOLOGIES
 
EMBEDDED-MICRO CONTROLLER BASED WIRELESS PROJECTS TITLES2014
EMBEDDED-MICRO CONTROLLER BASED WIRELESS PROJECTS TITLES2014EMBEDDED-MICRO CONTROLLER BASED WIRELESS PROJECTS TITLES2014
EMBEDDED-MICRO CONTROLLER BASED WIRELESS PROJECTS TITLES2014
SHPINE TECHNOLOGIES
 
Embedded project titles1:2015-2016
Embedded project titles1:2015-2016Embedded project titles1:2015-2016
Embedded project titles1:2015-2016
SHPINE TECHNOLOGIES
 
JAVA TITLES 2014
JAVA TITLES 2014JAVA TITLES 2014
JAVA TITLES 2014
SHPINE TECHNOLOGIES
 
Android os by jje
Android os by jjeAndroid os by jje
Android os by jje
Jefin Joseph
 

Viewers also liked (20)

Android activity lifecycle
Android activity lifecycleAndroid activity lifecycle
Android activity lifecycle
 
Multimedia on android
Multimedia on androidMultimedia on android
Multimedia on android
 
The android activity lifecycle
The android activity lifecycleThe android activity lifecycle
The android activity lifecycle
 
Android Life Cycle
Android Life CycleAndroid Life Cycle
Android Life Cycle
 
08 android multimedia_framework_overview
08 android multimedia_framework_overview08 android multimedia_framework_overview
08 android multimedia_framework_overview
 
Plagiarism for Faculty Workshop
Plagiarism for Faculty WorkshopPlagiarism for Faculty Workshop
Plagiarism for Faculty Workshop
 
Java titles 2015 2016
Java titles 2015 2016Java titles 2015 2016
Java titles 2015 2016
 
PROJECTS FROM SHPINE TECHNOLOGIES
PROJECTS FROM SHPINE TECHNOLOGIESPROJECTS FROM SHPINE TECHNOLOGIES
PROJECTS FROM SHPINE TECHNOLOGIES
 
IEEE PROJECT CENTER IN CHENNAI
IEEE PROJECT CENTER IN CHENNAIIEEE PROJECT CENTER IN CHENNAI
IEEE PROJECT CENTER IN CHENNAI
 
Introduction to iOS and Objective-C
Introduction to iOS and Objective-CIntroduction to iOS and Objective-C
Introduction to iOS and Objective-C
 
ANDROID IEEE PROJECT TITLES 2014
ANDROID IEEE PROJECT TITLES 2014ANDROID IEEE PROJECT TITLES 2014
ANDROID IEEE PROJECT TITLES 2014
 
Marshmallow
MarshmallowMarshmallow
Marshmallow
 
Android ieee project titles 2015 2016
Android ieee project titles 2015 2016Android ieee project titles 2015 2016
Android ieee project titles 2015 2016
 
Scopus Overview
Scopus OverviewScopus Overview
Scopus Overview
 
Why publish in an international journal?
Why publish in an international journal?Why publish in an international journal?
Why publish in an international journal?
 
Matlab titles 2015 2016
Matlab titles 2015 2016Matlab titles 2015 2016
Matlab titles 2015 2016
 
EMBEDDED-MICRO CONTROLLER BASED WIRELESS PROJECTS TITLES2014
EMBEDDED-MICRO CONTROLLER BASED WIRELESS PROJECTS TITLES2014EMBEDDED-MICRO CONTROLLER BASED WIRELESS PROJECTS TITLES2014
EMBEDDED-MICRO CONTROLLER BASED WIRELESS PROJECTS TITLES2014
 
Embedded project titles1:2015-2016
Embedded project titles1:2015-2016Embedded project titles1:2015-2016
Embedded project titles1:2015-2016
 
JAVA TITLES 2014
JAVA TITLES 2014JAVA TITLES 2014
JAVA TITLES 2014
 
Android os by jje
Android os by jjeAndroid os by jje
Android os by jje
 

Similar to Android Jam - Activity Lifecycle & Databases - Udacity Lesson 4a

Android Jam - Loaders - Udacity Lesson 4c
Android Jam - Loaders - Udacity Lesson 4cAndroid Jam - Loaders - Udacity Lesson 4c
Android Jam - Loaders - Udacity Lesson 4c
Paul Blundell
 
Rapid usability testing
Rapid usability testingRapid usability testing
Rapid usability testinglisarex
 
Add usability testing to your skill set!
Add usability testing to your skill set!Add usability testing to your skill set!
Add usability testing to your skill set!dcmistry
 
How to deliver the right software (Specification by example)
How to deliver the right software (Specification by example)How to deliver the right software (Specification by example)
How to deliver the right software (Specification by example)
Asier Barrenetxea
 
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
Xavier Amatriain
 
Digital Preservation in Production (DPN and DuraCloud Vault)
Digital Preservation in Production (DPN and DuraCloud Vault)Digital Preservation in Production (DPN and DuraCloud Vault)
Digital Preservation in Production (DPN and DuraCloud Vault)
DuraSpace
 
Discover What Your Users Really Think (and what they really do)
Discover What Your Users Really Think (and what they really do)Discover What Your Users Really Think (and what they really do)
Discover What Your Users Really Think (and what they really do)
Kristin Valentine
 
Become a Better Developer with Debugging Techniques for Drupal (and more!)
Become a Better Developer with Debugging Techniques for Drupal (and more!)Become a Better Developer with Debugging Techniques for Drupal (and more!)
Become a Better Developer with Debugging Techniques for Drupal (and more!)
Acquia
 
Context Aware Recommendations at Netflix
Context Aware Recommendations at NetflixContext Aware Recommendations at Netflix
Context Aware Recommendations at Netflix
Linas Baltrunas
 
Lecture #4 activities & fragments
Lecture #4  activities & fragmentsLecture #4  activities & fragments
Lecture #4 activities & fragments
Vitali Pekelis
 
GeneralAssemb.ly Summer Program: Tech from the Ground Up
GeneralAssemb.ly Summer Program: Tech from the Ground UpGeneralAssemb.ly Summer Program: Tech from the Ground Up
GeneralAssemb.ly Summer Program: Tech from the Ground UpDaniel Doubrovkine
 
Application Development Using Java - DIYComputerScience Course
Application Development Using Java - DIYComputerScience CourseApplication Development Using Java - DIYComputerScience Course
Application Development Using Java - DIYComputerScience Course
parag
 
Tenants for Going at DevSecOps Speed - LASCON 2023
Tenants for Going at DevSecOps Speed - LASCON 2023Tenants for Going at DevSecOps Speed - LASCON 2023
Tenants for Going at DevSecOps Speed - LASCON 2023
Matt Tesauro
 
Collapsed topics presentation
Collapsed topics presentationCollapsed topics presentation
Collapsed topics presentation
Gareth J Barnard
 
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
Martin Anderson-Clutz
 
An Experiment In Rapid Skill Acquisition: Teaching Someone How To Program In ...
An Experiment In Rapid Skill Acquisition: Teaching Someone How To Program In ...An Experiment In Rapid Skill Acquisition: Teaching Someone How To Program In ...
An Experiment In Rapid Skill Acquisition: Teaching Someone How To Program In ...
Tony Tran
 
A Day at the Troubleshooting Range: Persistence in Finding Assistance
A Day at the Troubleshooting Range: Persistence in Finding AssistanceA Day at the Troubleshooting Range: Persistence in Finding Assistance
A Day at the Troubleshooting Range: Persistence in Finding Assistance
Lambda Solutions
 
Surviving the technical interview
Surviving the technical interviewSurviving the technical interview
Surviving the technical interview
Eric Brooke
 
Training for Automated Testing - Kelsey Shannahan
Training for Automated Testing - Kelsey ShannahanTraining for Automated Testing - Kelsey Shannahan
Training for Automated Testing - Kelsey Shannahan
QA or the Highway
 
Student Survey Nov 2022
Student Survey Nov 2022Student Survey Nov 2022
Student Survey Nov 2022
Peter Windle
 

Similar to Android Jam - Activity Lifecycle & Databases - Udacity Lesson 4a (20)

Android Jam - Loaders - Udacity Lesson 4c
Android Jam - Loaders - Udacity Lesson 4cAndroid Jam - Loaders - Udacity Lesson 4c
Android Jam - Loaders - Udacity Lesson 4c
 
Rapid usability testing
Rapid usability testingRapid usability testing
Rapid usability testing
 
Add usability testing to your skill set!
Add usability testing to your skill set!Add usability testing to your skill set!
Add usability testing to your skill set!
 
How to deliver the right software (Specification by example)
How to deliver the right software (Specification by example)How to deliver the right software (Specification by example)
How to deliver the right software (Specification by example)
 
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
 
Digital Preservation in Production (DPN and DuraCloud Vault)
Digital Preservation in Production (DPN and DuraCloud Vault)Digital Preservation in Production (DPN and DuraCloud Vault)
Digital Preservation in Production (DPN and DuraCloud Vault)
 
Discover What Your Users Really Think (and what they really do)
Discover What Your Users Really Think (and what they really do)Discover What Your Users Really Think (and what they really do)
Discover What Your Users Really Think (and what they really do)
 
Become a Better Developer with Debugging Techniques for Drupal (and more!)
Become a Better Developer with Debugging Techniques for Drupal (and more!)Become a Better Developer with Debugging Techniques for Drupal (and more!)
Become a Better Developer with Debugging Techniques for Drupal (and more!)
 
Context Aware Recommendations at Netflix
Context Aware Recommendations at NetflixContext Aware Recommendations at Netflix
Context Aware Recommendations at Netflix
 
Lecture #4 activities & fragments
Lecture #4  activities & fragmentsLecture #4  activities & fragments
Lecture #4 activities & fragments
 
GeneralAssemb.ly Summer Program: Tech from the Ground Up
GeneralAssemb.ly Summer Program: Tech from the Ground UpGeneralAssemb.ly Summer Program: Tech from the Ground Up
GeneralAssemb.ly Summer Program: Tech from the Ground Up
 
Application Development Using Java - DIYComputerScience Course
Application Development Using Java - DIYComputerScience CourseApplication Development Using Java - DIYComputerScience Course
Application Development Using Java - DIYComputerScience Course
 
Tenants for Going at DevSecOps Speed - LASCON 2023
Tenants for Going at DevSecOps Speed - LASCON 2023Tenants for Going at DevSecOps Speed - LASCON 2023
Tenants for Going at DevSecOps Speed - LASCON 2023
 
Collapsed topics presentation
Collapsed topics presentationCollapsed topics presentation
Collapsed topics presentation
 
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
 
An Experiment In Rapid Skill Acquisition: Teaching Someone How To Program In ...
An Experiment In Rapid Skill Acquisition: Teaching Someone How To Program In ...An Experiment In Rapid Skill Acquisition: Teaching Someone How To Program In ...
An Experiment In Rapid Skill Acquisition: Teaching Someone How To Program In ...
 
A Day at the Troubleshooting Range: Persistence in Finding Assistance
A Day at the Troubleshooting Range: Persistence in Finding AssistanceA Day at the Troubleshooting Range: Persistence in Finding Assistance
A Day at the Troubleshooting Range: Persistence in Finding Assistance
 
Surviving the technical interview
Surviving the technical interviewSurviving the technical interview
Surviving the technical interview
 
Training for Automated Testing - Kelsey Shannahan
Training for Automated Testing - Kelsey ShannahanTraining for Automated Testing - Kelsey Shannahan
Training for Automated Testing - Kelsey Shannahan
 
Student Survey Nov 2022
Student Survey Nov 2022Student Survey Nov 2022
Student Survey Nov 2022
 

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 journey
Paul Blundell
 
The Novoda Craft University
The Novoda Craft UniversityThe Novoda Craft University
The Novoda Craft University
Paul Blundell
 
Android Things - Solid Foundations
Android Things - Solid FoundationsAndroid Things - Solid Foundations
Android Things - Solid Foundations
Paul Blundell
 
Http Caching for the Android Aficionado
Http Caching for the Android AficionadoHttp Caching for the Android Aficionado
Http Caching for the Android Aficionado
Paul 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 discussions
Paul Blundell
 
Java Patterns - Strategy
Java Patterns - StrategyJava Patterns - Strategy
Java Patterns - Strategy
Paul Blundell
 
Survival of the Continuist
Survival of the ContinuistSurvival of the Continuist
Survival of the Continuist
Paul 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 Announcements
Paul Blundell
 
Y U NO CRAFTSMAN
Y U NO CRAFTSMANY U NO CRAFTSMAN
Y U NO CRAFTSMAN
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 Mutation
Paul Blundell
 
Jenkins project based authorization
Jenkins   project based authorizationJenkins   project based authorization
Jenkins project based authorization
Paul Blundell
 
Judge my gym - GymBabes Walkthrough
Judge my gym - GymBabes WalkthroughJudge my gym - GymBabes Walkthrough
Judge my gym - GymBabes Walkthrough
Paul Blundell
 
Open Closed Principle kata
Open Closed Principle kataOpen Closed Principle kata
Open Closed Principle kata
Paul 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
 
Android Things - Solid Foundations
Android Things - Solid FoundationsAndroid Things - Solid Foundations
Android Things - Solid Foundations
 
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
 
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

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 

Android Jam - Activity Lifecycle & Databases - Udacity Lesson 4a

  • 1. Android Manchester Week 4 - Activity Lifecycle & Databases
  • 2. Overview ● Retro o Lesson 4a Activity Lifecycle & Databases basics ● Looking forward o Lesson 4b ContentProviders o Lesson 4c Loaders? ● Stickers + Booklets ● 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 Activity Lifecycle & Databases What we learnt last week ● Why the Activity Lifecycle is important ● The Activity Lifecycle ● Data persistence methods in Android ● SQLite ● ContentProvider ● Testing basics
  • 7. Lesson 4a - Activity Lifecycle ● Why we need to know the Activity LifeCycle? o Interruptions o Memory issues o Saving state o User exits app ● Activity LifeCycle Methods come in pairs o onDestroy - ? o onStart- ? o onResume - ? ● How often are the following methods called o onResume? o onStart? o onCreate?
  • 8. Lesson 4a - Answers ● Activity LifeCycle Methods come in pairs o onDestroy() - onCreate o onStart() - onStop o onResume() - onPause ● How often are the following methods called o onResume - multiple time o onStart - multiple time o onCreate/onDestroy - once o onSavedInstanceState, onRestoreInstanceState
  • 9. Lesson 4a - Lifecycle of an Activity
  • 10. Lesson 4a - Termination of activity in onStop() or onPause() pre-honeycomb
  • 11. Lesson 4a - Activity LifeCycle ● Save state in onPause or in onSavedInstanceState ● Restore in onCreate or in onRestoreInstanceState
  • 12. Activity Lifecycle Visibility Difference between onStop/onStart & onPause/onResume is visibility ● onPause for overlays ● onStop for background
  • 13. UX of the exit button - Android doesn’t have a concept of exit - What does exit even mean https://www.youtube.com/watch?v=631T7B8HOv4
  • 14. Lesson 4a: Databases ● SharedPreferences Key-Value pairs for primitives - covered last week o Don’t work with complex data o Can’t query ● Databases o SQLite  Easier to Query, Update, Delete
  • 15. Lesson 4a: Why Save Data ● Just fetch it from the cloud every time? ● Responsive (fast) application ● Responsible (sensible) application
  • 16. Lesson 4a: Why Databases ● Efficient to find things ● Easy to organise ● Indexing ● Tables VS
  • 17. Lesson 4: Databases Overview Three main components in the data storage methodology for this course Contract DbHelper ContentProvider
  • 18. Lesson 4a: Databases Helper ● Most important class o Extends SQLiteOpenHelper ● onCreate() o creates the tables using SQL query o Called only the first time database is created. ● onUpgrade o If the database updated you can call “Alter Table” SQL here to ensure data is not lost during transition ● Other methods of note o onDowngrade, getDatabaseName, getWriteableDatabase or getReadableDatabase, onOpen, close.
  • 19. Lesson 4a: Contract ● Define Table names & columns o Also define URI helper methods  More on this next week. ● DbHelper will become unreadable if you had Col names, types, util methods in an encompassing class. ● ContentProviders o Hook to access database from anywhere in the app in a safe manner  More next week!
  • 20. Lesson 4a: Testing ● Convenient way of ensuring database is valid o deals with edge cases o Gives devs confidence in data validity ● TestSuite subclass specifies which tests to run ● AndroidTestCase subclass specifies x tests ● Test methods are prefixed with “test” o i.e. testLocationInput
  • 22. What went well ● Understanding the android lifecycle ● Restoring state ● Contract pattern in DB’s/ContentProvider ● Public Contracts (knowing what to do) o http://developer.android.com/reference/android/provider/ContactsContract.html ● Code written for you ● Testing o Saved a lot of time & pain
  • 23. What didn’t go so well
  • 24. What didn’t go so well ● Optional SQLite tutorial to read ● Code written for you ● Threading issues with the database ● Upfront talk of foreign keys & joins o didn’t understand why until much later ● Testing o caused a lot of time and pain
  • 25. Q&A
  • 26. Next Week - Android Jam ContentProviders
  • 27. Next Lesson - Content Providers Learning Objectives: - Creating a content providers - URI, Uri Matcher, Uri Builder - Bulk inserts - Efficient updates.
  • 28. See you next week.. - Time: Tuesday 7pm - Place: SpacePort - Things needed: You + Questions + Feedback - Can contact us if issues: @blundell_apps / @android_mcr
  • 29. Go forth and discuss

Editor's Notes

  1. http://www.thoughtworks.com/insights/blog/7-step-agenda-effective-retrospective
  2. https://www.udacity.com/course/viewer#!/c-ud853/l-1395568821/m-1601259313
  3. Warm people up, help lube conversation later on when the meetup ends
  4. This sets the tone for everyone in the room, hopefully gets them engaged and listening even if they haven’t actually finished the lesson. Will also breed famililarity from week to week.
  5. Get people engaged a little bit and use the level of difficulty observed to tailer the speed of feedback
  6. big picture for comprehension
  7. Discussion points or ideas for further reading to go into detail
  8. big picture for comprehension
  9. http://www.thoughtworks.com/insights/blog/7-step-agenda-effective-retrospective
  10. People can now talk amongst themselves for the last ten minutes