Mobile development and desktop development
Mobile web development (mobile web)
- Technology used is the same
- Differ only in screen size and interaction
1. Set the viewport
mate tags (metadata) information data is the data
<meta> tag provides metadata HTML document. Metadata will not be displayed on the client, but will be parsed by the browser.
// write in the head tag
viewport is the parent element of html
The following statements set its size
< Meta name = "the viewport" Content = "width = width-Device, Initial-Scale = 1.0, maximum-Scale = 1.0 User-Scalable = NO" > // Device-width = width equal to the width of the apparatus width // height = device -height height equal to the height of the equipment // initial-scale initial scale // maximum-scale allows the user to zoom the largest proportion // minimum-scale allows the user to zoom minimum ratio // user-scalable whether to allow the user zooms
2. Debugging page
chrom developer tools to debug page // phone browser compatibility problems will eventually have to look at the phone
Tags and css there are some compatibility issues with the website of the site caniuse
3. Media inquiries / responsive design
Definition: The selection of different styles of different resolutions
main effect:
- Monitoring media types, such as screen, tv, etc.
- Monitoring the characteristics of the layout viewport, the viewport is wide such as high resolution
usage
// used in the style tag inside
@media all // all media types, tv, mobile phones, printers
and logical operations //
(min-width: 200px) and (max-width: 300px by) {
body {}
}
Cons: Many repetitive css
Hxbrid app (mixed-use development)
Mixed Development Foundation:
Write pages run in the phone program. Originally page offers functionality is limited.
But the application can add functions to the page
In this case, js can call functions provided by others
example:
For example, the phone can not be achieved js shock
ios Andrews can make the phone vibrate
ios write a object C allows the phone to vibrate, and exposed to
This thing is registered as a function of js pages
js js call this function on the phone vibration
js object C function call to make the phone vibrate
Summary: js appears to allow the phone to vibrate, as long as the api provided to js
js code is to write logic functions provided by others