SlideShare uma empresa Scribd logo
1 de 38
Baixar para ler offline
Android Manchester
Week 8 - Services & Notifications
Overview
● Retro
○ Lesson 6 Services & Notifications
● Looking Forward
○ The Final Project
● Stickers
● Next retro 31st March (2 weeks!)
● Next Tues 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 lesson
● Any specific areas of the lesson that require
particular focus?
Retro lesson 6 services & notifications
What we learnt last week
● Services
● Application priority
● Alarms
● Transferring data efficiently
● SyncAdapters
● Notifications
Services
● Execute long running tasks that shouldn’t be interrupted
● Have a lifecycle but no user interface
● Declared in the AndroidManifest
Services
● Run on the main thread - which means…..?
○ AsyncTasks, SyncAdapter, IntentService etc.
● Typically override onStartCommand
● No state methods such as onResume, onPause etc
Service Extras
● startForeground(Notification notification);
○ increases priority
○ shouldn’t be killed to clear resources
● IntentService (subclass) provides onHandleIntent which runs off the
main thread
○ Executes Intents sequentially
○ Good for downloading
App Priority
● Apps running in the background have a
responsibility to be good citizens!
● Async Task can be used to download files/play
music but risk being deleted when the app is in
the background
● Services allow us to deal with these use cases
App Priority
App Priority - the 3 laws
Test...
● Consider effect on user experience
● Consider component - is it an
Activity or Service?
● User interaction
● And is it background/foreground?
3 Laws
1. Android will ensure a smooth UX
2. Android will keep all activities and
services running unless they violate
the 1st law
3. Android will keep background apps
running unless they violate 1st or 2nd
law
Efficiency
Clue: We’re aiming for less data, less often
Battery Drain
The cell radio
Efficiency is driven by hardware considerations
The cell radio analysed
V
blue - active data transfers
red - radio in full power
yellow - lower power mode
black - idle
Efficiency
Interlude - making good apps great
Further Watching
Google I/O 2013 - Android Protips 3: Making Apps Work Like Magic
https://www.youtube.com/watch?v=GcNNx2zdXN4
Google I/O 2012 - Android Protips 2:Making Good Apps Great
https://www.youtube.com/watch?v=PwC1OlJo5VM
Google I/O 2011: Android Protips: Advanced Topics for Expert Android App Developers
https://www.youtube.com/watch?v=twmuBbC_oB8
SyncAdapter
● Designed to sync local data with web efficiently
● OS Batches requests with other apps to save battery.
● Try not to run when radio is idle
● Auto retry requests
● onPerformSync
Notifications
Notifications
● So far, all solutions of retrieving data/sync go Device ->
Server (Poll)
● Notifications are Server -> Device (Push)-
○ can include payload in json format or request update
■ NB: Requesting too many updates concurrently can
cause server traffic
○ More efficient than polling
What went well
What went well
● Efficient data transfer very useful
● SyncAdapters - many applications can make use of them
● The 3 laws for application priority - great way to
remember
● Understanding the state radio helps understand why
little data transfers are actually worse!
What didn’t go so well
What didn’t go so well
● Less detail in this class
● There is a lot to learn / know to get efficient data
synchronised applications
● Copy n Paste for the sync adapter
● Didn’t delete the old weather data until this
lesson!
● “comment out” refresh button … but woohoo
SyncAdapter
Q&A
Next - Android Jam
Project Retro
Next Lesson - Project
Learning Objectives:
- Final Project
Final Project
Your Project must:
Import and build on the latest version of Android Studio
Be entirely self-contained on an Android device (No external devices/bluetooth peripherals).
Include a problem description of the problem your app solves.
Include mocks for all user-facing screens.
Include at least one alternate mock for tablet / large screens.
Implement all mockups, including your tablet layout.
Have at least two distinct Views (ex. a list view and a detail view).
Work properly with the app lifecycle (i.e. resume state on orientation change).
Use permissions responsibly.
Use Intents to move between activities inside your app or to an outside app.
Create and use your own ContentProvider
Use Loaders to move your data to your views.
If the application pulls or sends data to/from a web service or API, it handles this network activity properly
(i.e on the correct thread, does not abuse network resources)
Include only safe-for-work content in your app
Final Project Extras
For extra Udacious-ness, include at least two of the following (optional):
Receive Broadcast events and do something meaningful.
Create and use a custom View.
Implement a ShareActionProvider, sharing rich content such as a picture or link.
Use Notifications.
Final Project Ideas
● Food ordering app
● Teleprompter app
● Local news app
● App for your company, university or local club
● Education app
● Public transit schedule
● Reddit Reading List
● Github OSS project tracker
● YouTube API
● Twitter API
● Weather API
● www.programmableweb.com/apis/directory
Final Project Paul
Final Project Zain
Final Project Checklist
See you next but one week..
- Time: Tuesday 31st March 7pm
- Place: SpacePort
- Things needed: You + Questions +
Feedback
- Can contact us if issues:
@blundell_apps / @android_mcr
Go forth & discuss do

