App cross-platform development scenarios and tradeoffs

Source: Internet
Author: User
Tags garbage collection mixed
App cross-platform development solutions and choices

Strong in the heart to admit mistakes, but first you have to dare to try and wrong.

Now the client-side development of the company will face a huge problem, then is the cross-platform. For mobile devices currently on the market. Mobile devices such as Android, IOS, WindowsPhone, Blackbattery and so on, let us have a headache in development adaptation.

But as Google competes with Apple, startups are now focused on Android and iOS apps. However, the equipment on both systems is enough for us to toss. From system version adaptation, screen adaptation, and more.

Friends of the start-up company, for the development of a simple app,android client invited 2 students. The iOS client invited 2 classmates. According to the price of the Royal Park, on the single-client development engineer, each month to take out 7W dollars to keep them.

and the corresponding test, interface, UI out of the picture will have to do a double work. Then why do we not choose some cross-platform development means in our work development? the current app cross-platform solution

Here, I say my summary and thinking. In general, the current cross-platform scenario is divided into a few: HTML5-based web App program. Scenario 3 that is mapped using a third-party language. cross-platform based on browser WebView


Cross-platform solutions based on WebView I'm sure you're familiar with this, and using web development is a light and one-step thing for a web development engineer.

The main disadvantage of the HTML5 scenario is in terms of functionality and performance, mainly because the ability of the HTML5 application relies heavily on the system's own Web engine: iOS UIWebView, Android WebView, and the HTML5 capabilities of such components compared to Safari for IOS, Chrome for Android are a short cut.

Furthermore, for the new performance optimization of native systems, such as garbage collection mechanism, the reuse mechanism of ListView, and so on, system level optimization is often difficult to realize the logic of using WebView.

In addition, on the Android platform, due to the serious system fragmentation, different Android version of the WebView HTML5 ability also has a large difference, resulting in the corresponding HTML5 application consistency is difficult to guarantee.

At that time, there are still several companies in the industry to provide solutions as follows:

React.js

Fackbook's open source framework, compared to other JS framework, react JS put forward a very important concept. That's Virtual DOM.

In web development, we need to manipulate the DOM in real time by reacting the changed data to the UI. Complex or frequent DOM operations are often the cause of performance bottlenecks (how high-performance complex DOM operations are often an important metric for measuring a front-end developer's skills). React introduced the virtual DOM mechanism for this purpose: a set of Dom APIs was implemented with JavaScript on the browser side.

Jquerymobile


jquery Mobile is a version of jquery on mobile phones and tablet devices. jquery Mobile Not only brings the jquery core library to the mainstream mobile platform, but also publishes a complete unified jquery Mobile UI Framework. Support the global mainstream mobile platform. Now there are similar frameworks: JQTouch, Sencha Touch, and so on.

For Fe, jquery is undoubtedly a very useful JS framework. The main reason most developers use jquery mobile is because they are familiar with jquery and can get started quickly.

phonegap/cordova/appcan/ ...

This type of framework, or specifically, has been modified to a complete set of solutions. They are provided to the web developer through the encapsulation of JS, to some native functionality of the API. With this set of APIs, mobile apps can access native device features such as cameras, microphones, and more, with JavaScript.

These vendors often also make them a complete set of solutions. api/Online compilation/compiler/ET. These rules are not made by the first-line companies, and as a small company, these tools become particularly strong commercial purposes. Cross- compilation-based inter-platform

We all know whether it's an iOS system or an Android system. Their bottom-up runs on Unix-centric systems, and they all have a good support for C + +. This allows us to implement our own app architecture by using the underlying solution, with open GL.

Cocos2dx/crossapp

Cocos2d not to say much, in the circle of fame is very big. is a well-known cross-platform game engine, mostly used as a development game. The most famous fish-bashing man of the year was the use of cocos2d-x as a game engine development. COCOS2D Graphics rendering based on OpenGL ES to maximize GPU performance for mobile devices.

After all, Cocos2d is a game engine, and many development methods are different from developing applications. So there is another open source project in China, Crossapp.

The Crossapp is a rendering driven mode that extracts the cocos2d-x. If you use the game engine directly, in the program life cycle, in the continuous redraw, the disadvantage of rendering drive mode is that the CPU consumes high and therefore consumes power. It is obvious that this kind of continuous repainting may not have much effect on the game, but it is too wasteful for the app. Therefore, we change the rendering mechanism to event-driven mode for the characteristics of the application. This mode of rendering to have external trigger will be redrawn, in the absence of external trigger when the picture is still, rendering stop, in order to achieve energy-saving effect.

Xamarin

Xamarin was founded in 2011 and is designed to make mobile development incredibly fast and simple. Xamarin's products simplify application development for a variety of platforms, including iOS, Android, Windows phone, and Mac apps. Xamarin was founded and participated by many well-known open source community developers, and is also the leader of the Mono project--c# and · NET Framework for open-source, cross-platform implementations. Conclusion

The problem with cross-platform development is that the basic implementation of a function is not perfect. The same set of code to take into account the different platforms, many implementations become a compromise implementation, the original some excellent platform features in order to balance the other platform can not be used.

Facebook was also planning to use HTML5 for mobile development, developing a half-year-long discovery pit or turning it into an iOS native development.

Fackbook is ready to quit the React native framework is known to be able to solve the problem of mobile cross-platform development, and now there is no open source, we can wait and see. Hybrid developing hybrid apps

is a mixed-development app. ANDORID+HTML5 or IOS + HTML5. In theory, mixed-development apps are not a cross-platform development (we can simply think of using native development). So the problem is, since both are good, then we will use the web to develop some pages that experience, operate, and do not require much permission. In other places, we use the native SDK for research and development. (Turned a big circle, completely without cross-platform, found and spat) cost Analysis

Of course, whether to use some open source cross-platform framework, to create cross-platform app applications, but also depends on our business scope and our company's technical talent accumulation. Below, the author briefly summed up the following several reasons, so that everyone in the choice of direction and platform when to make a good choice. As the following table:

Cross
cause \ Scenario Native App (Android + IOS) Web cross-platform scenarios-compiling cross-platform scenarios Hybrid App Solution
Performance Excellent So so So so Excellent
User Experience Excellent Poor Excellent Excellent
Job Opportunities So so More easily Difficult So so
Development effort Large workload Less So so Large workload

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.