Fine-selection article-development tips
Share to Plurk
Share on FaceBook
Build a Cross-Industry mobile platform APP with Web technologies
‧ Jun/Gao Yi Zhong 05:38:38
Due to the rapid popularization of Online mobile devices (such as smart phones and tablets, various types of software tools are used to accelerate the dynamic application of large numbers of users, in the near future, the development trend of small screens, risk control operations, and other features is gradually evolving, allows you to make applications that are intended to be applied to a dynamic online website (collectively as an APP ). However, when there are so many upstream production systems in the market, do developers really want to write a single mobile system APP, how long does it take for me to learn how to compile and publish a speech? If the APP needs to launch multiple mobile production platforms at the same time, in addition to making all the changes in other languages, is there any other convenient platform failover method? Based on this, this article consists of two parts. First, we will introduce and learn how to use more and more powerful Web technologies, create a Web APP that can be used on various mobile platforms. Next, we will further explain how to use the PhoneGap package to create a Hybrid APP that can be officially launched on seven types of mobile production platforms for the user to install the security software.
Dynamic production industry system
The development of upstream mobile apps is always impressive, but there are so many mobile production systems on the market, developers often don't know where to start. This year's new market growth rate and growth rate (as shown in table 1 and Article 1) are the root cause ).
▲Table 1. IDC Worldwide Mobile Phone Tracker, August 8, 2012
▲Increase 1. The annual growth rate of various mobile platforms is DIGTIMES, 2012/8
Currently, the market share of smart phones has been clearly divided into two major operating systems: Google Android and Apple iOS, and BlackBerry OS and Symbian, as a result, the market expectation is not met, and the reason is that the original producer stops holding the latest version or downloading it to a low-end server. In addition, the overall scale and growth of the APP marketplace are important indicators of whether the mobile industry platform is favored by developers and the market. Because of this, the number of apps is currently the highest in length, and Microsoft Windows phones with an increasing annual rate of mobile phones at the same time, even if the market share is not high, it is still the third APP development platform that has been released again.
Frequently underestimated APP development history
In order to cope with the differences between mobile devices, APPs usually have some restrictions and zones, however, most recently, it is suggested that a single version of apps compatible with different screen sizes and resolutions should be developed, however, in order to make it easier for consumers to use user experience in different regions, some vendors may also divide the APP into different versions, such as tablets and mobile phones. In addition, due to the poor performance of the mobile platform, various apps have their own development limitations and restrictions (as shown in table 2 ).
▲Table 2. Development Information related to the three major industry platforms
IOS is usually highly popular for APP developers, and requires the development of Mac OS and Xcode, if you want to develop a root account, you need to pay another $99 or $299 for the annual subscription, however, because of the low rate of tablet devices in the iOS market and the low rate of tablet devices in the market, no matter whether mobile phones or tablet apps have relatively high support, it is still the first choice for developers of multiple apps. However, the program statement required is Objective-C, which is relatively large for developers.
Android is fully compatible with the free-of-charge mode. Developers only need to install JDK, Android SDK, Eclipse, and other free-of-charge development tools on any computer, it is not necessary to compile any development/release functions (except for programming languages), but developers still need to have a certain degree of JAVA language capabilities, in addition, the Android operating rules are more flexible than those set for free. You must note that the hardware specifications are inconsistent (such as screen resolution) or provide different support for different business system versions.
Windows Phone (in the case of WP7) has a very similar overall strategy as iOS, although the current market is very low, Microsoft has strongly promoted it and provided it to developers (for example, the development fund and fund ), currently, the number of apps is growing rapidly. Although there are many hardware manufacturers, the App (WP 7) support level is comparable to that of iOS, due to the limited definition of various rules, however, if an APP is developed based on WP8, WP8 will be available in the future and will not be supported in the future. Similar to iOS, developers need to pay $99 for the launch/launch year (the enterprise model should be calculated separately ), and use a Windows Vista SP2/Windows 7 or later operating system, with the Windows Phone SDK for development, and the producer must have C # Or VB.. NET program.
When combined with the above analysis, we will not find that, in addition to actual and hardware requirements (for example, iOS development requires Mac hosts), and development/installation for license, the biggest headache for developers is the need to learn new programming languages that may be completely unfamiliar to them. Generally, it is impossible for developers to master more than three languages at the same time, the primary node must be used to develop one or two mobile platforms. More importantly, when the APP was sold to a large number of consumers, when the market and market share were listed on other mobile platforms, so we need to repeat the entire APP with another comment. In addition, the certificate interface cannot be completely consistent with the user's intent on the same operation characteristics, resulting in a large volume of attacks on the producer, in addition, if the Android mobile platform is still subject to a relatively large hardware experience, it is necessary to compile different versions or upgrade the specifications to make adjustments.
Web apps replace cross-platform
So is there any way that it is not easy to be influenced by industry systems and hardware rules? This reminds me of Web technologies. As long as the website has a Web browser and an online function, it will certainly be able to support the Web browser, however, the Web should be inferior to the APP in terms of operation efficiency, available functions, and hardware license, right? In fact, with the introduction of HTML5, CSS3, and other new technical specifications, this natural law is beginning to change, especially in various vendors (such as Apple and Google) support for Flash Player is improved based on the HTML5 solution. However, the overall speed is still quite poor, but the Web has been able to do a lot of practical functions and special effects, through Web GL, it can help or even make some 3D faces directly from the Web. On the other hand, through the launch of the new starter kit, the current Web can achieve the same plane and operation mode as the APP, but it only needs to pass through the browser, this is the Web APP with the sub-accounts being very busy, such as Example 2. However, the traditional system needs to launch Native apps. Of course, the Hybrid App, which has recently combined two features, has become the third mainstream (Facebook and Baidu have used this technology in the past ). See table 3.
▲Drawing 2. Google Voice and Google Gmail are the design templates for Web apps
▲Table 3. Three APP-type comparison lists
For developers, the biggest advantage of Web App startup is the general and extensibility of technologies. In addition, if you do not take the test on the servo end, the Web development technology is usually used in a certain way and is not subject to the limitation of the operating system or hardware, alternatively, you may need to use other program scripts to create a new environment (even if everything can be developed), especially for Web developers, the original technology was easy to use, which is also the main reason why many vendors choose to directly develop Web apps rather than Native apps. However, it cannot be so perfect, and it is difficult for the industry platform to be influenced by other environments, however, since Web technology was developed, there was no such rule (especially HTML5 and CSS3 ), the parsing and support of Web applications are not exactly the same (as shown in Example 3 and Example 4 ), therefore, the biggest challenge that Web developers need to overcome in the near future is to design the Web interfaces that are compatible with various browsers. However, for Web apps, the degree of attention is relatively low, and the selection of the robot on the mobile platform is limited, and the most influential version of IE (6, 7, and 8) is not supported.
▲ Comparison 3. Comparison between HTML5 API support and comparison between different browser and Server
▲Summary 4. Support for CSS3 attribute by each executor compared to the summary table
Divide and implement HTML5 and cross-browser
According to W3C standards, a Web Page can be divided into four architectures (see figure 5 below ). This document uses ASP. NET as an example to explain how HTML5 and CSS3 are implemented and compatible with different plug-ins.
▲ Lifecycle 5. W3C Page Schema
ASP.. net ide development tools. For example, Microsoft Visual Studio 2010 does not support HTML5 (VS 2012 was initially supported ), therefore, the developer must first upgrade it to VS 2010 SP1 (for example, limit 6) and use the Extension Manager) external Security Web Standard Update for Microsoft Visual Studio 2010 SP1 (for example, release 7), this suite will provide VS 2010's ability to recognize more W3C standards, at the same time, HTML5 and CSS3 certificates are included.
▲ Release 6. Install the agent package in the lower region VS 2010 SP1
▲Copyright 7. Install Web Standard Update for Microsoft Visual Studio 2010 SP1 with internal charge manager
Developers only need to set the file format to HTML5 (such as limit 8) and create a correct HTML5 definition declaration, in Building, VS 2010 can provide more comprehensive HTML5 prompts and suggestions, and greatly reduce the large number of warnings and warning messages that were originally generated because HTML5 was not recognized.
▲ 8. Change the file format to HTML5
In order to be able to actually support multiple encoders, it is possible to reduce the current variance of different encoders, reset actions are particularly important in this segment, as shown in Area 9, the configuration of the Reset Definition region is used to centrally place the Program program that requires the difference between the multiple processors in advance, this prevents the upload tool from generating upload records when uploading row files. If the keyword can be added, attackers who cannot support HTML 5 can recognize the HTML 5 mark to prevent the hacker from generating the keyword. In addition, we want to minimize the difference between the rendering method of the table of the different Operator, as shown in the following figure, the following is the CSS Reset (for example, limit 10 ).
▲Copyright 9. Add the Reset Definition region to the region
▲ Examples 10. CSS Reset examples
Root author W3C standards, all HTML standards that need to be constructed on the graphic surface must be written in the body standards, however, using HTML 5 architectures to create tokens is not much different from the traditional HTML 4.01, but there are many more available new tags and special APIs, however, attention must be made in some concepts and keywords, and the standards that conform to the standards will be more responsive. For example, W3C stipulates that all standards must be small-sized; HTML 5 uses the article and section standards to typeset over many div labels. However, the mainstream HTML 5 standard format has not yet been fully popularized, so it is still possible to encounter issues that are not supported by other plug-ins, however, the solution is very simple. In addition to the special judgment, the solution is used to handle different operators, or reference some Java Script letters that help identify HTML tags, for some HTML 5 tags that are really not supported, then, use the HTML 4.01 standard or Java Script as an alternative.
▲Copyright 11. Place the standards of the Graphic Structure in the body standards and conform to the written standards
After installing the Web Standards Update for Visual Studio 2010 SP1, the producer can directly choose to use the verification mark of CSS 3.0 when creating an identical table, as shown in example 12. The CSS 3.0 certification allows VS 2010 to recognize more CSS scripts during development, and prevents malicious messages from being generated in the startup window, provide development environments that are closer to W3C standards.
▲12. Set the verification standard to CSS 3.0
In addition, when CSS 3.0 is used, some commands are currently set as optional in the browser. You must use CSS Properties such as-webkit-to enable the function. As shown in Area 13.
▲ Summary 13. CSS Properties
In the end, you do not need to take the test if you develop a Web APP. However, if you want the producer to be able to receive the test, it is necessary to design IE Hack and CSS Hack again (as shown in), with the token that only Internet users can recognize, to enable Internet Explorer on the computer to write different program or similar table content. This prevents the generation and production of zookeeper from generating similar visual effects. Even if the user accidentally uses Internet Explorer on the computer, it can also provide certain website effects and functions.
▲14. IE Hack examples
▲ Example 15. CSS Hack examples
This feature is currently the most intense part of the JavaServer zookeeper, currently the most widely used statement for EMCA-262, also known as Java Script. Since the various plug-ins do not compile their own Java Script Engine, resulting in different versions of EMCA-262 labels used between different plug-ins, such: internet lead E 6 uses the third-edition EMCA-262 standard; Chrome 17 uses the fifth edition EMCA-262 standard. However, even the same version of The EMCA-262 standard has a lot of practical methods on the different brand of choice.
There are usually two solutions to overcome this problem. The traditional approach is to use the function compute compiler to take different measures, so that the same action must be integrated with a variety of programming languages of different brands. However, this practice, which is not guaranteed to be used for a long time during the initial work period, is not recommended. Here, we recommend the second method that has recently become universal, that is to say, the Java Script should be upgraded to a handler for cross-compiler writing, so that the writing content can support the multi-compiler programming environment. According to the previous w3tech plugin query, JQuery is the most popular indicator (as shown in table 4), with the usage rate between one hundred and 44.9% on the top websites, in addition, the Java Script function has a 85.2% market share. Therefore, the amount of attention is replaced by the JQuery function to show how to compile a Java Script on your own. If you don't need it, you can simply and efficiently compile the Java Script. It also has the versatility of the compiler.
Allows you to create face and special effects comparable to those of apps.
After the HTML5 layout of the cross-browser is completed, the re-development of Web apps should be realized, that is, creating APP-like interfaces and special effects. The Web pages developed by the aforementioned rules can be set to normal by various types of operations, but the Web pages that are traditionally viewed by the computer, it is difficult and inconvenient to use the small curtain and the dynamic setting of traffic control operations, for this reason, the producer needs to create the operator and operation aspects.
In fact, there are many tools used to create small-sized mobile devices or render control screens on the Web, however, this article mainly aims to evaluate the trend and ease of use of mainstream marketing models. Currently, the selection is best suited and compatible with current Web technologies, let developers use jQuery Mobile as an easy example.
JQuery Mobile function discovery is built on the core of JQuery function discovery, however, the difference is that the main function is to use some Html5 and CSS3 technologies to extract the Layout Framework (Layout Framework ), it can automatically adjust the size and resolution of the screen (such as limit 16). In addition, it can be reflected in the Ajax Dynamic Loading Method, even some APP-specific animation effects and animations can be displayed freely (such as limit 17 ). It has the following features:
(1) compatible with all mainstream mobile platforms and mobile drivers, and even various new versions of desktop drivers. (Refer to http: // jQuery mobile.com/gbs /)
(2) effectively integrate render control and mouse events of the original zookeeper.
(3) The jQuery core attention method has a low degree of attention.
(4) using some Html5 and CSS3 new technologies, a large number of developers need to understand and write scripts.
(5) In the special processing mode, you can reduce the workload or operation size, and increase the efficiency of manual configuration.
▲16. JQuery Mobile can be used to create a graphic interface like an APP.
▲17. JQuery Mobile provides dynamic effects such as tumbler and rotation, which can be quickly converted
JQuery Mobile has three basic steps: (example 18)
(1) Declare HTML 5 document. (You can test the preceding cross-region comparison rules)
(2) include the mandatory jQuery Mobile CSS and jQuery Mobile Library. You can directly use the official website or publish the website on your own. If ASP. NET is used, you can use the Microsoft CDN website to upload more Development prompts on the IDE. However, the general version update is slow.
(3) define various structures in the formats specified by jQuery Mobile, such as data-role. All basic Web controls are regarded as the custom control rules defined by jQuery Mobile.
▲ 18. Basic usage of JQuery Mobile
JQuery Mobile also provides various special controls and effects, such as List View, Navigation Bar, And Popup. We can also use jQuery-like methods to use jQuery Mobile APIs in Java Script scripts to achieve more customized effects.
In general, as long as you are sure to comply with the above HTML5 and cross-vendor programming rules, and effectively use the jQuery Mobile function to publish APP-like operations, developers can learn a variety of programming languages and development environments without the need to develop Web apps that can be used on all mobile platforms through new Web technologies.
However, jQuery Mobile's Ajax dynamic injection is like a graphic blade, which can give users the ability to update graphic effects and 3D graphic effects, this is also because of the architecture issues (in fact, the next line of HTML content is directly written into the current area for display ), as a result, CSS, Java Script, and even HTML of the Next Generation Cannot be correctly run due to loss or ID duplication, therefore, developers need to pay special attention to this issue, and use non-Ajax dynamic loading to continuously refresh the entire batch.
In addition, it should be noted that the Web APP actually exists as a Web application. It cannot directly expose the store to users for lower-end authentication and security, it must be completed and confirmed by the mobile robot, which also means that most of its operations must have network support, the Zookeeper operation is completed successfully. In addition, if the developer's APP function involves some progressive hardware usage, such as shadow head and horizontal rotation, basically, some existing web app technologies are implemented, which is the main reason why the Hybrid App model was born.
Create a Service supporting AJAX
However, it should be noted that the reason why the Hybrid App can be normally shelved on various mobile platforms does not need to be re-written or corrected, the biggest reason is the transfer of HTML scripts, that is, in addition to HTML, CSS, Java Script, and other Client-side extensions, developers are still developing on the Web in the Hybrid App main body, but they need to publish all the Server-side comments to fully implement cross-platform encapsulation.
So many Web apps write scripts on the Server side, considering the commercial license security or the functionality that cannot be achieved by the Client side, what should I do if I want to implement a Hybrid App? We can start to use Web development ideas directly. In this case, we need to use external Web Service technologies. No matter what the Server side of the Service is, as long as the mobile machine has access to the network, it will be able to initiate cross-platform service calls. In fact, it also supports the use of the Hybrid App.
On the other hand, because the Web architecture only has Client-side statement, Hybrid App needs to call Web Service in AJAX mode, therefore, the Service also needs to support the corresponding settings. Use ASP. for example, you need to construct the Service mode of AJAX-enabled WCF Service (for example, lifecycle 19). At this time, you can change the configuration mode to Json, in addition to effectively reducing the total amount of data, it also helps parse Java scripts. In addition, for cross-domain or security issues, you can add the JSONP (JSON with Padding) and SSL authentication modes.
▲19. Add AJAX-enabled WCF Service
Seal the Web into a Hybrid App
In fact, Hybrid App is just a unified method and does not have a certain development mode. Even embedding Web View directly in the Native App framework is a construction method. In addition, Facebook and other companies all have their own Native APP development solutions. Therefore, this article focuses on the current mainstream development and development practices, the most important choice is the popularity of NLP and Its Application to the extension of multiple Web technologies, in addition, it makes it easy for a small developer to use PhoneGap across multiple mobile platforms.
PhoneGap is a very recent open source framework. It mainly uses the additional suite mode and adds it to the IDE of the native APP to form an Interface between the native API and Java Script, in this way, we can quickly build apps (such as using HTML5, Java script and CSS) on different platforms (such as limit 20 ). Currently, PhoneGap supports seven major mobile platforms, including iOS, Android, Blackberry, Windows Phone, Palm WebOS, Bada, and Symbian.
However, because of this, the producer must first have an idea that the producer can indeed use the same program as an APP for different mobile platforms. However, when using PhoneGap to build a Native App on the platform, you must first install the Native App on the platform. That is to say, in the example, if you want to build an iOS APP, developers still need to have Mac phones to build the APP. (You can compile the WEB and directly compile the program ). However, the producer can also renew the subscription by using the recently released PhoneGap Build Terminal Service, let the compiled program directly go through the build method on the terminal to quickly develop apps for different mobile platforms.
▲ 20b. PhoneGap Build
On the other hand, it is attached to the Native App environment mode. In fact, it means that the developer can also add Native Code assistance on his own, which gives the PhoneGap Hybrid App greater variability, that is, in addition to the Web APP functions of HTML5 + JQuery Mobile and the Progress functions (such as camera, horizontal camera, and earthquake) provided by the PhoneGap API, if there are special requirements or performance considerations, developers can even directly develop Native Code core to greatly improve APP functions, however, Native Code cannot be used on other mobile platforms ). Therefore, the design depends on the developer's actual usage.
In this article, we will use Windows Phone 7.5 as an example to describe how to use PhoneGap to effectively integrate it into VS 2010, and directly use the WEB architecture to develop and release it normally, use the Windows Phone Hybrid App provided by zookeeper, Submitter, and server guard. The steps are as follows:
(1) confirm the hardware environment of the Windows Phone Native App. Launch a development environment from Windows Phone 7.5, such as Windows Vista SP2 or above, Visual Studio 2010 SP1, and Windows Phone SDK (such as iis21 ).
▲21. Install Windows Phone SDK in VS 2010
(2) Deploy and install the PhoneGap package. Go to the latest version of PhoneGap (for example, release 22) under official website (http://phonegap.com/), and view starter.zip under lib \ windows.pdf (for example, Release 23 ), in VS 2010 ProjectTemplates project names (Users are set to C: \ Users \ User Name names \ Documents ents \ Visual Studio 2010 \ Templates \ ProjectTemplates) next, create the Silverlight for Windows phonelogs folder, and place the repository starter.zip file (for example, Release 24 ).
▲ 22. download the latest PhoneGap version.
▲23. unzip starter.zip
▲24. Unzip starter.zip is stored in the VS 2010 ProjectTemplates project.
After completing the preceding steps, click "add case" in VS2010 and select "C #. jpg '> In Silverlight for Windows Phone, if you can select the PhoneGap (Cordova) solution, it means that the solution is officially completed (such as limit 25 ).
▲25. Can I add a PhoneGap (Cordova) protocol?
(3) build a Hybrid APP on the WEB App architecture in the PhoneGap (Cordova) protocol. Create a PhoneGap attack case and add a new project (such as limit 26) to the WWW database ), select a Text Example and set the secondary name to html (for example, limit 27 ).
▲26a. Add a new category to the WWW Database
▲26b. Select the text watermark and set the secondary name as html
After completing the preceding steps, you only need to write the coding method on the Client side (according to the preceding HTML5 cross-browser protocol ), or, after the Web APP created with JQuery Mobile is removed from the Server statement and switched to the AJAX call Service, the website is moved to the WWW Information folder, and press Play to press "publish, you can see that the Native App, which was originally created on the Web architecture, can run directly on Windows Phone Device or Windows Phone Emulator (such as Route 27 ), and can be installed normally after the APP is created. In addition, the developer can use the PhoneGap protocol to compile the JS environment of the APP, and use various PhoneGap APIs to compile the APP overall function, to a real Hybrid App that is closer to Native App functionality.
▲ 27. The Web interface can be directly used by Windows Phone Emulator as an APP.
This article first introduces the latest Web technology, describes how to use ASP. NET as an example. using HTML5 coding standards across the browser, we can effectively overcome the current weaknesses of different browsers, and use JQuery Mobile platform to create operation interfaces and special effects like Native apps. As long as the robot is used to launch the program, it can be used in various Mobile platform Web apps.
The next step is to cut the Web APP's Server statement into a Service that supports AJAX, and use Windows Phone 7.5 as an example to expose the Client's HTML, integrate the PhoneGap Framework into the Native APP development environment and build a Web architecture, apsaradb for memcache can be used normally in the Hybrid APP launched, released, downloaded, installed, and updated on the seven major mobile platforms, or even through the subscription of the PhoneGap API, various functions (such as camera, horizontal scaling, and earthquake) that can only be achieved by Native apps are completed ). It is true that developers have guided a more general, technical, rapid development, and a more similar development path, it also provides an easy-to-use mobile platform APP design path for beginners to select.
Http://www.runpc.com.tw/content/content.aspx? Id = 109324