Mais conteúdo relacionado

Destaque

Sociolinguistics and Phonology of Kanauji
Sociolinguistics and Phonology of KanaujiSociolinguistics and Phonology of Kanauji
Sociolinguistics and Phonology of Kanauji
Pankaj Dwivedi
 
6 b magazine conventions (cole robinson)
6 b   magazine conventions (cole robinson)6 b   magazine conventions (cole robinson)
6 b magazine conventions (cole robinson)
Crobinson17
 

Destaque (17)

Abc presentation
Abc presentationAbc presentation
Abc presentation
 
The communication process
The communication processThe communication process
The communication process
 
Meeting7sett2013
Meeting7sett2013Meeting7sett2013
Meeting7sett2013
 
AWH Almost Ultimate_App_ebook
AWH Almost Ultimate_App_ebookAWH Almost Ultimate_App_ebook
AWH Almost Ultimate_App_ebook
 
Intellectual property rights.
Intellectual property rights.Intellectual property rights.
Intellectual property rights.
 
Sociolinguistics and Phonology of Kanauji
Sociolinguistics and Phonology of KanaujiSociolinguistics and Phonology of Kanauji
Sociolinguistics and Phonology of Kanauji
 
Teamwork
Teamwork Teamwork
Teamwork
 
Survey
SurveySurvey
Survey
 
6 b magazine conventions (cole robinson)
6 b   magazine conventions (cole robinson)6 b   magazine conventions (cole robinson)
6 b magazine conventions (cole robinson)
 
Test plan
Test planTest plan
Test plan
 
Apn ekoara cosméticos
Apn ekoara cosméticosApn ekoara cosméticos
Apn ekoara cosméticos
 
My technology timeline
My technology timelineMy technology timeline
My technology timeline
 
Purchase manager
Purchase managerPurchase manager
Purchase manager
 
Chuong 1 tong quan ve may tinh
Chuong 1 tong quan ve may tinhChuong 1 tong quan ve may tinh
Chuong 1 tong quan ve may tinh
 
Narayana Murthy
Narayana Murthy Narayana Murthy
Narayana Murthy
 
La inocuidad alimentaria
La inocuidad alimentaria La inocuidad alimentaria
La inocuidad alimentaria
 
Apresentação ekoara cosméticos oficial
Apresentação ekoara cosméticos oficialApresentação ekoara cosméticos oficial
Apresentação ekoara cosméticos oficial
 

Semelhante a Android Jam - Services & Notifications - Udacity Lesson 6

Interim Report.docx - vsiogap3d.googlecode.com
Interim Report.docx - vsiogap3d.googlecode.comInterim Report.docx - vsiogap3d.googlecode.com
Interim Report.docx - vsiogap3d.googlecode.com
butest
 
04 programmation mobile - android - (db, receivers, services...)
04 programmation mobile - android - (db, receivers, services...)04 programmation mobile - android - (db, receivers, services...)
04 programmation mobile - android - (db, receivers, services...)
TECOS
 

Semelhante a Android Jam - Services & Notifications - Udacity Lesson 6 (20)

Introduction to Android M
Introduction to Android MIntroduction to Android M
Introduction to Android M
 
