12. Mobile Network
• Network latency is the greatest contributor of
slooow response.
• Thus, reduce network access.
• Should we render pages from the server?
14. Enable Gzip Compression
60 - 70% Compression
Enable gzip support on server.
mod_gzip, server.xml, etc.
Enable gzip support on client, if necessary.
16. Use Websocket
• Websocket is already supported using Javascript
on mobile.
• Transfer data in JSON format. Encoding and
decoding is built-in using Javascript
21. • Native Shell
• Native Navigation
• Webview Content
David Heinemeir Hansson,
Creator of Ruby on Rails
22. Database Queries
• Usual SQL Query optimization applies
• Using paging with unlimited scroll
– Append LIMIT X OFFSET Y in SQL Query
– Check end of scroll
23. Displaying Lists and Scrolls
• when displaying with
more than 300 items:
– Review UX
– Avoid ng-repeat, or use
‘track by’ to avoid
rebuilding the DOM
– Use plain Javascript and
database query
26. Use Full Text Search
• Hooray! SqlLite supports Full Text Search
(FTS3, FTS4)
CREATE VIRTUAL TABLE papers USING fts3(subject,
body);
SELECT * FROM mail WHERE body MATCH 'sqlite';
• Test Results with over 100k records - FTS is
61% faster than ‘like’
27. Local Storage
• Store data on local as cache
– Local Storage
– Local Database
• Use local storage for temporary storage.
• Use database for persistent storage.
http://gonehybrid.com/dont-assume-localstorage-will-always-
work-in-your-hybrid-app/
30. Track Events and Error
• User activity and events are crucial to
usability.
• Tracking events is key to great application
design.
• Several solutions available: Crashlytics,
Rollbar, Mixpanel, Google Analytics,
31. Minimize Browser Reflow
• Generated HTML offline
• Reduce depth of DOM
• Avoid unnecessary complex CSS selector
32. Other Rendering Tips
• Optimize images to avoid resizing
• Use SVG instead of Images
• Use image sprites
• Avoid Shadows and Gradients
• Consider using SPDY / HTTP2 Protocol
• Use Crosswalk
37. Thank You
Allan C. Tan, SCEA, PMP
CEO/President
Email: allan@ideyatech.com
http://www.ideyatech.com/
allanctan
@allanctan ph.linkedin.com/in/allanctan/
10 secs – keep user’s focus
1 secs – keep user flow of thought
0.1 secs – feels instantaneous
Why is there a 300ms delay?
Let's suppose the user touches a link in iOS Safari. Because the user has the ability to double tap to zoom or scroll, whenever the user touches the screen, the browser does not instantaneously know whether the user meant to click the link, or is double tapping. Therefore iOS Safari waits 300ms after the first tap to see if the user taps again.
When pages are rendered from the server, updates are easier to deploy.
However, latency will make response slower.