SlideShare a Scribd company logo
1 of 64
Spencer Chan – Quora
Architecting Cross-Platform
Mobile Frameworks
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
https://www.infoq.com/presentations/
quora-cross-platform
Presented at QCon New York
www.qconnewyork.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Motivation
● Two extremes
○ Fully native
○ Fully HTML+JS
● How can we get the best of both worlds?
Motivation
● Two extremes:
○ Fully native
○ Fully HTML+JS
● How can we get the best of both worlds?
● For the last 3 years, Quora has used a custom hybrid
framework
○ We're very happy with it
Agenda
1. How Quora's app works
2. Design Decisions
3. Learnings from the past 3 years
Takeaways
● What can you expect if you follow the same path we did?
● Is this approach worth exploring for your apps?
● What should you look for in a publicly available
framework?
○ Are you better off building your own?
How it Works
This is a question page
This is a question page
Webviews
outlined
in red
● The webview loads a url
● The page is rendered by a tree of
component objects
● This component is used across all platforms
Meanwhile on the Server
After page load
After scrolling to the end of the answer
Pressing the button
HTML +
CSS
Pressing the button
HTML +
CSS +
JS
Pressing the button
No native code involved at all!
HTML +
CSS +
JS
Now for a different example...
Here's a user profile page
Tapping here is going to show a menu ...
Native menu
Native menu
Message Passing
Message Passing
● Implemented differently for each platform
● Asynchronous message passing is more future proof
● Minimal, but can build on top of this
Message Passing
Abstraction is your friend
iOS
Obj-C/Swift
Android
Java
Application
JavaScript
Abstraction is your friend
iOS
Obj-C/Swift
Android
Java
Web
Framework
JavaScript
Application
JavaScript
● Abstracting away platform specific code simplifies the remaining
application code
● Also useful for cross-browser compatibility
○ This is one of the main benefits of things like jQuery
Abstraction is your friend
Design Decisions
Design Decisions
1. HTML Content
2. Native Navigation
3. No Page Types
HTML Content
Webviews
outlined
in red
HTML Content
No native code involved at all!
HTML +
CSS +
JS
HTML Content
● Alternative: native views powered by shared application code
● HTML views increase potential code sharing with websites, if you
have one
○ Client side vs. Server side rendering
● HTML is great for text-heavy products like Quora
Design Decisions
1. HTML Content
2. Native Navigation
3. No Page Types
Native Navigation
● Each navigation creates a new webview and adds it to the
native navigation stack.
● Pros
○ Native gestures
○ Native animations
● Cons
○ Makes prefetching harder
○ More native code, less code sharing
Native Navigation
Native Navigation
Native Navigation
Design Decisions
1. HTML Content
2. Native Navigation
3. No Page Types
Native UI Examples: How do we implement this?
Solution 1: Page Types
● "This is the notifications page"
○ Native code knows it should have certain buttons and styling
Solution 2: No Page Types
● "Native UI should have these buttons and this styling"
○ Native code doesn't need to know about notifications
● This makes it easier to maintain a strong abstraction barrier
● Useful if you expect to add or modify page types often
Avoid Message Thrash
● Backwards compatibility is painful
● Easier to do without page types, but still a concern
● Avoid UI thrash!
Design Decisions
1. HTML Content
2. Native Navigation
3. No Page Types
Learnings
1. Be prepared to deal with webview quirks
2. Demystify loading slowness
3. Code sharing goes deeper than views
4. JavaScript lets everyone contribute
Learnings
● Problem:
○ Spike in crash reports saying app ran out of memory
● Solution:
○ It was a new image loader we were trying out
○ Don't load images in JS on that webview implementation
Webview Issues
Webview Issues
Our webviews have an animated
loading screen (the 3 dots in the
middle are animated)
● Problem:
○ We want to fade out the loading screen as soon as any content is
visible in the webview
○ But we can't tell from native code when webview has started
displaying content
● Solution:
○ Poll the webview pixel to see when they start changing
Webview Issues
1. Be prepared to deal with webview quirks
2. Demystify loading slowness
3. Code sharing goes deeper than views
4. JavaScript lets everyone contribute
Learnings
● Bandwidth
○ HTML is bigger than JSON
● Multiple roundtrips
○ Blocking on CSS/JS
○ Web performance could be the subject of a whole separate talk
Real issues caused by webviews
● Latency
○ Loading images from a server on the other side of the
world will be slower than loading them from a CDN
● Slow application code
○ Example: not paginating data
○ Again, this could be a whole separate talk
Issues unrelated to webviews
Find the real root causes of your performance problems
Be scientific and rigorous
● Our app will have performance in the same ballpark as our
mobile website
● We have a mobile website and care about its performance
● All of our speed efforts are going towards the same thing
At least there's only one thing to optimize
1. Be prepared to deal with webview quirks
2. Demystify loading slowness
3. Code sharing goes deeper than views
4. JavaScript lets everyone contribute
Learnings
● At Quora, the same boxes handle all platforms
○ No API tier
Shared infrastructure
Shared deployment tools
We share the same continuous deployment system we use on web
● If there are 100 buttons and 3 platforms, do you need 300 tests?
● Or just 102
Shared UI integration tests
1. Be prepared to deal with webview quirks
2. Demystify loading slowness
3. Code sharing goes deeper than views
4. JavaScript lets everyone contribute
Learnings
Javascript lets everyone contribute
● Easy ramp-up
● Designers code
● Few projects get blocked on native development
Javascript lets everyone contribute
1. Be prepared to deal with webview quirks
2. Demystify loading slowness
3. Code sharing goes deeper than views
4. JavaScript lets everyone contribute
Learnings
Conclusion
● There are pros and cons to any architecture
● This one has worked very well for us over the last 3 years
● If you haven't tried hybrid app development, maybe it's worth
considering or exploring
○ either by building your own framework, or using a publically
available one
Questions?
Watch the video with slide
synchronization on InfoQ.com!
https://www.infoq.com/presentations/
quora-cross-platform