Android Architecture, Environment, and Components.pptx
Android Architecture, Environment, and Components.pptxAndroid Architecture, Environment, and Components.pptx
Android Architecture, Environment, and Components.pptx
 
What's new in android M(6.0)
What's new in android M(6.0)What's new in android M(6.0)
What's new in android M(6.0)
 
Rethinking the Mobile Code Offloading Paradigm: From Concept to Practice
Rethinking the Mobile Code Offloading Paradigm: From Concept to PracticeRethinking the Mobile Code Offloading Paradigm: From Concept to Practice
Rethinking the Mobile Code Offloading Paradigm: From Concept to Practice
 
Interim Report.docx - vsiogap3d.googlecode.com
Interim Report.docx - vsiogap3d.googlecode.comInterim Report.docx - vsiogap3d.googlecode.com
Interim Report.docx - vsiogap3d.googlecode.com
 
Developing Mobile Apps for Performance - Swapnil Patel, Verizon Media
Developing Mobile Apps for Performance - Swapnil Patel, Verizon MediaDeveloping Mobile Apps for Performance - Swapnil Patel, Verizon Media
Developing Mobile Apps for Performance - Swapnil Patel, Verizon Media
 
Latest proposal project info zakat
Latest proposal project info zakatLatest proposal project info zakat
Latest proposal project info zakat
 
Automated card recharge android application
Automated card recharge android applicationAutomated card recharge android application
Automated card recharge android application
 
Automated card recharge android application
Automated card recharge android applicationAutomated card recharge android application
Automated card recharge android application
 
Automated card recharge android application
Automated card recharge android applicationAutomated card recharge android application
Automated card recharge android application
 
5 beginner android application development foundation
5 beginner android application development foundation5 beginner android application development foundation
5 beginner android application development foundation
 
android project-house tax billing
android project-house tax billing android project-house tax billing
android project-house tax billing
 
Introduction to Redux.pptx
Introduction to Redux.pptxIntroduction to Redux.pptx
Introduction to Redux.pptx
 
04 programmation mobile - android - (db, receivers, services...)
04 programmation mobile - android - (db, receivers, services...)04 programmation mobile - android - (db, receivers, services...)
04 programmation mobile - android - (db, receivers, services...)
 
Introduction to Android
Introduction to AndroidIntroduction to Android
Introduction to Android
 
report
reportreport
report
 
GSOC 2016 mifos
GSOC 2016 mifosGSOC 2016 mifos
GSOC 2016 mifos
 
Android task manager project presentation
Android task manager project presentationAndroid task manager project presentation
Android task manager project presentation
 
React for Non Techies
React for Non TechiesReact for Non Techies
React for Non Techies
 
React for non techies
React for non techiesReact for non techies
React for non techies
 

Mais de Paul Blundell

Mais de Paul Blundell (14)

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
 
