We’re one step closer to a mobile app developers dream: One day, they will share code across web and mobile, across Apple iOS and Google Android platforms.
Through open source cross-platform frameworks, such as NativeScript and React Native, developers can write one code base to create both native iOS and Android mobile apps. NativeScript, developed by Progress, a software company based in Boston, supports the Angular open source web development framework. React Native, developed by Facebook, is an extension of React JS.
At last week’s Progress conference in Boston, developers discussed the pros and cons of using cross-platform frameworks, such as NativeScript or React Native, to create native mobile apps.
It was all a dream
The creation of one code base that is easy to maintain and publishes well across multiple OSes is no easy feat, said Jonathan Marston, director of software at Optimus Ride, a self-driving car company in Boston. Tools such as Adobe Air have tried and failed to achieve it, he said.
“In the past, that dream has never lived up to the reality,” Marston said.
The ability to share code across multiple mobile OSes is getting more attainable with tools such as NativeScript and React Native, but the particular idiosyncrasies of each OS make it difficult to achieve complete code sharing, said Jesse Crossen, lead developer of VoiceThread, an education software company in Durham, N.C. For example, developers might want to write one set of code for an iOS visual component and another for an Android visual component, due to different screen sizes and resolutions.
“You’re always going to have that level of customization per platform or have [an app] that’s a little bit generic,” Crossen said.
NativeScript vs. React Native
Like coding languages, developers are fiercely dedicated to their preferred cross-platform framework. Organizations that need to decide which route to take should look at the skill sets of their development team, said Jason Wong, research director at Gartner. Developers that are familiar with React JS should develop apps with React Native, and those that use the Angular framework will be more comfortable with NativeScript.
The VoiceThread team ported its web app from the Adobe PhoneGap framework to React Native to make a mobile app, but it discovered React Native was not a good fit. The flexibility of NativeScript enabled the team to customize its complex app with plugins more easily than React Native did, he said.
“React is opinionated,” Crossen said. “It was an awkward fit. Our app is unusual. We quickly hit that point where we had to go outside the framework.”
Developers should also consider the open source community behind the framework, Wong said. React Native has a larger community of contributors than NativeScript, most likely due to the support of Facebook. NativeScript focuses on enterprise use cases more than React Native does, however, Wong said.
A hybrid app framework, such as Apache Cordova or Ionic, can also offer a native mobile feel, although it runs the app in a WebView.
Safety Insurance agency in Boston used Cordova to create a web-based app that is compatible with Android and iOS. Five years ago, hybrid apps suffered from performance issues because mobile devices didn’t have the strongest processing power, so NativeScript or React Native would’ve been a better option then, said Keith Carangelo, web development manager at the agency.