More Related Content

Viewers also liked

กุหลาบสวย
กุหลาบสวยกุหลาบสวย
กุหลาบสวยmai12
 
Google analytics: aspectos básicos y herramientas
Google analytics: aspectos básicos y herramientasGoogle analytics: aspectos básicos y herramientas
Google analytics: aspectos básicos y herramientasNovix
 
Universidad nacional experimenta d iapositivas sistema l
Universidad nacional experimenta d iapositivas sistema lUniversidad nacional experimenta d iapositivas sistema l
Universidad nacional experimenta d iapositivas sistema ljosephber291
 
包季真 字体、排版简明入门
包季真 字体、排版简明入门包季真 字体、排版简明入门
包季真 字体、排版简明入门Jason Bao
 
President Obama's Deficit Plan
President Obama's Deficit PlanPresident Obama's Deficit Plan
President Obama's Deficit PlanObama White House
 
Better products faster: let's bring the user into the userstory // TAPOST_201...
Better products faster: let's bring the user into the userstory // TAPOST_201...Better products faster: let's bring the user into the userstory // TAPOST_201...
Better products faster: let's bring the user into the userstory // TAPOST_201...Anna Witteman
 
BOORSTEIN.tue_.4pm.Final_
BOORSTEIN.tue_.4pm.Final_BOORSTEIN.tue_.4pm.Final_
BOORSTEIN.tue_.4pm.Final_Hidee Cyd
 
How effective is the combination of my media
How effective is the combination of my mediaHow effective is the combination of my media
How effective is the combination of my mediaxxtor
 
Co-Design: Quantified User Experience
Co-Design: Quantified User Experience Co-Design: Quantified User Experience
Co-Design: Quantified User Experience Marquis Cabrera
 
Cuestionario de encuesta
Cuestionario de encuestaCuestionario de encuesta
Cuestionario de encuestadenisse pinto
 

Viewers also liked (12)

กุหลาบสวย
กุหลาบสวยกุหลาบสวย
กุหลาบสวย
 
Google analytics: aspectos básicos y herramientas
Google analytics: aspectos básicos y herramientasGoogle analytics: aspectos básicos y herramientas
Google analytics: aspectos básicos y herramientas
 
Twitter for Dentists
Twitter for DentistsTwitter for Dentists
Twitter for Dentists
 
