Mobile Development Learning Notes

Source: Internet
Author: User

1 Getting Started with mobile web development

1) native native applications using Java, OBJECTIVE-C, Swift development

WebAPP Web Application HTML5 Development

Hybrid Hybrid Application Ooxx (Native,web)

2) text fixed size with PX; multi-screen adaptation uniformly modified words with REM

3) Viewport

width-width of viewport

height-Height of viewport

initial-scale-Initial zoom ratio

maximum-scale-Allows the user to zoom to the maximum scale

user-scalable-whether the user can manually zoom

Horizontal screen/Vertical screen
Window.addeventlistener (' Orientationchange ', function () {   //Rerender something}); Console.log ( Window.orientation); 0, 90, 180, 90 clockwise angle <style media= "all and (orientation:portrait)" type= "Text/css" >/    * Vertical Screen */</STYLE>&L T;style media= "All and (Orientation:landscape)" type= "Text/css" >/    * Cross screen */</style>

  

Matchmedia

FLEX Stretch Layouts
Display:-webkit-flex;  Display:flex;}. Initial {  -webkit-flex:initial;          flex:initial;  width:200px;  min-width:100px;}. none {  -webkit-flex:none;          Flex:none;  width:200px;}. flex1 {  -webkit-flex:1;          Flex:1;}. Flex2 {  -webkit-flex:2;          Flex:2;}

4) Open the Digital software disk

<input type= "Tel" >

5) Hide the address bar

SetTimeout (function () {Window.scrollto (0,1);},0);

6) You can add a website to your home screen using the Add to Home button on safari iphone,ipad,itouch

<link rel= "Apple-touch-icon" href= "apple-touch-icon-iphone.png"/><link rel= "Apple-touch-icon" sizes= " 72x72 "href=" apple-touch-icon-ipad.png "/><link rel=" Apple-touch-icon "sizes=" 114x114 "href=" Apple-touch-icon-iphone4.png "/>

7) click There is 300±ms delay, after using Fastclick, can solve click the delay, also can prevent穿透

8) Area scrolling overflow:auto is not reliable, using Iscroll, Saber-scroll

9) User Gesture Collection

Webkit-tap-highlight-color:rgba (255,255,255,0)

You can block the shadows that appear when you click on an element, often for the parent element that has an event proxy

 

2 Mobile real-Machine debugging the ultimate weapon-browsersync3 on the best practice of mobile front endThings speak a lot, full of work, had to slowly look ~

1) Spa (single page application), which is what we often call Web application WebApp, is considered a trend in the industry, with two advantages:

① User Experience Good

② can better reduce server pressure

But a single page has several fatal drawbacks:

①seo support is not good, often need to write program alone to deal with SEO problems

②webapp's own memory management is difficult, Javascript, CSS is very easy to interact with each other

Frame selection

jquery chatty, compatible, good performance; Zepto customized for mobile, some places lack compatibility, but small size

MVC Framework Selection

The MVC framework is popular with backbone, AngularJS, Reactjs, CANJS, etc.

Network requests

①css Sprites

②lazyload

③ Merge Script js file

④localsorage

The offline caches that are actually used in the work are localstorage and application caches, both of which are good things, one that is commonly used for AJAX request caching, and one that is commonly used for static resource caching

Localstorage is not recognized by crawlers and cannot be shared across domains, so do not store business-critical information, and do not store security information

Application cache is the HTML5 new API, although all are stored, but localstorage, cookies are not the same, application cache is generally a static resource, allowing the browser to request these resources without passing through the network, Properly designed to replace hybrid storage static resources, the main advantages of using application cache are:

The use of application cache can improve the speed of website loading, mainly reflected in the request transmission, some HTTP requests to local read, effectively reduce network latency, reduce HTTP requests, easy to use, but also save traffic why not?

Summarize

A single page threshold high, experience good two mobile framework, light for Wang Daosan MVC Business Framework Best self-made four modular (REQUIREJS) Essential Five redundancy is the optimization of the enemy, regardless of website speed or code maintenance six CSS decoupling is the long-term 70 request no traffic is optimized the final means eight speed optimization cache for Wangqiwang Hybrid brings the mobile revolution, and native maintains interface calls

4 Mobile frontend has to understand HTML5 head header tags

5 Mobileweb Adaptation Summary

6 Some of the resources and tips needed for mobile development

Mobile Development Learning Notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.