SlideShare a Scribd company logo
1 of 39
A Journey Through Android Development
Raditya Gumay
Agenda
Introduction
• What is Android
• Design Pattern
• Codebase Architecture
• View Architecture
• Problems
• Q&A
What is Android
Android is a mobile operating system developed
by Google, based on a modified version of the Linux
kernel. ~ wikipedia
~ statista
Android
A Developer’s History
cupcake donut eclair froyo Ginger
bread
Honey
comb
Ice cream
sandwich
Jelly Bean
kitkat
lollipop
marsmellow
nougat
oreo
Android 6.0 (Marshmellow) Behaviour Changes
- Runtime Permission
- Doze and App Standby
API level 23
Runtime Permission
https://developer.android.com/training/permissions/reques
ting
if (ContextCompat.checkSelfPermission(thisActivity,
Manifest.permission.WRITE_CALENDAR)
!= PackageManager.PERMISSION_GRANTED) {
// Permission is not granted
}
<manifest
xmlns:android="http://schemas.android.com/apk/res/andro
id"
package="com.example.snazzyapp">
<uses-permission
android:name="android.permission.SEND_SMS"/>
<!-- other permissions go here -->
<application ...>
...
</application>
</manifest>
Doze and App Standby
https://developer.android.com/training/monitoring-device-
state/doze-standby
Doze restrictions
The following restrictions apply to your apps while in Doze:
•Network access is suspended.
•The system ignores wake locks.
•Standard AlarmManager alarms (including setExact() and setWindow())
are deferred to the next maintenance window.
• If you need to set alarms that fire while in Doze,
use setAndAllowWhileIdle() or setExactAndAllowWhileIdle().
• Alarms set with setAlarmClock() continue to fire normally — the
system exits Doze shortly before those alarms fire.
•The system does not perform Wi-Fi scans.
•The system does not allow sync adapters to run.
•The system does not allow JobScheduler to run.
Doze checklist
• If possible, use FCM for downstream messaging.
• If your users must see a notification right away, make sure to use
an FCM high priority message.
• Provide sufficient information within the initial message payload,
so subsequent network access is unnecessary.
• Set critical alarms
with setAndAllowWhileIdle() and setExactAndAllowWhileIdle().
Android 7.0 (Nougat) Behaviour Changes
- Doze
API level 24
When a device is on battery power, and the screen has been off
for a certain time, the device enters Doze and applies the first
subset of restrictions: It shuts off app network access, and
defers jobs and syncs
Android 7.0 (Nougat) Behaviour Changes
- Doze
API level 24
If the device is stationary for a certain time after entering
Doze, the system applies the rest of the Doze restrictions
to PowerManager.WakeLock, AlarmManager alarms,
GPS, and Wi-Fi scans.
Android 8.0 (Oreo) Behaviour Changes
- Background execution limits
- Android background location
limits.
API level 26
•Apps that are running in the background now have
limits on how freely they can access background
services.
•Apps cannot use their manifests to register for most
implicit broadcasts (that is, broadcasts that are not
targeted specifically at the app).
workaround
Android (P Preview) Behaviour Changes
- App Standby Bucket
API level 28, full release in Q3
• Active— An application that is currently in use by the user (app in foreground).
• Working Set — An application that is not currently in use but is run quite often,
likely most days. For example, even if for short periods, you’re likely to open the
Twitter app several times a day.
• Frequent— An application that is not currently in use but is sometimes opened
throughout the week. For example, if you go running 3 times a week then the app
you use to track your runs would fall into this.
• Rare— An application that is rarely used on the device. For example, a ride
sharing app that you may only use when you go on Holiday.
• Never— An application that has been installed but never launched.
Android (P Preview) Behaviour Changes
- App Standby Bucket
API level 28, full release in Q3
System will use machine learning to determine the
frequency of apps and then these will be placed into
buckets based on those predictions.
• In particular, the bucket determines how frequently the app's jobs
run, how often the app can trigger alarms, and how often the app
can receive high-priority Firebase Cloud
Messaging (FCM) messages.
• help to ensure that system resources are given to the apps that
need them the most.
https://developer.android.com/preview/features/power
Design Patterns in Android
Model View Controller
Model View Controller
https://www.amazon.com/Android-Programming-
Nerd-Ranch-Guide/dp/0134171454
Model View Controller
How do you test MVC?
Model View Controller
How do you test MVC?
And then we can achieve testable
pattern here.
But, Controller still has reference to the
view.
So, you cant test controller by using
jUnit.
Model View Controller
Create View Interface that
reference to Controller
(Problem solve)
Model View Controller
But, who’ handle UI Logic?
Model View Controller
But, who’ handle UI Logic?
Model View Controller
View?
Model View Controller
Model?
I don’t think so, since model handle
business logic not UI Logic
Model View Controller
Model View Controller
Model View Presenter
Model View Presenter
Model View View Model
The Reactive Patterns
Model View View Model
Model View View Model
Model View View Model
Model View View Model
Model View View Model
Model View Intent
Model View Intent
Intents represents, name of event, click Foo
Actions defines the logic that should be executed by
the Processor.
Processor simply executes an Action
Results are the result of what have been
executed inside the Processor. Their can be
errors, successful execution
The Reducer is responsible to generate the ViewState
The State contains all the information the View needs to
render itself.
Clean Architecture
Clean Architecture
View Architecture
Q&A
Reference
- Object-Oriented Programming in C# Succinctly by Sander Rossel
- Solid Principle by Gaurav Kumar Arora
- Java Design Pattern by Vaskaran Sarcar
- Clean Code by Robert C. Martin
- Effective Java 3rd Edition by Joshua Bloch
- Working with legacy code by Michael C. Feathers
- Refactoring to Patterns by Joshua Kerievsky
- Pragmatic Programmer by Andy Hunt and Dave Thomas
Fundamental
Android
- Android Programming: The Big Nerd Ranch Guide 3rd Edition
- Kotlin in Action by Dmitry Jemerov
- Kotlin for Android Developers by Antonio Leiva
- BDD in Action by John Ferguson Smart
Test