Universidad nacional experimenta d iapositivas sistema l
Universidad nacional experimenta d iapositivas sistema lUniversidad nacional experimenta d iapositivas sistema l
Universidad nacional experimenta d iapositivas sistema l
 
包季真 字体、排版简明入门
包季真 字体、排版简明入门包季真 字体、排版简明入门
包季真 字体、排版简明入门
 
President Obama's Deficit Plan
President Obama's Deficit PlanPresident Obama's Deficit Plan
President Obama's Deficit Plan
 
Better products faster: let's bring the user into the userstory // TAPOST_201...
Better products faster: let's bring the user into the userstory // TAPOST_201...Better products faster: let's bring the user into the userstory // TAPOST_201...
Better products faster: let's bring the user into the userstory // TAPOST_201...
 
BOORSTEIN.tue_.4pm.Final_
BOORSTEIN.tue_.4pm.Final_BOORSTEIN.tue_.4pm.Final_
BOORSTEIN.tue_.4pm.Final_
 
How effective is the combination of my media
How effective is the combination of my mediaHow effective is the combination of my media
How effective is the combination of my media
 
Co-Design: Quantified User Experience
Co-Design: Quantified User Experience Co-Design: Quantified User Experience
Co-Design: Quantified User Experience
 
Cuestionario de encuesta
Cuestionario de encuestaCuestionario de encuesta
Cuestionario de encuesta
 
The potential future of reference bosley 2016
The potential future of reference bosley 2016The potential future of reference bosley 2016
The potential future of reference bosley 2016
 

More from C4Media

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoC4Media
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileC4Media
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020C4Media
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No KeeperC4Media
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like OwnersC4Media
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaC4Media
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideC4Media
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDC4Media
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine LearningC4Media
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at SpeedC4Media
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsC4Media
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsC4Media
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerC4Media
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleC4Media
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeC4Media
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereC4Media
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing ForC4Media
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data EngineeringC4Media
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreC4Media
 

More from C4Media (20)

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No Keeper
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like Owners
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 

