SlideShare a Scribd company logo
Developing Android apps
like Navy Seals
Ivan Kušt, Android team leader
Infinum Android team
How it all began?
How it all began
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
First steps
• Android plugin for Eclipse
• tests? who needs them
• Activities with > 1k lines
First steps
• no segregation of duties
• no code review
• poor code structure
Aint nobody got time for that
Regression testing?
So what did we do?
• Improved implementation process
• Included testing to development process
• Improved release process and analytics
Implementation
process
Working in a team
• git conflicts
• different code styles
• environment switching (test, production)
Working in a team
• bugfixing while developing a new feature
• weekly meetings and progress reports
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
branching / merging process
Pull Requests
debug staging release
obfuscated no yes yes
logs yes yes no
crash reporting no yes in most cases
Build types
Gradle
• Build types - debug, staging, release
• Product flavors - test API server, production API
server
Product flavors
• number of flavours = number of API environments
Build variants
• flavor x buildType
• example productionDebug
• production API
• debuggable, unobfuscated, logs enabled
Model Presenter View
Code architecture
MVP
• a derivative from MVC
• Models and Views never communicate directly
Model Presenter View
View
• Activity, Fragment, View
• propagates UI events to presenter
• exposes methods that control presentation of data
Model Presenter View
Presenter
• middle man between View and Model
• updates the UI - difference to MVC
Presenter ViewModel Presenter
• Activity, Fragment, View
• propagates UI events to presenter
• exposes methods that control presentation of data
View
View
Model
• gateway towards the business logic
• methods for data retrieval
Model Presenter
Example
showLoading()
hideLoading()
setUsernameError()
setPasswordError()
LoginPresenter
login(username, pass)
LoginView LoginModel
login(username, pass,
listener)
showLoading()
hideLoading()
setUsernameError()
setPasswordError()
LoginActivity
loginPresenter
login(username, pass)
LoginPresenterImpl
loginView
loginModel
LoginModelImpl
login(username, pass,
listener)
Testing
Instrument testing
• Robotium, Espresso
• runs on emulator or real device
Unit testing
• Robolectric
• write mock View and Interactor
• unit test Presenter
Dependency injection
• Dagger 2
• https://github.com/reisub/Dagger-2-Example
• simplifies writing tests
• Model / View / Presenter can easily be replaced
Without DI
@Override

protected void onCreate(Bundle savedInstanceState) {

//...



//dependencies

loginPresenter = new LoginPresenterImpl(this, new LoginModelImpl());



}
LoginView LoginPresenter LoginModel
LoginActivity LoginPresenterImpl LoginModelImpl
With DI
@Override

protected void onCreate(Bundle savedInstanceState) {

//...



//dependencies
DaggerLoginComponent.builder()
.loginModule(new LoginModule(this))
.build()
.inject(this);



}
With DI
• decoupling dependencies from implementation
• easier to replace dependencies
• more about Dagger:

http://google.github.io/dagger/
Robolectric
• mock Android VM (tests run on desktop machine)
• View doesn’t have to be mocked
• full control of Activity / Fragment lifecycle
• http://robolectric.org/
MockWebServer
• part of OkHttp library
• server that runs on localhost
• responses can be enqueued
• https://github.com/square/okhttp/tree/master/
mockwebserver
Mocking network layer
• network layer can be replaced with MockWebServer
• no additional mock classes
Continuous integration
• if not forced, you won’t run tests
Idea
• commit to a branch starts test execution
• CI server clones the repo, compiles and runs tests
• test results are archived and notified via mail / chat
CI servers
• Jenkins
• Travis
• Circle CI
• https://circleci.com/
• works only with GitHub
Static code checks
Findbugs
• http://findbugs.sourceforge.net/
• java.net.URL.hashCode()
Android Lint
• android related checks
• missing translations
• unused drawables
Checkstyle
Releasing
and analytics
Infinum Labs
Infinum Labs
• internal app store
• gradle task increments version name
• upload app via web, CLI tool or AS plugin
• library that notifies when new version is available
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Analytics
Recap
• Improved implementation process
• Included testing to development process
• Improved release process and analytics
Implementation process
• organise teamwork - git flow
• monitor code quality - pull requests
• one click build - build variants
• code structuring - MVP
Testing
• Unit testing
• Continuous integration
• Static code checks
Releasing and analytics
• internal store for clients
• automatic notification when new version is up
• analytics / crashlytics
• initial project setup takes more time
• steeper learning and onboarding curve
• developing new features initially takes more time to
cover the code with unit test
Cons
• confidence in builds