More Related Content

Similar to A Journey Through Android Development

Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Gustavo Fuentes Zurita
 
Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Gustavo Fuentes Zurita
 
Android lifecycle
Android lifecycleAndroid lifecycle
Android lifecycleKumar
 
Android - Open Source Bridge 2011
Android - Open Source Bridge 2011Android - Open Source Bridge 2011
Android - Open Source Bridge 2011sullis
 
Appium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | EdurekaAppium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | EdurekaEdureka!
 
Android Workshop
Android WorkshopAndroid Workshop
Android WorkshopJunda Ong
 
Mobile UI Testing using Appium and Docker
Mobile UI Testing using Appium and DockerMobile UI Testing using Appium and Docker
Mobile UI Testing using Appium and DockerMoataz Nabil
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Developmentsonichinmay
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android AppsGil Irizarry
 
Testing android apps with espresso
Testing android apps with espressoTesting android apps with espresso
Testing android apps with espressoÉdipo Souza
 
Getting started with android programming
Getting started with android programmingGetting started with android programming
Getting started with android programmingPERKYTORIALS
 
Native Android Development with Spring
Native Android Development with SpringNative Android Development with Spring
Native Android Development with SpringRoy Clarkson
 
Automation Proposal_V1.0
Automation Proposal_V1.0Automation Proposal_V1.0
Automation Proposal_V1.0Dao Nhỏ
 
Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15sullis
 
Expert Guidance on debugging React Native Apps: Recommended Practices and Han...
Expert Guidance on debugging React Native Apps: Recommended Practices and Han...Expert Guidance on debugging React Native Apps: Recommended Practices and Han...
Expert Guidance on debugging React Native Apps: Recommended Practices and Han...Shelly Megan
 
Day 1 Android Apps (Education ICT-Comp Science)
Day 1 Android Apps (Education ICT-Comp Science)Day 1 Android Apps (Education ICT-Comp Science)
Day 1 Android Apps (Education ICT-Comp Science)morewebber
 

Similar to A Journey Through Android Development (20)

Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9
 
Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9
 
Android lifecycle
Android lifecycleAndroid lifecycle
Android lifecycle
 
Android - Open Source Bridge 2011
Android - Open Source Bridge 2011Android - Open Source Bridge 2011
Android - Open Source Bridge 2011
 
Appium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | EdurekaAppium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | Edureka
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Mobile UI Testing using Appium and Docker
Mobile UI Testing using Appium and DockerMobile UI Testing using Appium and Docker
Mobile UI Testing using Appium and Docker
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Development
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
Testing android apps with espresso
Testing android apps with espressoTesting android apps with espresso
Testing android apps with espresso
 
React django
React djangoReact django
React django
 
Getting started with android programming
Getting started with android programmingGetting started with android programming
Getting started with android programming
 
Native Android Development with Spring
Native Android Development with SpringNative Android Development with Spring
Native Android Development with Spring
 
Android crash course
Android crash courseAndroid crash course
Android crash course
 
Automation Proposal_V1.0
Automation Proposal_V1.0Automation Proposal_V1.0
Automation Proposal_V1.0
 
Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15
 
Expert Guidance on debugging React Native Apps: Recommended Practices and Han...
Expert Guidance on debugging React Native Apps: Recommended Practices and Han...Expert Guidance on debugging React Native Apps: Recommended Practices and Han...
Expert Guidance on debugging React Native Apps: Recommended Practices and Han...
 