Android Jam - Loaders - Udacity Lesson 4c
Android Jam - Loaders - Udacity Lesson 4cAndroid Jam - Loaders - Udacity Lesson 4c
Android Jam - Loaders - Udacity Lesson 4c
 
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
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Android Jam - Services & Notifications - Udacity Lesson 6

  • 1. Android Manchester Week 8 - Services & Notifications
  • 2. Overview ● Retro ○ Lesson 6 Services & Notifications ● Looking Forward ○ The Final Project ● Stickers ● Next retro 31st March (2 weeks!) ● Next Tues 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 lesson ● Any specific areas of the lesson that require particular focus?
  • 6. Retro lesson 6 services & notifications What we learnt last week ● Services ● Application priority ● Alarms ● Transferring data efficiently ● SyncAdapters ● Notifications
  • 7. Services ● Execute long running tasks that shouldn’t be interrupted ● Have a lifecycle but no user interface ● Declared in the AndroidManifest
  • 8. Services ● Run on the main thread - which means…..? ○ AsyncTasks, SyncAdapter, IntentService etc. ● Typically override onStartCommand ● No state methods such as onResume, onPause etc
  • 9. Service Extras ● startForeground(Notification notification); ○ increases priority ○ shouldn’t be killed to clear resources ● IntentService (subclass) provides onHandleIntent which runs off the main thread ○ Executes Intents sequentially ○ Good for downloading
  • 10. App Priority ● Apps running in the background have a responsibility to be good citizens! ● Async Task can be used to download files/play music but risk being deleted when the app is in the background ● Services allow us to deal with these use cases
  • 12. App Priority - the 3 laws
  • 13. Test... ● Consider effect on user experience ● Consider component - is it an Activity or Service? ● User interaction ● And is it background/foreground? 3 Laws 1. Android will ensure a smooth UX 2. Android will keep all activities and services running unless they violate the 1st law 3. Android will keep background apps running unless they violate 1st or 2nd law
  • 14. Efficiency Clue: We’re aiming for less data, less often
  • 16. The cell radio Efficiency is driven by hardware considerations
  • 17. The cell radio analysed V blue - active data transfers red - radio in full power yellow - lower power mode black - idle
  • 19. Interlude - making good apps great
  • 20. Further Watching Google I/O 2013 - Android Protips 3: Making Apps Work Like Magic https://www.youtube.com/watch?v=GcNNx2zdXN4 Google I/O 2012 - Android Protips 2:Making Good Apps Great https://www.youtube.com/watch?v=PwC1OlJo5VM Google I/O 2011: Android Protips: Advanced Topics for Expert Android App Developers https://www.youtube.com/watch?v=twmuBbC_oB8
  • 21. SyncAdapter ● Designed to sync local data with web efficiently ● OS Batches requests with other apps to save battery. ● Try not to run when radio is idle ● Auto retry requests ● onPerformSync
  • 23. Notifications ● So far, all solutions of retrieving data/sync go Device -> Server (Poll) ● Notifications are Server -> Device (Push)- ○ can include payload in json format or request update ■ NB: Requesting too many updates concurrently can cause server traffic ○ More efficient than polling
  • 25. What went well ● Efficient data transfer very useful ● SyncAdapters - many applications can make use of them ● The 3 laws for application priority - great way to remember ● Understanding the state radio helps understand why little data transfers are actually worse!
  • 26. What didn’t go so well
  • 27. What didn’t go so well ● Less detail in this class ● There is a lot to learn / know to get efficient data synchronised applications ● Copy n Paste for the sync adapter ● Didn’t delete the old weather data until this lesson! ● “comment out” refresh button … but woohoo SyncAdapter
  • 28. Q&A
  • 29. Next - Android Jam Project Retro
  • 30. Next Lesson - Project Learning Objectives: - Final Project
  • 31. Final Project Your Project must: Import and build on the latest version of Android Studio Be entirely self-contained on an Android device (No external devices/bluetooth peripherals). Include a problem description of the problem your app solves. Include mocks for all user-facing screens. Include at least one alternate mock for tablet / large screens. Implement all mockups, including your tablet layout. Have at least two distinct Views (ex. a list view and a detail view). Work properly with the app lifecycle (i.e. resume state on orientation change). Use permissions responsibly. Use Intents to move between activities inside your app or to an outside app. Create and use your own ContentProvider Use Loaders to move your data to your views. If the application pulls or sends data to/from a web service or API, it handles this network activity properly (i.e on the correct thread, does not abuse network resources) Include only safe-for-work content in your app
  • 32. Final Project Extras For extra Udacious-ness, include at least two of the following (optional): Receive Broadcast events and do something meaningful. Create and use a custom View. Implement a ShareActionProvider, sharing rich content such as a picture or link. Use Notifications.
  • 33. Final Project Ideas ● Food ordering app ● Teleprompter app ● Local news app ● App for your company, university or local club ● Education app ● Public transit schedule ● Reddit Reading List ● Github OSS project tracker ● YouTube API ● Twitter API ● Weather API ● www.programmableweb.com/apis/directory
  • 37. See you next but one week.. - Time: Tuesday 31st March 7pm - Place: SpacePort - Things needed: You + Questions + Feedback - Can contact us if issues: @blundell_apps / @android_mcr
  • 38. Go forth & discuss do