(so much that we believe we’re Navy Seals)
• more maintainable code
• regression testing
Pros
Implementation Testing Release Post Release
Architecture
Build Types
MVP
Dependency
injection
Unit Tests
Robolectric
MockWebServer
Manual tests
Human tester
Infinum
Notifier lib
Analytics
Google analytics
Crashlytics
Play Store
Ivan Kušt
ivan@infinum.co
• if you have any questions:

More Related Content

What's hot (20)

PDF
Patterns and practices for building enterprise-scale HTML5 apps
Phil Leggetter
 
PPTX
Introduction to cypress in Angular (Chinese)
Hong Tat Yew
 
PPTX
Enhance existing REST APIs (e.g. Facebook Graph API) with code completion us...
johannes_fiala
 
PPTX
ATAGTR2017 Performance Automation in Dev-Ops
Agile Testing Alliance
 
PPTX
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
eleksdev
 
PDF
A Separation of Concerns: Clean Architecture on Android
Outware Mobile
 
PPTX
ATAGTR2017 Expanding test horizons with Robot Framework
Agile Testing Alliance
 
PPT
Intro to Service Worker API and its use cases
satejsahu
 
PPTX
Cucumber Tool
Sohail Ahmed
 
PPTX
What's new in Visual Studio 2013 & TFS 2013
Danijel Malik
 
PPTX
Hands on BDD with cucumber - Agile Goa Sept 2013
Sonik Chopra
 
PDF
Designing APIs with OpenAPI Spec
Adam Paxton
 
PPTX
Automated Acceptance Tests & Tool choice
toddbr
 
PPTX
Hidden Treasure - TestComplete Script Extensions
SmartBear
 
PDF
Documenting your REST API with Swagger - JOIN 2014
JWORKS powered by Ordina
 
PPTX
Test Automation Framework with BDD and Cucumber
Rhoynar Software Consulting
 
PPTX
Operations Validation for Infrastructure As Code - PSConfEU 2016
Ravikanth Chaganti
 
PPTX
Cypress test techniques cucumber bdd framework,tdd,api tests course
Narayanan Palani
 
PPTX
Introduction to Bdd and cucumber
Nibu Baby
 
Patterns and practices for building enterprise-scale HTML5 apps
Phil Leggetter
 
Introduction to cypress in Angular (Chinese)
Hong Tat Yew
 
Enhance existing REST APIs (e.g. Facebook Graph API) with code completion us...
johannes_fiala
 
ATAGTR2017 Performance Automation in Dev-Ops
Agile Testing Alliance
 
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
eleksdev
 
A Separation of Concerns: Clean Architecture on Android
Outware Mobile
 
ATAGTR2017 Expanding test horizons with Robot Framework
Agile Testing Alliance
 
Intro to Service Worker API and its use cases
satejsahu
 
Cucumber Tool
Sohail Ahmed
 
What's new in Visual Studio 2013 & TFS 2013
Danijel Malik
 
Hands on BDD with cucumber - Agile Goa Sept 2013
Sonik Chopra
 
Designing APIs with OpenAPI Spec
Adam Paxton
 
Automated Acceptance Tests & Tool choice
toddbr
 
Hidden Treasure - TestComplete Script Extensions
SmartBear
 
Documenting your REST API with Swagger - JOIN 2014
JWORKS powered by Ordina
 
Test Automation Framework with BDD and Cucumber
Rhoynar Software Consulting
 
Operations Validation for Infrastructure As Code - PSConfEU 2016
Ravikanth Chaganti
 