Recently uploaded

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Recently uploaded (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Architecting Cross-platform Mobile Frameworks

  • 1. Spencer Chan – Quora Architecting Cross-Platform Mobile Frameworks
  • 2. InfoQ.com: News & Community Site • 750,000 unique visitors/month • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • News 15-20 / week • Articles 3-4 / week • Presentations (videos) 12-15 / week • Interviews 2-3 / week • Books 1 / month Watch the video with slide synchronization on InfoQ.com! https://www.infoq.com/presentations/ quora-cross-platform
  • 3. Presented at QCon New York www.qconnewyork.com Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide
  • 4. Motivation ● Two extremes ○ Fully native ○ Fully HTML+JS ● How can we get the best of both worlds?
  • 5. Motivation ● Two extremes: ○ Fully native ○ Fully HTML+JS ● How can we get the best of both worlds? ● For the last 3 years, Quora has used a custom hybrid framework ○ We're very happy with it
  • 6. Agenda 1. How Quora's app works 2. Design Decisions 3. Learnings from the past 3 years
  • 7. Takeaways ● What can you expect if you follow the same path we did? ● Is this approach worth exploring for your apps? ● What should you look for in a publicly available framework? ○ Are you better off building your own?
  • 9. This is a question page
  • 10. This is a question page Webviews outlined in red
  • 11. ● The webview loads a url ● The page is rendered by a tree of component objects ● This component is used across all platforms Meanwhile on the Server
  • 13. After scrolling to the end of the answer
  • 16. Pressing the button No native code involved at all! HTML + CSS + JS
  • 17. Now for a different example...
  • 18. Here's a user profile page
  • 19. Tapping here is going to show a menu ...
  • 24. ● Implemented differently for each platform ● Asynchronous message passing is more future proof ● Minimal, but can build on top of this Message Passing
  • 25. Abstraction is your friend iOS Obj-C/Swift Android Java Application JavaScript
  • 26. Abstraction is your friend iOS Obj-C/Swift Android Java Web Framework JavaScript Application JavaScript
  • 27. ● Abstracting away platform specific code simplifies the remaining application code ● Also useful for cross-browser compatibility ○ This is one of the main benefits of things like jQuery Abstraction is your friend
  • 29. Design Decisions 1. HTML Content 2. Native Navigation 3. No Page Types
  • 31. HTML Content No native code involved at all! HTML + CSS + JS
  • 32. HTML Content ● Alternative: native views powered by shared application code ● HTML views increase potential code sharing with websites, if you have one ○ Client side vs. Server side rendering ● HTML is great for text-heavy products like Quora
  • 33. Design Decisions 1. HTML Content 2. Native Navigation 3. No Page Types
  • 34. Native Navigation ● Each navigation creates a new webview and adds it to the native navigation stack. ● Pros ○ Native gestures ○ Native animations ● Cons ○ Makes prefetching harder ○ More native code, less code sharing
  • 38. Design Decisions 1. HTML Content 2. Native Navigation 3. No Page Types
  • 39. Native UI Examples: How do we implement this?
  • 40. Solution 1: Page Types ● "This is the notifications page" ○ Native code knows it should have certain buttons and styling
  • 41. Solution 2: No Page Types ● "Native UI should have these buttons and this styling" ○ Native code doesn't need to know about notifications ● This makes it easier to maintain a strong abstraction barrier ● Useful if you expect to add or modify page types often
  • 42. Avoid Message Thrash ● Backwards compatibility is painful ● Easier to do without page types, but still a concern ● Avoid UI thrash!
  • 43. Design Decisions 1. HTML Content 2. Native Navigation 3. No Page Types
  • 45. 1. Be prepared to deal with webview quirks 2. Demystify loading slowness 3. Code sharing goes deeper than views 4. JavaScript lets everyone contribute Learnings
  • 46. ● Problem: ○ Spike in crash reports saying app ran out of memory ● Solution: ○ It was a new image loader we were trying out ○ Don't load images in JS on that webview implementation Webview Issues
  • 47. Webview Issues Our webviews have an animated loading screen (the 3 dots in the middle are animated)
  • 48. ● Problem: ○ We want to fade out the loading screen as soon as any content is visible in the webview ○ But we can't tell from native code when webview has started displaying content ● Solution: ○ Poll the webview pixel to see when they start changing Webview Issues
  • 49. 1. Be prepared to deal with webview quirks 2. Demystify loading slowness 3. Code sharing goes deeper than views 4. JavaScript lets everyone contribute Learnings
  • 50. ● Bandwidth ○ HTML is bigger than JSON ● Multiple roundtrips ○ Blocking on CSS/JS ○ Web performance could be the subject of a whole separate talk Real issues caused by webviews
  • 51. ● Latency ○ Loading images from a server on the other side of the world will be slower than loading them from a CDN ● Slow application code ○ Example: not paginating data ○ Again, this could be a whole separate talk Issues unrelated to webviews
  • 52. Find the real root causes of your performance problems Be scientific and rigorous
  • 53. ● Our app will have performance in the same ballpark as our mobile website ● We have a mobile website and care about its performance ● All of our speed efforts are going towards the same thing At least there's only one thing to optimize
  • 54. 1. Be prepared to deal with webview quirks 2. Demystify loading slowness 3. Code sharing goes deeper than views 4. JavaScript lets everyone contribute Learnings
  • 55. ● At Quora, the same boxes handle all platforms ○ No API tier Shared infrastructure
  • 56. Shared deployment tools We share the same continuous deployment system we use on web
  • 57. ● If there are 100 buttons and 3 platforms, do you need 300 tests? ● Or just 102 Shared UI integration tests
  • 58. 1. Be prepared to deal with webview quirks 2. Demystify loading slowness 3. Code sharing goes deeper than views 4. JavaScript lets everyone contribute Learnings
  • 60. ● Easy ramp-up ● Designers code ● Few projects get blocked on native development Javascript lets everyone contribute
  • 61. 1. Be prepared to deal with webview quirks 2. Demystify loading slowness 3. Code sharing goes deeper than views 4. JavaScript lets everyone contribute Learnings
  • 62. Conclusion ● There are pros and cons to any architecture ● This one has worked very well for us over the last 3 years ● If you haven't tried hybrid app development, maybe it's worth considering or exploring ○ either by building your own framework, or using a publically available one
  • 64. Watch the video with slide synchronization on InfoQ.com! https://www.infoq.com/presentations/ quora-cross-platform