SlideShare a Scribd company logo
WHAT DEVOPS NEED TO
KNOW ABOUT MOBILE
…or really everyone…
Jon Arne Sæterås
twitter: @jonarnes
MOBILE MAJORITY
0
20
40
60
80
100
2009-01 2010-01 2011-01 2012-01 2013-01 2014-01 2015-01 2016-01 2017-01
Desktop Mobile Tablet Console
statcounter.com
Oct. 2016
80% MOBILE
In India, and most of Asia, mobile is the main concern
0
25
50
75
100
2009-01 2010-01 2011-01 2012-01 2013-01 2014-01 2015-01 2016-01 2017-01
Desktop Mobile Tablet Console
statcounter.com
Aug. 2012
RUSSIA
?
Browsers Web sites
http
Native apps
Browsers
Hybrid apps
Web sites
APIs
Services
http
Logs
Analytics
Reporting
Debug
? ?
What Devops Need to Know about Mobile
What Devops Need to Know about Mobile
What Devops Need to Know about Mobile
KNOW WHO
YOU’RE
COMMUNICATING
WITH
Who sent the message?
#devops
Inside Out (2015)
USER-AGENT
User Agent:“A software acting on behalf of a user”
h"ps://tools.ie-.org/html/rfc7231#sec8on-5.5.3
Native apps
Browsers
Hybrid apps
Web sites
APIs
Services
Host:www.example.com	
User-Agent:	...
Logs
Analytics
Reporting
Debug
MEANINGFUL USER-AGENTS
The "User-Agent" header field contains information about the user
agent originating the request, which is often used by servers to help
identify the scope of reported interoperability problems, to work
around or tailor responses to avoid particular user agent
limitations, and for analytics regarding browser or operating system
use.
The User-Agent field-value consists of one or more product
identifiers, each followed by zero or more comments (Section 3.2 of

[RFC7230]), which together identify the user agent software and its
significant subproducts. By convention, the product identifiers are
listed in decreasing order of their significance for identifying the
user agent software. Each product identifier consists of a name and
optional version.
#devops

#BFF
Format:
User-Agent = product *( RWS ( product / comment ) )
MostSignificant/1.0	Significant/1.1	LessSignificant
significancehigh low
Name of the “thing” “Thing” version White space
IN THE BEGINNING…
NCSA_Mosaic/2.0
Mozilla/1.22	(compatible;	MSIE	2.0;	Windows	95)
History of the browser user-agent string: 

https://webaim.org/blog/user-agent-string-history/
Mozilla/1.0	(Win3.1)
supported frames!
…AND NOW…
Mozilla/5.0	(Mobile;	Windows	Phone	8.1;	Android	4.0;	ARM;	Trident/7.0;	Touch;	
rv:11.0;	IEMobile/11.0;	NOKIA;	Lumia	630)	like	iPhone	OS	7_0_3	Mac	OS	X	
AppleWebKit/537	(KHTML,	like	Gecko)	Mobile	Safari/537
if(preg_match(‘/^Mozilla/‘,	$userAgent)){	
//frameset	support!!	:D	
} WTF…
#mess…
OK, IT’S A MESS
…but what can we do with our apps?
THREE KINDS OF APPS
• (Progressive) Web Apps
• Hybrid Apps
• Native Apps
…for simplicity
Run in the browser.
We’re good.
An app, but loads web
content/pages
Native code using APIs
to communicate
ANDROID WEBVIEW
<Stock	User-Agent>	WebViewApp	<AppName>/<Version>
Mozilla/5.0	(Linux;	Android	5.1.1;	Nexus	5	Build/LMY48B;	wv)	AppleWebKit/537.36	(KHTML,	
like	Gecko)	Version/4.0	Chrome/43.0.2357.65	Mobile	Safari/537.36	WebViewApp	MyApp/1	
		
