SlideShare a Scribd company logo
Pragmatic approach
to building native
apps – Hybrid Way
Priyank Gupta
Mar 2014
2
Devices
move with
YOU
Definition of mobile is rapidly evolving
3
Challenges
for
New
Platform
Apps and
Developer
Community
Patent Wars
Ripe
Competition
OS
Fragmentation
4
Web
support
In platforms
5
Technical
Challenges
Business
6
Lets bridge the gap
7
A typical hybrid architecture
JavaScript objects in
WebView
Fragment with Webview
WebView in activity
Reusable
HTML and
JS inside
WebViews
Native
Web
Fat logic
Platform APIs
exposed via
Native
interface
Native Platform
APIs
8
A curious case of Minty’s café
Gather ingredients
1
Take orderLookup recipe
Cook
Taste
Pass the dish
Plate the dish
2
3
4
5
6
6
Serve
7
请问王
André
Minty the
Chef
9
Minty’s café to hybrid apps
Fetch data by http
1
User requestBusiness logic
Processing
Validations
Call with data to render
Build native UI
2
3
4
5
6
6
Show on screen
7
IOS
Android
JSON
HTML and
Native
Bridge
10
A bridge implementation
Android bridge between JavaScript engine and
native views
method
1
method
1
method
2
method
2
Java
Activity
Fat logic
Thin
native
views
Bridge
JavaScript
Hidden Fragment with Webview
Hidden WebView in activity
JS engine like Mozilla Rhino
Native
Web
11
A bridge implementation
method
1
method
1
method
2
method
2
Page
Object
Fat logic
Bridge
JavaScript
Hidden Fragment with Webview
Hidden WebView in activity
JS engine like Mozilla Rhino
Reusable
HTML and
JS inside
WebViews
Android bridge between JavaScript engine and
reusable web views
Native
Web
12
A bridge implementation
method
1
method
1
method
2
method
2
Java
WebView
Activity
Fat logic
Bridge
JavaScript
Hidden Fragment with Webview
Hidden WebView in activity
JS engine like Mozilla Rhino
Reusable
HTML and
JS inside
WebViews
Reusing HTML & JS for mobile web app
Native
Web
13
Show me how!?
14
Experience
Native App in Play store
Mobile web app
http://tinyurl.com/btplay
http://tinyurl.com/bloodtorrent
15
Quick demo
16
Menu Page
Button click in either
triggers a changePage
event via bridge
Does native image
manipulation for circular
image with boundary.
Organizes pages with
single page architecture
to stay responsive
17
Donation listing page
Both uses bridge and
controller to make http call
with location to fetch donation
list
Uses two different fragments
to show map and page slider
at bottom
Uses web browser api to
request user location in
javascript code
18
New donation request page
Validations, persistence and
business logic is applied by
common controller and bridge
Uses native components to
capture different input values
HAML views are reused
across most pages via
layouts and templates
19
App is open source
Links to
https://github.com/priya
aank/bloodtorrent
20
Patterns for reuse with
bridge
21
Model View
View Model “Model View ViewModel is a specialized case of
Presentation Model Pattern. Presentation Model is
defined as the state and behavior of the presentation
independent of the GUI controls used in the interface”
• Pulls view behavior in a model class that is
part of presentation
• Presentation Model may interact with
several domain objects, but Presentation
Model is not a GUI friendly facade to a
specific domain object.
Courtesy: Presentation Model bliki by Martin Fowler
22
A bridge implementation
Android bridge between JavaScript
engine and native views
method
1
method
1
method
2
method
2
Java
Activity
Fat logic
Thin
native
views
Bridge
JavaScript
Hidden Fragment with Webview
Hidden WebView in activity
JS engine like Mozilla Rhino
Native
Web
23
MVVM based hybrid apps
Logic UI
NativeHTML
Logic UI
Feature in an app
24
Page
Object
• Object encapsulates the internals of a
view from external consumers
• Provides API for external world to
interact with page in a consistent way
“The Page Object pattern represents the
screens of your web app as a series of objects”
~ Selenium Wiki
25
Coming back to bridge in Android
method
1
method
1
method
2
method
2
Page
Object
Fat logic
Bridge
JavaScript
Hidden Fragment with Webview
Hidden WebView in activity
JS engine like Mozilla Rhino
Reusable
HTML and
JS inside
WebViews
Android bridge between JavaScript engine
and reusable web views
Native
Web
26
And bridge in web app
method
1
method
1
method
2
method
2
Java
WebView
Activity
Fat logic
Bridge
JavaScript
Hidden Fragment with Webview
Hidden WebView in activity
JS engine like Mozilla Rhino
Reusable
HTML and
JS inside
WebViews
Reusing HTML & JS for mobile web app
Native
Web
27
Page Object pattern based hybrid apps
Logic UI
Platform SpecificReusabl
e
90%
Reusable
28
Page Object pattern based hybrid apps
Logic UI
NativeWeb
Logic UI
29
Benefits
30
Experience
+
Reusability
31
Channel
Relevance
Native App Mobile Web
Social
features
User
engagement
Tactical
queries
COR
E
32
Presence
vs
Engagement
Native
Native
Native
Web
Web
Web
33
Mature
tools &
practices Android
development
studio
Chrome
Developer
Tools
Selenium
web driver
Tool
s
Xcode
Calabash
Cucumber
JasmineHAML, SASS,
Coffeescript
34
Calatrava
• Completely open source
• Has been used to build apps with 1 million to
5 million downloads in Android app store.
(For iOS, Android and mobile web)
• Beta stage
• Can leverage existing mature bridge from
external platforms
35
Thank you
&
Feed-me-back
priyaaank @
twitter
github
gmail
tumblr

