Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building hybrid React apps for iOS and Android with native performance

Tags:

Is it possible to build apps for iOS and Android with Facebook's React JavaScript framework, delivering nearly the same performance as native apps?

like image 270
raju-bitter Avatar asked Jan 29 '15 13:01

raju-bitter


People also ask

Can you make iOS and Android apps with React Native?

With React Native, developers can write real, natively rendering mobile applications for iOS and Android. It helps build apps on two platforms at once, while maintaining the look, feel, and productivity of an app built on the specific iOS or Android platform.

Can we build hybrid app using React Native?

You may have heard about React Native, Flutter, lonic, or Cordova in conversation. These are all frameworks for building a hybrid mobile application, which is a way of building an iOS and Android app from a single codebase.

Is React Native native or hybrid?

React Native is the leading hybrid mobile development framework. With React Native you write an iOS app just like you would write a web app. That's very convenient, but also may cause some problems. React Native uses React.

Is React Native a hybrid mobile app?

React Native (RN), built by Facebook (and launched around 2015) tries to give you the best of both worlds. While it's technically a hybrid platform in that it can be written in one language (and works for both iOS and Android), it has several “native” features.


1 Answers

Until January 2015, using a hybrid approach of running the React JavaScript part inside the WebView component would have been the only option, using frameworks like Apache Cordova, with the typical disadvantages this approach has. Tasks like JavaScript's garbage collection can slow down the native portion of the app, leading to skipped frames, making the app feel sluggish.

On January 28th Facebook announced the React Native project at React.js Conf 2015. React Native will be an open source project, which enables native rendering of HTML5 applications built with React for iOS and Android. React Native has been used by Facebook internally to build apps like the Facebook Groups app for iOS.

Technically React Native runs the JavaScript code for a React app in a background thread. Updates to the virtual dom are collected, and all changes are sent through an API into the native portion of the app. By doing this, React Native avoids slowing down the FPS rate of the app by making the app wait for unfinished JavaScript operation.

Facebook announced that the source code for React Native will be available on Github shortly after React.js Conf 2015. Conference participants will have access to the Github repository on January 29th 2015 already.

Update: The 2nd presentation video with some technical details React.js Conf 2015 Keynote 2 - A Deep Dive into React Native is up on Youtube now. During the presentation Facebook announced that the source code for the layout and box model engine rendering for both iOS and Android is available on Github in the following repository: github.com/facebook/css-layout

The iOS version of the animation library used for React Native is hosted at https://github.com/facebook/pop

Update 2: Source code available on Github now The React Native source code is available now https://github.com/facebook/react-native.

Update 3: React team released Android support in Sept 2015 https://code.facebook.com/posts/1189117404435352/react-native-for-android-how-we-built-the-first-cross-platform-react-native-app/

The instructions to get started with React Native Android development can be found here: https://facebook.github.io/react-native/docs/android-setup.html

like image 62
raju-bitter Avatar answered Oct 11 '22 21:10

raju-bitter