Fotolia

Cross-platform frameworks offer one-code path to mobile dev

Cross-platform app development frameworks enable developers to create native apps for iOS and Android. At a Progress conference, developers discuss different approaches.

Mobile app developers have a dream: One day, they will share code across web and mobile, across Apple iOS and Google Android platforms. That dream hasn't come to fruition for most developers yet, but it's getting closer.

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.

With both cross-platform frameworks, developers can write code in JavaScript to develop true native apps. On the other hand, tools such as Adobe PhoneGap -- now Apache Cordova -- and Ionic, enable developers to run apps in a WebView, which displays web content in a native view, with native extensions, to create hybrid mobile apps.

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

Jason WongJason Wong

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.

The PWA alternative

Cross-platform frameworks aren't the only ways to build apps for Android, iOS and the web. Progressive web apps (PWAs) offer a responsive design and run on the web but offer native features, such as offline functionality and push notifications.

Even with a good PWA, when you're really hooking users in, they're ready to install an app.
Jonathan MarstonDirector of software, Optimus Ride

Optimus Ride's team built a PWA because the organization wanted to iterate quickly, and it was easier to work with one platform rather than three. Since Apple does not yet support PWAs on Safari, however, features such as push notifications won't be available to iOS users, Marston said. In the future, the company plans to use NativeScript or React Native for features such as geolocation awareness that run in the background of the app, he said.

Users can find PWAs on the web rather than in an app store, which can enhance an app's discoverability, but some users crave the ability to download an app, Marston said.

"When you're really hooking users in, they're ready to install an app," he said.

Glorified webpage

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.

"Now, the phones are fast enough to deal with all of the JavaScript," he said. "You don't tell that our app is web-based."

The ability to have different development environments for each mobile OS is a good option as well, Carangelo said.

"When you want to change things [in NativeScript or React Native], it takes so long to get to that environment and make sure your tooling is up to date," he said. "To make changes in two environments isn't necessarily the hardest thing."

Dig Deeper on Mobile application strategy

Networking
Unified Communications
Security
Close