best practices for developing mobile web applications
play

Best Practices for developing Mobile Web Applications 23 September - PowerPoint PPT Presentation

Best Practices for developing Mobile Web Applications 23 September 2011 Open World Forum 2011, Paris, France Dominique Hazal-Massieux <dom@w3.org> http://kwz.me/ps This project is funded by the European Union through the Seventh


  1. Best Practices for developing Mobile Web Applications 23 September 2011 Open World Forum 2011, Paris, France Dominique Hazaël-Massieux <dom@w3.org> http://kwz.me/ps This project is funded by the European Union through the Seventh Framework Programme (FP7/2010-2012) under grant agreement n°257800 - Mobile Web Applications (MobiWebApp)

  2. W3C Funded and directed by Web inventor Tim Berners-Lee International consortium of 320 organizations (w3.org/join) Staff of 60 in Europe, USA, Japan Home of HTML5, CSS, SVG, JavaScript APIs, etc. Dedicated efforts around mobile

  3. Mobile Different constraints Different opportunities

  4. Constraints smaller physical screens difficult to use keyboards no mouse lesser network connectivity reduced CPU & memory diversity & fragmentation different usage patterns

  5. Advantages always available intuitive touch interfaces full of sensors easy access to audio & video different usage patterns

  6. Mobile Web Adapt layout Adapt input Reduce network usage Reduce CPU & memory usage Adapt content

  7. Layout physical sizes: 3-4" Resolution: 120-800px wide Portrait orientation Older browsers: partial screen view Recent browsers: zoomed out Scroll bars and zooming best avoided

  8. Adapting Layout Avoid zoom: ������������ viewport ����������� width=device-width �� Adapt style to screen size: ������������������������������������������ ���������������������������������������������� media='screen and (min-width:600px)' � Use liquid or elastic layout, preferably in single column

  9. Input keyboard: Keypad: text entry difficult physcial keyboard: tiny keys touch keyboard: slow, takes up screen space no mouse; increasingly touch-based UI

  10. Reducing text entry ������������ tel � ������������ email � ������������ date � � datalist ���������������������������� Soon (?): ������������������� speech �

  11. No mouse large hit targets for touch-based devices sequential navigation in the page touchstart , touchmove , touchend events

  12. Network limited bandwidth high latency network traffic costly or under quota on and off

  13. Reduce Network Usage Minify/gzip markup, stylesheets, scripts Use HTTP caching: ������������� ������������� Reduce size and number of external resources: images (CSS sprites, EXIF data, optimization) scripts (JS libraries) aggregate stylesheets Use �������������� for partial updates Optimize cookies

  14. Prepare for Offline Operations Data storage: ������� localStorage Better, but later: ���������������� indexedDB.open ��������� Offline caching: ������ manifest �����������������

  15. CPU & memory slower CPUs CPU usage drains battery more limited memory

  16. Optimize CPU & memory usage Resize images on the server Avoid long-running scripts Limit page reflow and repaints Limit size of pages, script objects Limit network usage

  17. Diversity & Fragmentation Much more diversity than on computers Wide-ranging capabilities among browsers

  18. Content Adaptation Responsive Web Design : CSS Media Queries Mobile first JavaScript Feature detection Server-side content adaptation

  19. Mobile Web Applications vs “Native” Apps freedom to deploy and update cross-platform, cross-devices

  20. Building Mobile Web Applications Slicker UI Sensors Hardware Better use of network

  21. Slicker User Interfaces SVG CSS3 animations & transformations canvas The other side! Mouse over this circle

  22. Sensors Geolocation: ���������� geolocation.getCurrentPosition(…) Accelerometer / gyroscope: ������������������ devicemotion �����

  23. Hardware (soon) Battery: battery ������������������� batterylow ����� Camera / Mike: ���������� getUserMedia �����������������

  24. Better connectivity Adapt to network type: ���� navigator.connection.type ���������������� Optimize polling: ���������������������� EventSource() � ��������������������������������������������� Bidirectional connection: ����������������� WebSocket � ������������������������������������������� ����������������������������������� Soon, P2P connection: ��������������������� PeerConnection ��������������������� ��������������������

  25. UI + Sensor + Network

  26. Web & Connected devices computers phones tablets TVs soon: cars, home automation, cameras, etc.

  27. Learn more Relever le défi du Web mobile , ed. Eyrolles Mobile Web Initiative Web site, with Best Practices W3C on-line training on Mobile Web Applications Standards for Web applications on mobile http://kwz.me/ps This project is funded by the European Union through the Seventh Framework Programme (FP7/2010-2012) under grant agreement n°257800 - Mobile Web Applications (MobiWebApp)

Recommend


More recommend