Taking a Native-Centric Approach to Hybrid Mobile App Development

Exploring Cordova/PhoneGap, React Native, and NativeScript for hybrid/cross platform mobile development with JavaScript.

Torey Lomenda

Over the past year, I have been exploring Cordova/PhoneGap, React Native, and NativeScript for hybrid/cross platform mobile development with JavaScript. As part of this exploration, my key question was, “Can I access the power of the native mobile platform while also leveraging the openness of JavaScript to maximize code reuse across platforms?“.

This led me down the road of a taking what I call a native-centric hybrid approach to developing iOS and Android apps. The philosophy behind this approach is that since Users expect an intimate UX on their devices, Developers should be diligent to get intimate with the platforms they are targeting while also striving to maximize code reuse to reduce overall development costs. The essence then is to mix native code (i.e. iOS, Java) with JavaScript code in the “right way” and strike a balance between UX and code reuse. In general, I discovered that things can get tricky mixing native code and JavaScript code, especially if there is a high degree of interaction between components.

However there are merits to this approach if care and attention is followed. In general,

  • Consider using native tech for app flow, transitions, animations, UI components with rich, complex interaction
  • Consider using HTML/CSS/JS for content rich UI components, services & business logic
  • React Native is a friendlier option for mixing Pure Native and Cross-platform JavaScript than Cordova
  • NativeScript with TypeScript/Angular 2 is an opinionated framework that takes a JavaScript first approach to cross platform mobile development
  • In the end, not sure the added complexity of mixing Cordova and Native is worth it. If you need to mix, React Native is a better option.

Presentation Slides and Demo Code

You can further explore my discoveries through the presentation slides and demos I put together by cloning the publicly accessible GitHub repository located at Native-Centric Hybrid GitHub Repository.

Once you clone the repository, checkout the README file for details on setting up your Macbook to run the demo examples.

I also encourage you to review the slides as context before going through the demo code. For convenience, the most recent slide deck (pdf format) can be found at Presentation Slides - 2016.

Places to Look for Inspiration

Share this Post

Related Blog Posts

JavaScript

Migrating from Cordova to React Native

September 8th, 2016

Strategies, tips, and gotchas for migrating a cross-platform mobile app from Cordova to React Native

Object Partners
JavaScript

A Guide To Learning Angular 2

August 25th, 2016

List and reviews of books, tutorials, and other resources helpful for learning Angular 2 and related concepts.

Object Partners
JavaScript

How to Not Be Afraid of Transitive Dependencies in npm

August 2nd, 2016

Solutions for locking down dependencies in npm. Learn to trust your dependencies and update/deploy without fear.

Nathan Smith

About the author

Torey Lomenda

Chief Software Technologist

Torey is a Chief Technologist at Object Partners Inc. specializing in Mobile & Enterprise technologies with over 19 years of professional experience. Most recently he has led a number of iOS-related projects, applying his expertise in building HTML5 and Native Objective-C & Swift-based apps for iOS (iPad/iPhone). He has led the development of various mission-critical applications and supports a pragmatic delivery approach using various agile methodologies. During his career he has gained expertise with iOS, Java/JEE ecosystem and its related open source (ie: Spring-related, Tomcat), Groovy/Grails, JavaScript & technologies (ExtJS, AngularJS) to deliver rich internet applications (RIAs), and various commercial technologies (ie: IBM/Tivoli, Oracle, Tibco).