When Modulus needed its app rewritten, it was a perfect opportunity for me to explore NativeScript to rewrite the app. In this article I’ll share some of my experiences using NativeScript to build this app.
Why did I choose NativeScript?
Before I start writing about my experiences, I wanted to list out some some technical details of the app so you know of what I was working with.
I started learning NativeScript by going through the tutorials at NativeScript.org. I quickly learned how to get up and running. The next thing I did was learn how to find and install plugins and write custom controls. After playing around with sample apps and some custom code, I was ready to hit the ground running. What follows is a summary of some of my experiences.
At first, I started writing the app for both Android and iOS. I would test all my changes on both platforms, and spend time fixing/styling each platform until it looked nice. However, I quickly noticed that I was running into more problems on the Android platform with my presentation layer. To save time, I decided to finish the iOS app before then fine tuning everything for Android.
While writing the app, I quickly found myself reading the Google Groups forum, the NativeScript blog, and Github Issues for the NativeScript project daily. It was nice to read about new features, tutorials, and other findings that people had. I also found the community to be pretty responsive to questions. It was more productive to ask a question, and move onto another task, rather than spinning my wheels on one issue.
Note: Since writing this, NativeScript has launched a Slack community, which is another great resource for getting help.
This sort of relates to my previous point. Toward the end of the project, I was in Xcode working on setting up Launch Screens, and setting other plist configuration options. I also had to use Xcode to deploy to the App Store.
I ran into a problem of having scrolling issues when I had 2 ListViews on the same screen. I decided to use a Repeater instead. In general, I think using a Repeater can give you more flexibility in your layout.
Editor’s note: Although a repeater comes with more flexibility, it does not have many of the built-in optimizations ListViews have for dealing with large datasets. If you’re using a non-trivial amount of data, it’s worth sticking with the ListView.
I was fortunate that I did not have to use any webviews in this app. I was able to find the NativeScript Telerik UI plugin which provided charting and side drawer capabilities for me. All of my components were using Native iOS components, which resulted in a high performance app.
The Telerik website has a list of tested plugins. These are nice because you know that they have been thoroughly tested, but the list is very limited. If you want to find additional plugins, search for “nativescript” on npm. It will return a list of many plugins. Although you have to use it at your own risk, you can often save a good amount of time from using a plugin.
Overall, I was happy using NativeScript. I think my next time around at building an app would be much easier. The product is still young, and with every release of NativeScript, I noticed that there were many new features and bug fixes that make me feel confident in the future of the product.