Hybrid Apps
Mozilla/5.0	(Linux;	Android	5.1.1;	Nexus	5	Build/LMY48B;	wv)	AppleWebKit/537.36	(KHTML,	
like	Gecko)	Version/4.0	Chrome/43.0.2357.65	Mobile	Safari/537.36
More here: https://www.scientiamobile.com/page/correctly-form-user-agents-for-hybrid-apps/
ANDROID WEBVIEW
String	ua	=	new	WebView(this).getSettings().getUserAgentString();		
webviewToUse.getSettings().setUserAgentString(ua	+	“	WebViewApp	MyApp/1”);
Hybrid Apps
More here: https://www.scientiamobile.com/page/correctly-form-user-agents-for-hybrid-apps/
IOS WEBVIEW
Mozilla/5.0	(iPhone;	CPU	iPhone	OS	11_1	like	Mac	OS	X)	AppleWebKit/604.3.5	(KHTML,	like	
Gecko)	Mobile/15B93	WebViewApp	MyApp/1	iPhone4,1
Hybrid Apps
Mozilla/5.0	(iPhone;	CPU	iPhone	OS	11_1	like	Mac	OS	X)	AppleWebKit/604.3.5	(KHTML,	like	
Gecko)	Mobile/15B93
<Stock	User-Agent>	WebViewApp	<AppName>/<Version>	<iOS	HW	ID>
Code at https://github.com/WURFL/User-Agent-Native-apps
More here: https://www.scientiamobile.com/page/correctly-form-user-agents-for-hybrid-apps/
IOS WEBVIEW
UIWebView*	webView	=	[[UIWebView	alloc]	initWithFrame:CGRectZero];	
NSString*	ua	=	[webView	stringByEvaluatingJavaScriptFromString:@“navigator.userAgent"];	
Then modify the extracted User-Agent via the AppDelegate file:
NSDictionary	*dictionary	=	[NSDictionary	dictionaryWithObjectsAndKeys:	ua	+	@"	WebViewApp	Foo/1	“	+	[self	deviceName],	
@"UserAgent",	nil];	
[[NSUserDefaults	standardUserDefaults]	registerDefaults:dictionary];	
Swift
let	userAgent	=	UIWebView().stringByEvaluatingJavaScript(from:	"navigator.userAgent")!	+	"WebViewApp	Foo/1	“	+	getName();	
UserDefaults.standard.register(defaults:	["UserAgent"	:	userAgent])
Hybrid Apps
Swift:
Objective C:
Code at https://github.com/WURFL/User-Agent-Native-apps
More here: https://www.scientiamobile.com/page/correctly-form-user-agents-for-hybrid-apps/
ANDROID
<AppName>/<version>	<Default	User-Agent>
Myapp/1	Dalvik/2.1.0	(Linux;	U;	Android	6.0.1;	vivo	1610	Build/MMB29M)
Code here: https://github.com/WURFL/ImageEngine-DemoApp
Native Apps
Dalvik/2.1.0	(Linux;	U;	Android	6.0.1;	vivo	1610	Build/MMB29M)
More here: https://www.scientiamobile.com/page/correctly-form-user-agent-strings-in-mobile-apps/
ANDROID
URLConnection	cn	=	new	URL("http://....").openConnection();	
cn.setRequestProperty("User-agent",	“Myapp/1	”	+	System.getProperty("http.agent"));	
cn.connect();
Code at https://github.com/WURFL/ImageEngine-DemoApp
Native Apps
More here: https://www.scientiamobile.com/page/correctly-form-user-agent-strings-in-mobile-apps/
IOS
MyApp/1	CFNetwork/808.3	Darwin/16.3.0
<AppName/<version>	<iDevice	platform><Apple	model	identifier>	
	iOS/<OS	version>	CFNetwork/<version>	Darwin/<version>
MyApp/1	iPhone5,2	iOS/10_1	CFNetwork/808.3	Darwin/16.3.0
Native Apps
More here: https://www.scientiamobile.com/page/correctly-form-user-agent-strings-in-mobile-apps/
IOS
Code at: https://github.com/WURFL/User-Agent-Native-apps
NSString*	userAgent	=	getUAString();	
NSURL*	url	=	[NSURL	URLWithString:@""];	
NSMutableURLRequest*	request	=	[[NSMutableURLRequest	alloc]	initWithURL:url];	
[request	setValue:userAgent	forHTTPHeaderField:@"User-Agent"];
let	userAgent	=	UAString()	
if	let	url	=	NSURL(string:	"")	{	
	let	request	=	NSMutableURLRequest(url:	url	as	URL)	
	request.setValue(userAgent,	forHTTPHeaderField:	"User-Agent")	
	//...	
}
Native Apps
Swift:
Objective C:
More here: https://www.scientiamobile.com/page/correctly-form-user-agent-strings-in-mobile-apps/
PITFALLS
• Fingerprinting/privacy
• Truncation
• Pretending to be something you’re not
• Don’t ever trust regular expressions to parse a
User-Agent
NOW THAT WE HAVE THE
USER-AGENT…
how to use it?
RUSSIA
Form factors
Q3 2017
4 %
40 %
56 %
Desktop Smartphone
Tablet Feature Phone
Smart-TV
Source: MOVR by ScientiaMobile
RUSSIA
Popular Devices
Q3 2017
Samsung Galaxy J5 (2016)
Samsung Galaxy J5
Samsung Galaxy J3 Duos
Apple iPhone 6S
Apple iPhone 6
Samsung Galaxy J7 (2016)
Samsung Galaxy Grand Prime
Apple iPhone 7
Apple iPhone 5S
HuaweiY5II
0 0,013 0,025 0,038 0,05
1,95 %
2,05 %
2,16 %
2,17 %
2,39 %
2,61 %
2,84 %
2,84 %
3,59 %
4,15 %Samsung Galaxy J5 (2016)
Samsung Galaxy J5
Samsung Galaxy J3 Duos
Apple iPhone 6S
Apple iPhone 6
Samsung Galaxy J7 (2016)
Samsung Galaxy Grand Prime
Apple iPhone 7
Apple iPhone 5S
HuaweiY5II
Other
0 0,2 0,4 0,6 0,8
73,25 %
1,95 %
2,05 %
2,16 %
2,17 %
2,39 %
2,61 %
2,84 %
2,84 %
3,59 %
4,15 %
Source: MOVR by ScientiaMobile
RUSSIA
Top manufacturers
Q3 2017
2 %
2 %
3 %
4 %
4 %
6 %
7 %
15 %
15 %
41 %
Samsung Huawei Apple
LG Lenovo Sony
Alcatel Nokia HTC
Microsoft
Source: MOVR by ScientiaMobile
RUSSIA
Popular Apps Q3 2017
6 %
9 %
9 %
12 %
13 %
50 %
Facebook Flipboard Google Search
UCBrowser Opera browser Instagram
Pinterest Twitter Facebook Messenger
Source: MOVR by ScientiaMobile
CHIPSETS
Huuuge difference in
performance
Other; 2,8%
Exynos
5410; 2,4%
Exynos
7420; 19,5%
Exynos 7420
Octa; 9,5%
Exynos 7580
Octa; 2,1%
Exynos
8890; 37,9%
Exynos
8895; 1,5%
Snapdragon
400; 3,4%
Snapdragon
801; 17,0%
Snapdragon
820; 1,1%
Snapdragon
835; 2,8%
SamsungChipsets
Apple A10
Fusion; 25,8%
Apple A4;0,2%
Apple A5;0,4%
Apple A6; 4,4%
Apple A7;8,4%
Apple A8;24,6%
Apple A9; 36,1%
Apple Chipsets
https://www.scientiamobile.com/page/most-used-chipsets
See device capabilities in Splunk
WHAT ELSE…
OK, we got some stats,
but is there more?
THE WEB
• 55% of the web is images
1 %
2 %
3 %
3 %
14 %
24 %
55 %
images video scripts
css fonts html
other
SCREEN
RESOLUTIONS
“Other” is the biggest!
22 %
1 %1 %
1 %
1 % 2 % 2 %
2 % 2 % 2 %
2 %
3 %
3 %
3 %
3 %
3 %
4 %
5 %
7 %
13 %
19 %
360x640
1366x768
1920x1080
375x667
720x1280
768x1024
320x568
1440x900
1280x800
1600x900
1024x768
320x534
1280x1024
480x800
414x736
320x570
540x960
1536x864
1080x1920
1280x720
Other
IMAGE CDN
optimize
detect
distribute
User-Agent
Native apps
Browsers
Hybrid apps
origin cache
detect
Screen size
Resolution
Formats
Network
etc.
Cache key
0 Mbps
35 000 000 Mbps
70 000 000 Mbps
105 000 000 Mbps
140 000 000 Mbps
Time
Actual Bandwidth Usage For Optimized Objects Original Bandwidth Usage For Non-Optimized Objects
IS IT WORKING?
IS IT WORKING?
• 75%-ish less data
transmitted
• No visual quality loss
• >50% of images converted
to different formats
• In apps, most images resized
• Faster loading UI
traffic
Original Optimized
MEANINGFUL USER-AGENTS
• Would have been too romantic sticking with the
standard





• The real world is a mess with historical “mistakes”
that stick with us.
MostSignificant/1.0	Significant/1.1	LessSignificant
significancehigh low
Name of the “thing” “Thing” version White space
MEANINGFUL USER-AGENTS
• Rule of thumb:
• Native apps: Prepend app name/version
• Hybrid apps: Append app name/version
• Special rule for iOS
• Include hardware info
MEANINGFUL USER-AGENTS
Default Recommended
iOS MyApp/1	CFNetwork/808.3	Darwin/16.3.0 MyApp/1	iPhone5,2	iOS/10_1	CFNetwork/808.3	Darwin/16.3.0
Android
Dalvik/2.1.0	(Linux;	U;	Android	6.0.1;	
vivo	1610	Build/MMB29M)
Myapp/1	Dalvik/2.1.0	(Linux;	U;	Android	6.0.1;	vivo	1610	
Build/MMB29M)
Default Recommended
iOS
Mozilla/5.0	(iPhone;	CPU	iPhone	OS	11_1	
like	Mac	OS	X)	AppleWebKit/604.3.5	
(KHTML,	like	Gecko)	Mobile/15B93
Mozilla/5.0	(iPhone;	CPU	iPhone	OS	11_1	like	Mac	OS	X)	
AppleWebKit/604.3.5	(KHTML,	like	Gecko)	Mobile/15B93	
WebViewApp	MyApp/1	iPhone4,1
Android
Mozilla/5.0	(Linux;	Android	5.1.1;	Nexus	
5	Build/LMY48B;	wv)	AppleWebKit/537.36	
(KHTML,	like	Gecko)	Version/4.0	Chrome/
43.0.2357.65	Mobile	Safari/537.36
Mozilla/5.0	(Linux;	Android	5.1.1;	Nexus	5	Build/LMY48B)	
AppleWebKit/537.36	(KHTML,	like	Gecko)	Version/4.0	
Chrome/43.0.2357.65	Mobile	Safari/537.36	WebViewApp	
MyApp/1	
Native apps
Hybrid apps
BENEFITS OF MEANINGFUL
USER-AGENTS
• “Know who you’re communicating with”
• Easier debug
• Richer statistics
• Better monitoring
• Safely apply Device Detection (WURFL)
–The pretty girl
“I know where you live.”

More Related Content

PDF
iOS Ecosystem @ Fiera del Radioamatore Pordenone
PPTX
Smart phones
PDF
打造你的第一個iPhone APP
PDF
State of Mobile Benchmark Report - MWC 2015 Edition
PDF
HIJACKING ATTACKS ON ANDROID DEVICES
PDF
Tablets: is aviation ready for the post-pc era - Singapore 2011
PPTX
Android vs iOS
PDF
Advanced Tablet Workshop
iOS Ecosystem @ Fiera del Radioamatore Pordenone
Smart phones
打造你的第一個iPhone APP
State of Mobile Benchmark Report - MWC 2015 Edition
HIJACKING ATTACKS ON ANDROID DEVICES
Tablets: is aviation ready for the post-pc era - Singapore 2011
Android vs iOS
Advanced Tablet Workshop

What's hot (20)

PPTX
Android vs ios System Architecture in OS perspective
PPTX
Iphone vs android
PDF
You're doing it all wrong
PDF
Android vs. IOS: Comparing features & functions
PPTX
Android operating system + NFC
PPTX
Android by manan gajwani
PPT
Jail breaking
PDF
Attacking and Defending Apple iOS Devices
PDF
The crazy world of aviation it
PPTX
Android vs iOS
PPTX
What is Android OS in ppt ?
PDF
UPDATED: Tablet Strategy Bootcamp
PPTX
Android ppt
PDF
如何變成iOS App開發魔法師
PPTX
Why go mobile
PDF
Introduction to android
KEY
Why the iPad UI matters, And how it differs from the Tablet PC, but also from...
PDF
Another Update of Tablet Strategy Bootcamp
PPTX
Ios operating system
PDF
Building a New Generation of Mobile Games with Speech
Android vs ios System Architecture in OS perspective
Iphone vs android
You're doing it all wrong
Android vs. IOS: Comparing features & functions
Android operating system + NFC
Android by manan gajwani
Jail breaking
Attacking and Defending Apple iOS Devices
The crazy world of aviation it
Android vs iOS
What is Android OS in ppt ?
UPDATED: Tablet Strategy Bootcamp
Android ppt
如何變成iOS App開發魔法師
Why go mobile
Introduction to android
Why the iPad UI matters, And how it differs from the Tablet PC, but also from...
Another Update of Tablet Strategy Bootcamp
Ios operating system
Building a New Generation of Mobile Games with Speech
Ad

Similar to What Devops Need to Know about Mobile (20)

PPTX
Seminar Android - Pengenalan PhoneGap
KEY
Developing for Mobility
KEY
Philly ete-2011
PPT
Mobile and tablet app dev
PPTX
Saminar ppt of
PDF
Html5 performance
PDF
HTML5 or Android for Mobile Development?
KEY
Jonathan snook - fake-it
PDF
Mobile Widgets Development
PDF
Inside Mobile Widgets Publish
PPT
Html5 investigation
PPTX
Android PPT Presentation 2018
PPTX
Future of Mobility
PPT
Best Practices in Mobile Development: Building Your First jQuery Mobile App
PPTX
Android technology by rp
PDF
Apps vs. Sites vs. Content - a vendor-agnostic view on building stuff for the...
PPTX
Presentation on Android operating system
PDF
Research on Comparative Study of Different Mobile Operating System_Part-1
PPTX
PPTX
HTML5: The Apps, the Frameworks, the Controversy
Seminar Android - Pengenalan PhoneGap
Developing for Mobility
Philly ete-2011
Mobile and tablet app dev
Saminar ppt of
Html5 performance
HTML5 or Android for Mobile Development?
Jonathan snook - fake-it
Mobile Widgets Development
Inside Mobile Widgets Publish
Html5 investigation
Android PPT Presentation 2018
Future of Mobility
Best Practices in Mobile Development: Building Your First jQuery Mobile App
Android technology by rp
Apps vs. Sites vs. Content - a vendor-agnostic view on building stuff for the...
Presentation on Android operating system
Research on Comparative Study of Different Mobile Operating System_Part-1
HTML5: The Apps, the Frameworks, the Controversy
Ad

More from Jon Arne Sæterås (11)

PDF
RWD myth busting @ Topconf
PDF
Enhancing GA with form factor data
PDF
Velocity EU: Give Responsive Design a Mobile Performance Boost
PDF
Makingweb: Great front end performance starts on the server.
PDF
Mobile is slow - Over the Air 2013
PDF
Front-End Performance Starts On the Server
PDF
Search on Mobile - Mobile Copenhagen 2012
PDF
Mobile Oslo 2012 okt
PDF
ModevTablet: Embrace Device Diversity
PDF
Digitale Medier 2011
PPTX
Mobile for web developers
RWD myth busting @ Topconf
Enhancing GA with form factor data
Velocity EU: Give Responsive Design a Mobile Performance Boost
Makingweb: Great front end performance starts on the server.
Mobile is slow - Over the Air 2013
Front-End Performance Starts On the Server
Search on Mobile - Mobile Copenhagen 2012
Mobile Oslo 2012 okt
ModevTablet: Embrace Device Diversity
Digitale Medier 2011
Mobile for web developers

Recently uploaded (20)

PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PPTX
newyork.pptxirantrafgshenepalchinachinane
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
artificialintelligenceai1-copy-210604123353.pptx
PDF
Exploring VPS Hosting Trends for SMBs in 2025
PPTX
international classification of diseases ICD-10 review PPT.pptx
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PPT
Ethics in Information System - Management Information System
PPTX
E -tech empowerment technologies PowerPoint
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPTX
Introduction to Information and Communication Technology
PDF
Paper PDF World Game (s) Great Redesign.pdf
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
Tenda Login Guide: Access Your Router in 5 Easy Steps
newyork.pptxirantrafgshenepalchinachinane
PptxGenJS_Demo_Chart_20250317130215833.pptx
artificialintelligenceai1-copy-210604123353.pptx
Exploring VPS Hosting Trends for SMBs in 2025
international classification of diseases ICD-10 review PPT.pptx
SASE Traffic Flow - ZTNA Connector-1.pdf
Introuction about ICD -10 and ICD-11 PPT.pptx
Introuction about WHO-FIC in ICD-10.pptx
Ethics in Information System - Management Information System
E -tech empowerment technologies PowerPoint
Job_Card_System_Styled_lorem_ipsum_.pptx
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
INTERNET------BASICS-------UPDATED PPT PRESENTATION
Introduction to Information and Communication Technology
Paper PDF World Game (s) Great Redesign.pdf
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
WebRTC in SignalWire - troubleshooting media negotiation
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
Module 1 - Cyber Law and Ethics 101.pptx

What Devops Need to Know about Mobile