SlideShare a Scribd company logo
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

More Related Content

PPTX
Android Jam - Activity Lifecycle & Databases - Udacity Lesson 4a
PDF
Android Jam - ContentProviders - Udacity Lesson 4b
PPTX
Actor based architecture for world's largest telescope
PDF
Git intro fajar muslim
PDF
Automating The New York Times Crossword by Phil Wells
PDF
Live Coding Session (/dev/24 - 2021)
PDF
4Abstraction-220203-164234Question.pdf
PPTX
DIve into the Open World - Presentation outline
Android Jam - Activity Lifecycle & Databases - Udacity Lesson 4a
Android Jam - ContentProviders - Udacity Lesson 4b
Actor based architecture for world's largest telescope
Git intro fajar muslim
Automating The New York Times Crossword by Phil Wells
Live Coding Session (/dev/24 - 2021)
4Abstraction-220203-164234Question.pdf
DIve into the Open World - Presentation outline

Viewers also liked (17)

PDF
Abc presentation
PPTX
The communication process
PPT
Meeting7sett2013
PDF
AWH Almost Ultimate_App_ebook
PPTX
Intellectual property rights.
PDF
Sociolinguistics and Phonology of Kanauji
PPT
Teamwork
PPT
6 b magazine conventions (cole robinson)
DOCX
Test plan
PPT
Apn ekoara cosméticos
PPTX
My technology timeline
PDF
Purchase manager
PPT
Chuong 1 tong quan ve may tinh
PPTX
Narayana Murthy
PPT
La inocuidad alimentaria
PPT
Apresentação ekoara cosméticos oficial
Abc presentation
The communication process
Meeting7sett2013
AWH Almost Ultimate_App_ebook
Intellectual property rights.
Sociolinguistics and Phonology of Kanauji
Teamwork
6 b magazine conventions (cole robinson)
Test plan
Apn ekoara cosméticos
My technology timeline
Purchase manager
Chuong 1 tong quan ve may tinh
Narayana Murthy
La inocuidad alimentaria
Apresentação ekoara cosméticos oficial
Ad

Similar to Android Jam - Services & Notifications - Udacity Lesson 6 (20)

PDF
Introduction to Android M
PPTX
Android Architecture, Environment, and Components.pptx
PPTX
What's new in android M(6.0)
PDF
Rethinking the Mobile Code Offloading Paradigm: From Concept to Practice
DOCX
Interim Report.docx - vsiogap3d.googlecode.com
PDF
Developing Mobile Apps for Performance - Swapnil Patel, Verizon Media
PDF
Latest proposal project info zakat
DOCX
Automated card recharge android application
DOCX
Automated card recharge android application
DOCX
Automated card recharge android application
PPTX
5 beginner android application development foundation
PPTX
Internship report jdjdndhdndhdjdjdndnndndndndndjdjdjd
DOCX
android project-house tax billing
PDF
Software Engineering SDLC phases and SRS.pdf
PPTX
Introduction to Redux.pptx
PDF
04 programmation mobile - android - (db, receivers, services...)
PPTX
Introduction to Android
PDF
report
PDF
GSOC 2016 mifos
PPTX
Android task manager project presentation
Introduction to Android M
Android Architecture, Environment, and Components.pptx
What's new in android M(6.0)
Rethinking the Mobile Code Offloading Paradigm: From Concept to Practice
Interim Report.docx - vsiogap3d.googlecode.com
Developing Mobile Apps for Performance - Swapnil Patel, Verizon Media
Latest proposal project info zakat
Automated card recharge android application
Automated card recharge android application
Automated card recharge android application
5 beginner android application development foundation
Internship report jdjdndhdndhdjdjdndnndndndndndjdjdjd
android project-house tax billing
Software Engineering SDLC phases and SRS.pdf
Introduction to Redux.pptx
04 programmation mobile - android - (db, receivers, services...)
Introduction to Android
report
GSOC 2016 mifos
Android task manager project presentation
Ad

More from Paul Blundell (14)

PDF
In 10 mins a software crafting journey
PDF
The Novoda Craft University
PPTX
Android Things - Solid Foundations
PPTX
Http Caching for the Android Aficionado
PPTX
My perspective on MVP and architecture discussions
PPTX
Java Patterns - Strategy
PDF
Survival of the Continuist
PDF
Google I/O 2015 Android & Tech Announcements
PDF
Android Jam - Loaders - Udacity Lesson 4c
PPTX
Y U NO CRAFTSMAN
PDF
Oh so you test? - A guide to testing on Android from Unit to Mutation
PPTX
Jenkins project based authorization
PPTX
Judge my gym - GymBabes Walkthrough
PPTX
Open Closed Principle kata
In 10 mins a software crafting journey
The Novoda Craft University
Android Things - Solid Foundations
Http Caching for the Android Aficionado
My perspective on MVP and architecture discussions
Java Patterns - Strategy
Survival of the Continuist
Google I/O 2015 Android & Tech Announcements
Android Jam - Loaders - Udacity Lesson 4c
Y U NO CRAFTSMAN
Oh so you test? - A guide to testing on Android from Unit to Mutation
Jenkins project based authorization
Judge my gym - GymBabes Walkthrough
Open Closed Principle kata

Recently uploaded (20)

PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
Chapter 5: Probability Theory and Statistics
PDF
DP Operators-handbook-extract for the Mautical Institute
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
1. Introduction to Computer Programming.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Architecture types and enterprise applications.pdf
PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
Tartificialntelligence_presentation.pptx
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
August Patch Tuesday
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
project resource management chapter-09.pdf
OMC Textile Division Presentation 2021.pptx
Chapter 5: Probability Theory and Statistics
DP Operators-handbook-extract for the Mautical Institute
Module 1.ppt Iot fundamentals and Architecture
NewMind AI Weekly Chronicles – August ’25 Week III
NewMind AI Weekly Chronicles - August'25-Week II
Group 1 Presentation -Planning and Decision Making .pptx
TLE Review Electricity (Electricity).pptx
1. Introduction to Computer Programming.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Architecture types and enterprise applications.pdf
WOOl fibre morphology and structure.pdf for textiles
Tartificialntelligence_presentation.pptx
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Developing a website for English-speaking practice to English as a foreign la...
A comparative study of natural language inference in Swahili using monolingua...
August Patch Tuesday
Web App vs Mobile App What Should You Build First.pdf
project resource management chapter-09.pdf

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