Android development beginners faq
Android development  beginners faqAndroid development  beginners faq
Android development beginners faq
 
Android_ver_01
Android_ver_01Android_ver_01
Android_ver_01
 
Day 1 Android Apps (Education ICT-Comp Science)
Day 1 Android Apps (Education ICT-Comp Science)Day 1 Android Apps (Education ICT-Comp Science)
Day 1 Android Apps (Education ICT-Comp Science)
 

More from raditya gumay

[Slide Deck] - Mobile Observability Internals at Gojek
[Slide Deck] - Mobile Observability Internals at Gojek[Slide Deck] - Mobile Observability Internals at Gojek
[Slide Deck] - Mobile Observability Internals at Gojekraditya gumay
 
Slide Deck - Shift Left Beyond App Performance Improvement at Gojek_.pptx
Slide Deck - Shift Left Beyond App Performance Improvement at Gojek_.pptxSlide Deck - Shift Left Beyond App Performance Improvement at Gojek_.pptx
Slide Deck - Shift Left Beyond App Performance Improvement at Gojek_.pptxraditya gumay
 
Mathematical Morphology and Proposed JPEG Quantization in Image Steganography
Mathematical Morphology and Proposed JPEG Quantization in Image SteganographyMathematical Morphology and Proposed JPEG Quantization in Image Steganography
Mathematical Morphology and Proposed JPEG Quantization in Image Steganographyraditya gumay
 
Gojek Android Engineering at Scale vol 2
Gojek Android Engineering at Scale vol 2Gojek Android Engineering at Scale vol 2
Gojek Android Engineering at Scale vol 2raditya gumay
 
Mobile engineering at GOJEK Scale
Mobile engineering at GOJEK ScaleMobile engineering at GOJEK Scale
Mobile engineering at GOJEK Scaleraditya gumay
 
The Journey of Craftmanship – Kotlin in Action
The Journey of Craftmanship – Kotlin in ActionThe Journey of Craftmanship – Kotlin in Action
The Journey of Craftmanship – Kotlin in Actionraditya gumay
 
Firebase Predictions
Firebase PredictionsFirebase Predictions
Firebase Predictionsraditya gumay
 

More from raditya gumay (7)

[Slide Deck] - Mobile Observability Internals at Gojek
[Slide Deck] - Mobile Observability Internals at Gojek[Slide Deck] - Mobile Observability Internals at Gojek
[Slide Deck] - Mobile Observability Internals at Gojek
 
Slide Deck - Shift Left Beyond App Performance Improvement at Gojek_.pptx
Slide Deck - Shift Left Beyond App Performance Improvement at Gojek_.pptxSlide Deck - Shift Left Beyond App Performance Improvement at Gojek_.pptx
Slide Deck - Shift Left Beyond App Performance Improvement at Gojek_.pptx
 
Mathematical Morphology and Proposed JPEG Quantization in Image Steganography
Mathematical Morphology and Proposed JPEG Quantization in Image SteganographyMathematical Morphology and Proposed JPEG Quantization in Image Steganography
Mathematical Morphology and Proposed JPEG Quantization in Image Steganography
 
Gojek Android Engineering at Scale vol 2
Gojek Android Engineering at Scale vol 2Gojek Android Engineering at Scale vol 2
Gojek Android Engineering at Scale vol 2
 
Mobile engineering at GOJEK Scale
Mobile engineering at GOJEK ScaleMobile engineering at GOJEK Scale
Mobile engineering at GOJEK Scale
 
The Journey of Craftmanship – Kotlin in Action
The Journey of Craftmanship – Kotlin in ActionThe Journey of Craftmanship – Kotlin in Action
The Journey of Craftmanship – Kotlin in Action
 
Firebase Predictions
Firebase PredictionsFirebase Predictions
Firebase Predictions
 

Recently uploaded

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 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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
 
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 Scriptwesley chun
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Recently uploaded (20)

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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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...
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

