Hybrid or native: the best is the right one

Time:2020-10-19

This paper is reprinted from Zhongcheng translation
Translator: Wen Lin
Link: http://www.zcfy.cc/article/861
Original text: http://www.telerik.com/blogs/hybrid-or-native-mobile-app-use-the-right-tool-for-the-job

Translator’s note: the hybrid & native mentioned in this paper may be slightly different from what we usually understand. The native part of this article mainly talks about native script, which may be controversial in the eyes of some developers. As for native script, remember that @ front-end foreign journal reviews an article “building cross platform app with nativscript and angular2″, which can be referred to.

When should hybrid and native be used in mobile application development? Let’s learn about their differences and see which one suits you better.

Mobile app developers’ toolkits are expanding and more diverse than anyone expected. From pure native solutions like Xcode and Android studio to native JavaScript options such as telerik native script and react native, to Web-based frameworks like Kendo UI and ionic, it’s easier than ever to start app development. However, as the number of options increases, the paradox of choice emerges – we’re stunned, we can’t understand, there’s a paradox of choiceSo muchOption. We want less guidance, more clear choices. In this article, I hope to let you see the choice clearly, point to a broad road for you to create successful mobile applications.

When talking about the tools and services for mobile application development, such as those provided by telerik platform by progress, the choice becomes much simpler

  • Want to try hybrid?We provide Cordova / phonegap development, you can use any mobile JavaScript framework

  • Want to use native?We support native script development (with optional [angular 2 integration])

Using the telerik platform, you don’t need a Mac or manage various SDKs. You can use the best simulation, debugging and services like message push, live sync, App Store publishing, etc.

Hybrid or native: the best is the right one

What is hybrid app?

My colleague John bristowee talked about this in this blog post with a comprehensive explanation of hybrid. To be clear, hybrid app is not a mobile website! It is an application installed locally on the device, but uses web technology (HTML5, CSS, JavaScript) coding and runs in WebView. WebView is a browser packaged in mobile applications.

Hybrid app looks, feels and works like native app (most of the time… Look down). It can interact with the native functions of the device, such as geolocation, camera, address book, etc. Any native functions that cannot be used can be solved by various Cordova plug-ins.

Sounds great, doesn’t it?Let’s look at the advantages and disadvantages of hybrid:

Hybrid strengths

  • Completely cross platform:Code once, and you can build IOS, Android, and / or windows phone apps

  • Code reuse:You can copy most of the existing web app code and convert it to a mobile app

  • Skill reuse and low learning curveIf you have knowledge of JavaScript, HTML, CSS, you can use Cordova and mobile JavaScript framework to develop applications soon

  • Reduce development time and cost:Because of the above, the mobile app can be developed and launched relatively quickly

  • Sound ecosystem:Cordova is a mature open source framework, and kendo UI contains a well-known (and open source) mobile framework.

Hybrid disadvantages

  • Perception performance issues:Hybrid app runs in WebView, so it will be affected by the performance of WebView on the device (especially Android has a lot of problems)

  • Cross device behavior differences:WebView is not the same on different platforms (or even different versions), so it needs to adjust and optimize the code to ensure that the app can run on all devices as expected

  • Performance issues with large number of graphics and transitions:WebView certainly has problems dealing with a lot of graphics and transitions, especially in games and other UI heavy applications

  • Specific platform UI or features require additional development:The features of entering special platforms usually require additional coding, or in some cases, plug-ins, or even need to create their own plug-ins

  • The new version platform supports slowly:When the new mobile platform is ready to use, it will take months before Cordova introduces the new version and various support for its features

What is native app?

Native app is an application that runs locally on the device and uses real native UI elements. Unlike hybrid app, native app doesn’t need to sacrifice performance because it runs in the native environment of the device!There is no WebView in the native app.Native app also has full access to all available APIs on the platform (so you don’t have to use any plug-ins, although they are useful as well).

When it comes to native app, the best and easiest way is to use the free, open source native script framework.

Hybrid or native: the best is the right one

Why use native script? Well, like hybrid technology, it allows you to use your web skills (CSS and JavaScript / typescript) you have mastered and loved, while using our plug-ins such as telerik UI for nativescription to achieve a smooth and elegant user experience.

Does that sound good, too?Let’s also take a look at the advantages and disadvantages of native

Native strengths

  • Cross platform:Like hybrid, applications created with native script can run on IOS and android with the same set of code

  • Code reuse:Again, you can copy a lot of JavaScript business logic into native script applications (depending on the situation, of course)

  • Skill reuse:If you know JavaScript and CSS, or understand the concept of XML (UI markup), you already have the foundation to understand native script

  • Cross platform native UI and performance:Because applications use native components, they can run anywhere

  • Using the existing native library:Native script provides out of framework support for native libraries such as cocoapods

  • New features seamless support:When a new version of the mobile operating system becomes available, native script will be able to support it immediately

Native’s weakness

  • Relatively new:JavaScript native framework is relatively new, so the community is still making resources and expanding documents

  • Steeper learning curve:Hybrid allows us to use HTML, but native script forces us to use more native application concepts such as native UI elements. Sorry, there is no div, but native script layout engine is easy to understand

How to choose between them?

That’s the point, right?If you want to develop mobile applications and have a choice, and then the telerik platform supports both solutions, what would you choose? Here are some of the issues that we hear people talking about when they choose hybrid and native development:

Performance is very important to me – if the experience is not good, customers won’t want it!If performance is the key (as is often the case), use native script.

I just want to go online as soon as possible. It doesn’t need to be perfect or 100% native.Need to develop proofing app quickly? Hybrid might be the best choice. The cool thing about nativescription is that you can even copy most of the business logic directly from the proofing app and put it into the nativescription app (they are all JavaScript).

I want my app to stay up to date. I can’t wait for someone to write a plug-in or update the framework.Keeping up with the latest mobile platforms is a bit of a hassle, which is why native script provides fast support for new operating system releases and API upgrades.

IneedCreate a Windows Phone version for my app!Up to now, windows phone only supports hybrid (though the nativscript team is working on it).

next step

Let’s get started with a free trial on the telerik platform.We provide you with an instant development experience and numerous quick start tutorials on hybrid and native. Good luck!