Cypress test techniques cucumber bdd framework,tdd,api tests course
Narayanan Palani
 
Introduction to Bdd and cucumber
Nibu Baby
 

Viewers also liked (20)

ODP
Asynctasks
Anthony Dahanne
 
PPTX
Performance #6 threading
Vitali Pekelis
 
PDF
Android Loaders : Reloaded
cbeyls
 
PPTX
Android Database Tutorial
Perfect APK
 
PPTX
Sqlite Multiple Table
Danang Kukuh Pribadi
 
PPT
[Android] Google Play in app billing
Jun Shimizu
 
PPTX
Android async task
Madhu Venkat
 
PPTX
Android Dialogs Tutorial
Perfect APK
 
PPT
Object Relational model for SQLIite in android
yugandhar vadlamudi
 
PPTX
BroadcastReceivers in Android
Perfect APK
 
PDF
Android Http Connection and SAX Parsing
Jussi Pohjolainen
 
PPTX
Android Training (AdapterView & Adapter)
Khaled Anaqwa
 
PPTX
Android material design lecture #2
Vitali Pekelis
 
PPTX
Android Training (Storing & Shared Preferences)
Khaled Anaqwa
 
PPTX
Android AsyncTask Tutorial
Perfect APK
 
PPTX
Android Training (Content Provider)
Khaled Anaqwa
 
PPTX
Android Database
Rashad Aliyev
 
PPTX
Android Tutorials : Basic widgets
Prajyot Mainkar
 
PPT
Android - Thread, Handler and AsyncTask
Hoang Ngo
 
PDF
Android IPC Mechanism
National Cheng Kung University
 
Asynctasks
Anthony Dahanne
 
Performance #6 threading
Vitali Pekelis
 
Android Loaders : Reloaded
cbeyls
 
Android Database Tutorial
Perfect APK
 
Sqlite Multiple Table
Danang Kukuh Pribadi
 
[Android] Google Play in app billing
Jun Shimizu
 
Android async task
Madhu Venkat
 
Android Dialogs Tutorial
Perfect APK
 
Object Relational model for SQLIite in android
yugandhar vadlamudi
 
BroadcastReceivers in Android
Perfect APK
 
Android Http Connection and SAX Parsing
Jussi Pohjolainen
 
Android Training (AdapterView & Adapter)
Khaled Anaqwa
 
Android material design lecture #2
Vitali Pekelis
 
Android Training (Storing & Shared Preferences)
Khaled Anaqwa
 
Android AsyncTask Tutorial
Perfect APK
 
Android Training (Content Provider)
Khaled Anaqwa
 
Android Database
Rashad Aliyev
 
Android Tutorials : Basic widgets
Prajyot Mainkar
 
Android - Thread, Handler and AsyncTask
Hoang Ngo
 
Android IPC Mechanism
National Cheng Kung University
 
Ad

Similar to Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt (20)

PPTX
Continuous Security Testing with Devops - OWASP EU 2014
Stephen de Vries
 
PDF
Automated Testing in DevOps
Haufe-Lexware GmbH & Co KG
 
PPTX
Udvid din test portefølje med coded ui test og cloud load test
Peter Lindberg
 
PPTX
Test automation proposal
Mihai-Cristian Fratila
 
PPTX
Azure Integration DTAP Series, How to go from Development to Production – Par...
BizTalk360
 
PPTX
Azure Integration DTAP Series, How to go from Development to Production – Par...
BizTalk360
 
PDF
Why your company loves to welcome change but sucks at accommodating it
Farooq Ali
 
PPTX
Acing application lifecycle management in SharePoint
Jeremy Thake
 
PPTX
Continuous Delivery - Automate & Build Better Software with Travis CI
wajrcs
 
PPTX
Hudson
8x8
 
PDF
Testing Tools Online Training.pdf
SpiritsoftsTraining
 
PDF
QuerySurge for DevOps
RTTS
 
PPTX
Continuous Integration Testing for SAP
Worksoft
 
PDF
KrishnaToolComparisionPPT.pdf
QA or the Highway
 