A Journey Through Android Development

  • 1. A Journey Through Android Development Raditya Gumay
  • 2. Agenda Introduction • What is Android • Design Pattern • Codebase Architecture • View Architecture • Problems • Q&A
  • 3. What is Android Android is a mobile operating system developed by Google, based on a modified version of the Linux kernel. ~ wikipedia ~ statista
  • 4. Android A Developer’s History cupcake donut eclair froyo Ginger bread Honey comb Ice cream sandwich Jelly Bean kitkat lollipop marsmellow nougat oreo
  • 5. Android 6.0 (Marshmellow) Behaviour Changes - Runtime Permission - Doze and App Standby API level 23
  • 6. Runtime Permission https://developer.android.com/training/permissions/reques ting if (ContextCompat.checkSelfPermission(thisActivity, Manifest.permission.WRITE_CALENDAR) != PackageManager.PERMISSION_GRANTED) { // Permission is not granted } <manifest xmlns:android="http://schemas.android.com/apk/res/andro id" package="com.example.snazzyapp"> <uses-permission android:name="android.permission.SEND_SMS"/> <!-- other permissions go here --> <application ...> ... </application> </manifest>
  • 7. Doze and App Standby https://developer.android.com/training/monitoring-device- state/doze-standby Doze restrictions The following restrictions apply to your apps while in Doze: •Network access is suspended. •The system ignores wake locks. •Standard AlarmManager alarms (including setExact() and setWindow()) are deferred to the next maintenance window. • If you need to set alarms that fire while in Doze, use setAndAllowWhileIdle() or setExactAndAllowWhileIdle(). • Alarms set with setAlarmClock() continue to fire normally — the system exits Doze shortly before those alarms fire. •The system does not perform Wi-Fi scans. •The system does not allow sync adapters to run. •The system does not allow JobScheduler to run. Doze checklist • If possible, use FCM for downstream messaging. • If your users must see a notification right away, make sure to use an FCM high priority message. • Provide sufficient information within the initial message payload, so subsequent network access is unnecessary. • Set critical alarms with setAndAllowWhileIdle() and setExactAndAllowWhileIdle().
  • 8. Android 7.0 (Nougat) Behaviour Changes - Doze API level 24 When a device is on battery power, and the screen has been off for a certain time, the device enters Doze and applies the first subset of restrictions: It shuts off app network access, and defers jobs and syncs
  • 9. Android 7.0 (Nougat) Behaviour Changes - Doze API level 24 If the device is stationary for a certain time after entering Doze, the system applies the rest of the Doze restrictions to PowerManager.WakeLock, AlarmManager alarms, GPS, and Wi-Fi scans.
  • 10. Android 8.0 (Oreo) Behaviour Changes - Background execution limits - Android background location limits. API level 26 •Apps that are running in the background now have limits on how freely they can access background services. •Apps cannot use their manifests to register for most implicit broadcasts (that is, broadcasts that are not targeted specifically at the app). workaround
  • 11. Android (P Preview) Behaviour Changes - App Standby Bucket API level 28, full release in Q3 • Active— An application that is currently in use by the user (app in foreground). • Working Set — An application that is not currently in use but is run quite often, likely most days. For example, even if for short periods, you’re likely to open the Twitter app several times a day. • Frequent— An application that is not currently in use but is sometimes opened throughout the week. For example, if you go running 3 times a week then the app you use to track your runs would fall into this. • Rare— An application that is rarely used on the device. For example, a ride sharing app that you may only use when you go on Holiday. • Never— An application that has been installed but never launched.
  • 12. Android (P Preview) Behaviour Changes - App Standby Bucket API level 28, full release in Q3 System will use machine learning to determine the frequency of apps and then these will be placed into buckets based on those predictions. • In particular, the bucket determines how frequently the app's jobs run, how often the app can trigger alarms, and how often the app can receive high-priority Firebase Cloud Messaging (FCM) messages. • help to ensure that system resources are given to the apps that need them the most. https://developer.android.com/preview/features/power
  • 16. Model View Controller How do you test MVC?
  • 17. Model View Controller How do you test MVC? And then we can achieve testable pattern here. But, Controller still has reference to the view. So, you cant test controller by using jUnit.
  • 18. Model View Controller Create View Interface that reference to Controller (Problem solve)
  • 19. Model View Controller But, who’ handle UI Logic?
  • 20. Model View Controller But, who’ handle UI Logic?
  • 22. Model View Controller Model? I don’t think so, since model handle business logic not UI Logic
  • 27. Model View View Model The Reactive Patterns
  • 34. Model View Intent Intents represents, name of event, click Foo Actions defines the logic that should be executed by the Processor. Processor simply executes an Action Results are the result of what have been executed inside the Processor. Their can be errors, successful execution The Reducer is responsible to generate the ViewState The State contains all the information the View needs to render itself.
  • 38. Q&A
  • 39. Reference - Object-Oriented Programming in C# Succinctly by Sander Rossel - Solid Principle by Gaurav Kumar Arora - Java Design Pattern by Vaskaran Sarcar - Clean Code by Robert C. Martin - Effective Java 3rd Edition by Joshua Bloch - Working with legacy code by Michael C. Feathers - Refactoring to Patterns by Joshua Kerievsky - Pragmatic Programmer by Andy Hunt and Dave Thomas Fundamental Android - Android Programming: The Big Nerd Ranch Guide 3rd Edition - Kotlin in Action by Dmitry Jemerov - Kotlin for Android Developers by Antonio Leiva - BDD in Action by John Ferguson Smart Test

Editor's Notes

  1. 1