More Related Content

PDF
Beego meetup 4.4.2017 @ Gett
PPTX
Building Framework Agnostic UI with Web Components
PDF
Rich Internet Web Application Development using Google Web Toolkit
PPTX
React intro
PDF
Delegating user tasks in applications
PDF
Feature Development with jQuery
PDF
Android Jetpack
PPTX
Introduction to react js and reasons to go with react js in 2020
Beego meetup 4.4.2017 @ Gett
Building Framework Agnostic UI with Web Components
Rich Internet Web Application Development using Google Web Toolkit
React intro
Delegating user tasks in applications
Feature Development with jQuery
Android Jetpack
Introduction to react js and reasons to go with react js in 2020

Viewers also liked (20)

PPSX
Apresentação da Resenha do Livro " Foco - uma questão de vida ou morte para s...
PPTX
DOCX
Waqas Resume Updated
PDF
Guia praga 2013
DOCX
21 02-12 2è
PPTX
ARS AUTOMAT 1
PPT
Presentation2
PPT
Landschapsfotografie
PPTX
Rezoning of University Heights
PDF
Projeto campanha responsável módulo gestão e mercado –2016
PPTX
David stern’s legacy
ODP
Power Mont
PPTX
Taller de psicología de los desastres
DOCX
Transcripció final paco nadal
PDF
InfoLinux 09 2009
PPTX
Interes simple
PDF
Company profile CV Pandawa GP (Rev1.0)
PPT
Logística no Varejo 'Brasil Cacau'
PPSX
Adm da produção cacau show
Apresentação da Resenha do Livro " Foco - uma questão de vida ou morte para s...
Waqas Resume Updated
Guia praga 2013
21 02-12 2è
ARS AUTOMAT 1
Presentation2
Landschapsfotografie
Rezoning of University Heights
Projeto campanha responsável módulo gestão e mercado –2016
David stern’s legacy
Power Mont
Taller de psicología de los desastres
Transcripció final paco nadal
InfoLinux 09 2009
Interes simple
Company profile CV Pandawa GP (Rev1.0)
Logística no Varejo 'Brasil Cacau'
Adm da produção cacau show
Ad

Similar to Pragmatic approach to build native apps - hybrid way (20)

PDF
Mobile development-e mag-version3
PPTX
Native - Hybrid - Web Mobile Architectures
PDF
[2015/2016] Mobile thinking
PDF
Pablo Villalba -
PDF
Your choices for building a mobile app in 2016
PDF
Evolving Mobile Architectures
KEY
Mobile ECM with JavaScript - JSE 2011
PPTX
Cross platform mobile app
PPTX
Мобильная разработка. Между Сциллой и Харибдой. Native, hybrid or cross platf...
PDF
Olivier meetup-boston-2013-jan-21-v2
PPTX
10 Useful Frameworks to Build Hybrid Mobile Apps
PDF
Web-based Hybrid Mobile Apps: State of the Practice and Research opportunitie...
PDF
What is hybrid mobile app development? | Nitor Infotech
PPTX
Rise of the hybrids
PPTX
Mobile web development
PPT
Hybrid app development
PPTX
Trip advsiorhybridpresentation
PDF
IRJET- Cross-Platform Supported E-Learning Mobile Application
PPTX
Hybrid App Development Frameworks for 2025 A Complete Guide.pptx
PPTX
Introduction to Hybrid Application Development
Mobile development-e mag-version3
Native - Hybrid - Web Mobile Architectures
[2015/2016] Mobile thinking
Pablo Villalba -
Your choices for building a mobile app in 2016
Evolving Mobile Architectures
Mobile ECM with JavaScript - JSE 2011
Cross platform mobile app
Мобильная разработка. Между Сциллой и Харибдой. Native, hybrid or cross platf...
Olivier meetup-boston-2013-jan-21-v2
10 Useful Frameworks to Build Hybrid Mobile Apps
Web-based Hybrid Mobile Apps: State of the Practice and Research opportunitie...
What is hybrid mobile app development? | Nitor Infotech
Rise of the hybrids
Mobile web development
Hybrid app development
Trip advsiorhybridpresentation
IRJET- Cross-Platform Supported E-Learning Mobile Application
Hybrid App Development Frameworks for 2025 A Complete Guide.pptx
Introduction to Hybrid Application Development
Ad

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PDF
cuic standard and advanced reporting.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Cloud computing and distributed systems.
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Spectroscopy.pptx food analysis technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Electronic commerce courselecture one. Pdf
KodekX | Application Modernization Development
cuic standard and advanced reporting.pdf
The AUB Centre for AI in Media Proposal.docx
Unlocking AI with Model Context Protocol (MCP)
NewMind AI Weekly Chronicles - August'25 Week I
“AI and Expert System Decision Support & Business Intelligence Systems”
Dropbox Q2 2025 Financial Results & Investor Presentation
Mobile App Security Testing_ A Comprehensive Guide.pdf
Review of recent advances in non-invasive hemoglobin estimation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Cloud computing and distributed systems.
MIND Revenue Release Quarter 2 2025 Press Release
Spectroscopy.pptx food analysis technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Machine learning based COVID-19 study performance prediction
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Understanding_Digital_Forensics_Presentation.pptx
Electronic commerce courselecture one. Pdf

Pragmatic approach to build native apps - hybrid way