PPTX
DevOps for AI Apps
Richin Jain
 
PPTX
Dev/Test scenarios in DevOps world
Davide Benvegnù
 
PDF
Continuous Delivery: How RightScale Releases Weekly
RightScale
 
PPTX
Inflectracon2020: Advantages of Integrating a DevSecOps Pipeline with the Spi...
Inflectra
 
PDF
Unit Testing in JavaScript
Rob Scaduto
 
PPTX
Lean-Agile Development with SharePoint - Bill Ayers
SPC Adriatics
 
Continuous Security Testing with Devops - OWASP EU 2014
Stephen de Vries
 
Automated Testing in DevOps
Haufe-Lexware GmbH & Co KG
 
Udvid din test portefølje med coded ui test og cloud load test
Peter Lindberg
 
Test automation proposal
Mihai-Cristian Fratila
 
Azure Integration DTAP Series, How to go from Development to Production – Par...
BizTalk360
 
Azure Integration DTAP Series, How to go from Development to Production – Par...
BizTalk360
 
Why your company loves to welcome change but sucks at accommodating it
Farooq Ali
 
Acing application lifecycle management in SharePoint
Jeremy Thake
 
Continuous Delivery - Automate & Build Better Software with Travis CI
wajrcs
 
Hudson
8x8
 
Testing Tools Online Training.pdf
SpiritsoftsTraining
 
QuerySurge for DevOps
RTTS
 
Continuous Integration Testing for SAP
Worksoft
 
KrishnaToolComparisionPPT.pdf
QA or the Highway
 
DevOps for AI Apps
Richin Jain
 
Dev/Test scenarios in DevOps world
Davide Benvegnù
 
Continuous Delivery: How RightScale Releases Weekly
RightScale
 
Inflectracon2020: Advantages of Integrating a DevSecOps Pipeline with the Spi...
Inflectra
 
Unit Testing in JavaScript
Rob Scaduto
 
Lean-Agile Development with SharePoint - Bill Ayers
SPC Adriatics
 
Ad

More from Infinum (20)

PDF
Infinum Android Talks #20 - Making your Android apps fast like Blue Runner an...
Infinum
 
PDF
Infinum Android Talks #20 - DiffUtil
Infinum
 
PDF
Infinum Android Talks #20 - Benefits of using Kotlin
Infinum
 
PDF
Infinum iOS Talks #4 - Making our VIPER more reactive
Infinum
 
PDF
Infinum iOS Talks #4 - Making your Swift networking code more awesome with Re...
Infinum
 
PDF
Infinum Android Talks #13 - Using ViewDragHelper
Infinum
 
PDF
Infinum Android Talks #14 - Log4j
Infinum
 
PDF
Infinum Android Talks #9 - Making your app location-aware
Infinum
 
PDF
Infinum Android Talks #14 - Gradle plugins
Infinum
 
PDF
Infinum Android Talks #14 - Facebook for Android API
Infinum
 
PDF
Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj...
Infinum
 
PDF
Infinum Android Talks #18 - Create fun lists by Ivan Marić
Infinum
 
PDF
Infinum Android Talks #18 - In-app billing by Ivan Marić
Infinum
 
PDF
Infinum Android Talks #18 - How to cache like a boss by Željko Plesac
Infinum
 
PDF
Infinum iOS Talks #2 - VIPER for everybody by Damjan Vujaklija
Infinum
 
PDF
Infinum iOS Talks #2 - Xamarin by Ivan Đikić
Infinum
 
PDF
Infinum iOS Talks #1 - Swift under the hood: Method Dispatching by Vlaho Poluta
Infinum
 
PDF
Infinum iOS Talks #1 - Swift done right by Ivan Dikic
Infinum
 
PDF
Infinum iOS Talks #1 - Becoming an iOS developer swiftly by Vedran Burojevic
Infinum
 
PDF
Infinum Android Talks #17 - Testing your Android applications by Ivan Kust
Infinum
 
Infinum Android Talks #20 - Making your Android apps fast like Blue Runner an...
Infinum
 
