I have started working on Native Script with Angular. The best part is the code sharing technique which i can use for Web & Mobile app both.
But one thing which i want ask here is that Angular is a framework which is developed by Google and Google also provides another framework for Native mobile app development i.e. Flutter
Why Google hasn't used the same Angular framework which Telerik has implemented with Native Script. I am sure that there must be some reason for it. I want to understand the reason.
If i can develop Web & Mobile app with a common skill i.e. Angular, then why i should learn/choose a new framework like Flutter.
I am not sure whether is it the right place where i should ask this question or not. If not, then please help me to find the right place.
Mobile App PerformanceNativeScript is quicker, however, Flutter app development is liked for more performant mobile applications. One more significant advantage of Flutter is that it uses the resources of the host devices.
Frameworks like React Native and NativeScript make building elegant, efficient, production-ready, and scalable mobile apps with JavaScript easy.
It's an extremely powerful tool. NativeScript provides abstracted UI and component APIs to access native iOS and Android hardware and UI components. This accelerates development because you can write a singular UI and business logic code for both iOS and Android, thus saving time.
It's worth considering NativeScript when:You want to use Angular for web components. You need custom native UI and you don't know Objective C or Java. You're about to transition and Angular or Vue web application to mobile.
Flutter is not the main deal here, the real thing is Skia.
skia is a 2d rendering engine which allows the user to run apps in high performance, this way instead of using html(chrome web engine) or using the native look and feel(nativescript) skia allows us to draw on each pixel of the screen, which allows us to write games in flutter.
Google real intentions as they reviled in flutter Live 2018 are to create a coherent UI between all platforms:
all of those frameworks use skia for UI and the respective framework for interacting with the OS (browser, desktop, mobile), because skia is a rendering engine and we control every pixel we can assure that a widget will look the same on all type of skia frameworks.
On the other hand nativescript use a node engine which they load on the platform, and each time we try to use a component we call the system engine to place a component on the screen with the native look and feel, this allows us to use features straight from the virtual machine which runs java/swift, this is why in nativescript you can use android.[ANDROID_JAVA_CLASS]
or ios.[SWIFT_CLASS]
.
nativescript main invention is around using native classes from inside nodejs engine which they are loading on runtime in-order to execute the specific platform code. When you are transforming nativescript mobile code to a PWA there is no need for this node engine because the browser has it's own engine this way we can remove unnecessary code from the PWA.
NOTE: nativescript is not an angular framework for mobile development its a nodejs framework for mobile development and Angular/vuejs are just frameworks which runs on top of nativescript core logic. Thats why if you want you can even write a react plugin for nativescript.
In Nativescript, Code is not compiled to native code , it runs on separate thread that communites code with native component. The runtimes enable you to call APIs in the Android and iOS frameworks using JavaScript code. To do that they use JavaScript Virtual Machines - Google’s V8 for Android and WebKit’s JavaScriptCore implementation distributed with iOS 7.0+. While Flutter compiles code to ARM C/C++ library that is consumed by native components so may perform better.
I didn't get a chance to compare performance for the two, as for NativeScript you write code in Typescript/Javascript while Dart is used for Flutter and I'm very new to Dart.
NativeScript is an open source that Angular has also listed in resources and there is very good community for NativeScript now. If you are interested to list pro and cons of different frameworks, here is one very good article.
Note :Test NativeScript apps online with a code editor and run on your device. You can use either Angular or Pure JavaScript orTypeScript or Vue.js flavor to build the app.
On a Side note :Google has unveiled Flutter at the 2015 Dart developer summit, and NativeScript was backed by Progress from 2014. Maybe Google wanted to give developers others options to explore native applications with other frameworks.
If you look for available commands for Flutter, there is one command called fuchsia_reload to reload the operating new operating system Fuchsia that Google is working on, so it could be possible they want to provide early support for that.
UPDATE: If we want to share the same codebase for web and phone, NativeScript is an obvious choice. The Angular and NativeScript teams teamed up to create nativescript-schematics, a schematic collection that enables you to build both web and mobile apps from a single project.
You can install it using
npm i -g @nativescript/schematics
And even you can migrate from existing project to code sharing projects as described here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With