The world of device development traditionally requires the use of platform-specific languages, Java for Android and the Swift / Objective-C combination for iOS, for example. However, the emergence of JavaScript in multiple environments also allows us to use this language for app development. And, faced with this possibility, doubt can always arise as to whether we opt for the hybrid or the native aspect, something that we try to solve in this article.
First of all, it should be clarified that JavaScript is capable of developing web applications.
Types of apps that we can do with JavaScript–
In general, JavaScript allows us to make two types of applications for devices:
Hybrid applications
They are those that run in web view mode (that is, with the browser integrated into the app). These applications are internally implemented through web pages and therefore use all web technologies to develop (HTML + CSS + JavaScript).
The web view where they are launched is similar to any browser, executed on the device, only without the address bar and other interface elements that allow browsing elsewhere. That is, the web view will show you only the pages of the hybrid app.
As hybrid development alternatives, we find Apache Cordova, Phone Gap, and Ionic.
Native apps
In addition to executing a development made with JavaScript through a web view, we can also develop applications that are capable of compiling to native. Native means that it does not run through a web view.
In other words, our application is not a set of web pages, but rather compiled, at the same level as an application developed with the official languages.
As native development alternatives, we have Native Script, based on Vanilla or Angular JavaScript, and React Native, which requires developing with React below.
Hybrid vs. Native with JavaScript
Between these two worlds, we have the use of JavaScript as a common denominator, but really the workflow is not the same. Of course, neither will the resulting app.
We can highlight and face several points:
• Ability to take advantage of web knowledge
Hybrid application development is more like the web, therefore developers will be able to become more familiar with the development mode.
On the other hand, although in the native JavaScript development it is necessary to implement certain functionalities, such as views, differently.
• Ability to use peripherals
The peripherals that a device has (accelerometer, camera, etc.) are used using plugins in hybrid development.
If you develop in the native mode you are using the hardware directly, through the libraries with which you would work in the official languages of each platform. In a hybrid, therefore, you are more dependent on third-party development for access to hardware.
• Performance
Due to its compilation, in native development, we have to assume a higher performance of the android development apps services.
Although the truth is that, at the moment of truth, there are not many differences since nowadays the devices are very powerful and, in general, the applications are not too demanding on a technical level.
• Permissions and possibilities
The highlight at the end is that the web view is embedded within a browser and, therefore, is subject to the characteristics of web development. In summary, it is not always possible to perform any behavior within a browser, while in native it is possible.
• Ability to take advantage of a web development already carried out
Thanks to hybrid development we can take advantage of a part of the code of the web applications that we may have already developed. In native development, it is not so easy because the code changes more.
Summary
Hybrid development with JavaScript is today, an excellent alternative capable of covering most of the application requirements.
Being practical, its biggest advantage is that it allows web developers to take advantage of their knowledge and part of the work during the development of a web application.
Today we have JavaScript development that compiles to native, which is a further step, allowing you to enjoy resources much closer to the device and the libraries available in development with native languages.
The adaptation is a bit more complex for web developers, but its benefits are also representative enough to consider this option.