Infinum Android Talks #20 - DiffUtil
Infinum
 
Infinum Android Talks #20 - Benefits of using Kotlin
Infinum
 
Infinum iOS Talks #4 - Making our VIPER more reactive
Infinum
 
Infinum iOS Talks #4 - Making your Swift networking code more awesome with Re...
Infinum
 
Infinum Android Talks #13 - Using ViewDragHelper
Infinum
 
Infinum Android Talks #14 - Log4j
Infinum
 
Infinum Android Talks #9 - Making your app location-aware
Infinum
 
Infinum Android Talks #14 - Gradle plugins
Infinum
 
Infinum Android Talks #14 - Facebook for Android API
Infinum
 
Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj...
Infinum
 
Infinum Android Talks #18 - Create fun lists by Ivan Marić
Infinum
 
Infinum Android Talks #18 - In-app billing by Ivan Marić
Infinum
 
Infinum Android Talks #18 - How to cache like a boss by Željko Plesac
Infinum
 
Infinum iOS Talks #2 - VIPER for everybody by Damjan Vujaklija
Infinum
 
Infinum iOS Talks #2 - Xamarin by Ivan Đikić
Infinum
 
Infinum iOS Talks #1 - Swift under the hood: Method Dispatching by Vlaho Poluta
Infinum
 
Infinum iOS Talks #1 - Swift done right by Ivan Dikic
Infinum
 
Infinum iOS Talks #1 - Becoming an iOS developer swiftly by Vedran Burojevic
Infinum
 
Infinum Android Talks #17 - Testing your Android applications by Ivan Kust
Infinum
 

Recently uploaded (20)

PDF
What companies do with Pharo (ESUG 2025)
ESUG
 
PDF
AI Software Engineering based on Multi-view Modeling and Engineering Patterns
Hironori Washizaki
 
PDF
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
PDF
System Center 2025 vs. 2022; What’s new, what’s next_PDF.pdf
Q-Advise
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
PDF
SAP GUI Installation Guide for macOS (iOS) | Connect to SAP Systems on Mac
SAP Vista, an A L T Z E N Company
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PPTX
Presentation about Database and Database Administrator
abhishekchauhan86963
 
PPTX
ChessBase 18.02 Crack + Serial Key Free Download
cracked shares
 
PDF
Troubleshooting Virtual Threads in Java!
Tier1 app
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
PDF
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
PDF
Infrastructure planning and resilience - Keith Hastings.pptx.pdf
Safe Software
 
PDF
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
PDF
AWS_Agentic_AI_in_Indian_BFSI_A_Strategic_Blueprint_for_Customer.pdf
siddharthnetsavvies
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PDF
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
PDF
Supabase Meetup: Build in a weekend, scale to millions
Carlo Gilmar Padilla Santana
 
PDF
How Agentic AI Networks are Revolutionizing Collaborative AI Ecosystems in 2025
ronakdubey419
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
What companies do with Pharo (ESUG 2025)
ESUG
 
AI Software Engineering based on Multi-view Modeling and Engineering Patterns
Hironori Washizaki
 
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
System Center 2025 vs. 2022; What’s new, what’s next_PDF.pdf
Q-Advise
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
SAP GUI Installation Guide for macOS (iOS) | Connect to SAP Systems on Mac
SAP Vista, an A L T Z E N Company
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
Presentation about Database and Database Administrator
abhishekchauhan86963
 
ChessBase 18.02 Crack + Serial Key Free Download
cracked shares
 
Troubleshooting Virtual Threads in Java!
Tier1 app
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
Infrastructure planning and resilience - Keith Hastings.pptx.pdf
Safe Software
 
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
AWS_Agentic_AI_in_Indian_BFSI_A_Strategic_Blueprint_for_Customer.pdf
siddharthnetsavvies
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
Supabase Meetup: Build in a weekend, scale to millions
Carlo Gilmar Padilla Santana
 
How Agentic AI Networks are Revolutionizing Collaborative AI Ecosystems in 2025
ronakdubey419
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 

Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt