android performance and monitoring - meetup 3 25-14
Post on 09-May-2015
360 Views
Preview:
DESCRIPTION
TRANSCRIPT
Bay Area Android MeetupHow to Achieve
Mobile App Performance
and Monitoring to Ensure Great
User Experiences
6:30pm: Food & Drinks7:00pm: Performance Monitoring – Alex Gaber7:40pm: Test Automation and CI – Melvin Laguren
Bay Area Android MeetupHow to Achieve Mobile App
Performance and Monitoring to Ensure Great
User Experiences
Crittercism 3-25-2014
Agenda
• Why Does Android Performance Matter?• Snappy UI for UX Performance• UI Thread vs. Worker Thread• Android OS Install Base Fragmentation• Mashed Up Mobile Apps – 3rd Party APIs• Mobile Ad SDK performance• Security SDKs performance• MBaaS performance• Testing vs. Monitoring for Performance• Implementing Android App Monitoring
How Users React to Poor App Performance
Source: Crittercism end-user survey Q4’2013
Did not do anything
Shared the experience via social media
Left a negative review on the app store
Contacted support or told the vendor
Told a friend in person
Uninstalled the app
0% 10% 20% 30% 40% 50% 60% 70%
26%
9%
10%
21%
26%
65%
What Do Users Do When the App is Slow?
Personal Experience – Uninstalled Android Apps
Lots of apps in the Google Play Store……..
..….. and lots of uninstalls, 1 stars, bugs?
HELP !!!
Agenda
• Why Does Android Performance Matter?• Snappy UI for UX Performance• UI Thread vs. Worker Thread• Android OS Install Base Fragmentation• Mashed Up Mobile Apps – 3rd Party APIs• Mobile Ad SDK performance• Security SDKs performance• MBaaS performance• Testing vs. Monitoring for Performance• Implementing Android App Monitoring
Snappy UI Equals Great UX
Linear Layout • Similar to nested tables in HTML• Great for quick and simple UI designs• Performance degrades as complexity increases
Linear Layout
Snappy UI Equals Great UX
Relative Layout• Eliminates Nested view groups• Keeps layout hierarchy flat• Much better performance for complex layouts
Relative Layout Example – activity_main.xml
Relative Layout“button2” is
below “button1”
Agenda
• Why Does Android Performance Matter?• Snappy UI for UX Performance• UI Thread vs. Worker Thread• Android OS Install Base Fragmentation• Mashed Up Mobile Apps – 3rd Party APIs• Mobile Ad SDK performance• Security SDKs performance• MBaaS performance• Testing vs. Monitoring for Performance• Implementing Android App Monitoring
ANR – Application Not Responding
What causes an “Application Not Responding” (ANR) error?
• No response to an input event (such as key press or screen touch events) within 5 seconds (5,000 ms)
• A BroadcastReceiver hasn't finished executing within 10 seconds (10,000 ms)
Main Threads vs Worker Threads
Main Thread (UI Thread)
• Main Thread is also called the “UI Thread”
• All Android activities operate in the Main Thread by default
• You can easily overload the Main Thread– Doing network operations on Main
Thread– Slow disk operations (un-optimized SQL)
Main Thread (UI Thread)
TIPS• Worker Threads are “background threads”• Handle all network calls w/ Worker Threads• Decouple the UI Thread from potential
blockers
Sample Worker Thread
Main Thread (UI Thread)
Set Thread Priority: Example
Agenda
• Why Does Android Performance Matter?• Snappy UI for UX Performance• UI Thread vs. Worker Thread• Android OS Install Base Fragmentation• Mashed Up Mobile Apps – 3rd Party APIs• Mobile Ad SDK performance• Security SDKs performance• MBaaS performance• Testing vs. Monitoring for Performance• Implementing Android App Monitoring
Android OS Install Base Fragmentation
Over 20% of Android devices are still running an OS version below 4.0
Data collected during a 7-day period ending on March 3, 2014
(developer.android.com)
Agenda
• Why Does Android Performance Matter?• Snappy UI for UX Performance• UI Thread vs. Worker Thread• Android OS Install Base Fragmentation• Mashed Up Mobile Apps – 3rd Party APIs• Mobile Ad SDK performance• Security SDKs performance• MBaaS performance• Testing vs. Monitoring for Performance• Implementing Android App Monitoring
Average Mobile App Consumes Five 3rd Party APIs
• The average mobile app is using between 5-6 APIs / web services
• API Monitoring from web server to web server does not tell the full story
Average Mobile App Consumes Five 3rd Party APIs
Agenda
• Why Does Android Performance Matter?• Snappy UI for UX Performance• UI Thread vs. Worker Thread• Android OS Install Base Fragmentation• Mashed Up Mobile Apps – 3rd Party APIs• Mobile Ad SDK performance• Security SDKs performance• MBaaS performance• Testing vs. Monitoring for Performance• Implementing Android App Monitoring
3rd Party SDK Overhead and Performance Latency
• Mobile Ads SDKs
Agenda
• Why Does Android Performance Matter?• Snappy UI for UX Performance• UI Thread vs. Worker Thread• Android OS Install Base Fragmentation• Mashed Up Mobile Apps – 3rd Party APIs• Mobile Ad SDK performance• Security SDKs performance• MBaaS performance• Testing vs. Monitoring for Performance• Implementing Android App Monitoring
3rd Party SDK Overhead and Performance Latency
• Security SDKs
3rd Party SDK Overhead and Performance Latency
What is that SDK adding to your app?
• What is the performance overhead for this service? • What if they start to lag or get slow? • How can I monitor that this SDK isn’t making my app have
performance issues?
Agenda
• Why Does Android Performance Matter?• Snappy UI for UX Performance• UI Thread vs. Worker Thread• Android OS Install Base Fragmentation• Mashed Up Mobile Apps – 3rd Party APIs• Mobile Ad SDK performance• Security SDKs performance• MBaaS performance• Testing vs. Monitoring for Performance• Implementing Android App Monitoring
MBaaS Powering your Android App
Agenda
• Why Does Android Performance Matter?• Snappy UI for UX Performance• UI Thread vs. Worker Thread• Android OS Install Base Fragmentation• Mashed Up Mobile Apps – 3rd Party APIs• Mobile Ad SDK performance• Security SDKs performance• MBaaS performance• Testing vs. Monitoring for Performance• Implementing Android App Monitoring
Testing Does Not Ensure Performance: Trust But Verify
• Agile Mobile App Development methodology– Leaves little time for testing
Testing Does Not Ensure Performance: Trust But Verify
• Agile Mobile App Development methodology– Leaves little time for testing
Agenda
• Why Does Android Performance Matter?• Snappy UI for UX Performance• UI Thread vs. Worker Thread• Android OS Install Base Fragmentation• Mashed Up Mobile Apps – 3rd Party APIs• Mobile Ad SDK performance• Security SDKs performance• MBaaS performance• Testing vs. Monitoring for Performance• Implementing Android App Monitoring
Implementing Performance Monitoring for Android
Failure of shopping cart check-outs, referrals, etc. Transaction Errors
HTTP Errors like 404’s, Errors accessing Cloud ServicesAPI & Network Errors
Slow performance, High latenciesUnresponsive Apps
Downtime due to app crashesApps Crashes &
Exceptions
Performance issues due to geography Location
What cannot be tested prior to launch?
Implementing Performance Monitoring for Android
DEMO
Testing Does Not Ensure Performance: Trust But Verify
Thank You!www.crittercism.com
@crittercism
top related