In today’s era, we develop an application for both the Android and iOS Operating System. The software/IDE/platform which develops application only for one operating system is called Native Development and the one which develops an application for both operating system i.e Android and iOS that’s called Hybrid Development. Hybrid Development can be done by React Native, Flutter, Xamarin, Ionic, Phonegap, etc. React Native was developed by Facebook. Let’s discuss more about it:
What is React Native
The latest release version of React Native is 0.61.
Basic things needed:-
- Install NodeJS and NPM.
- Install create-react-native-app when NodeJS and NPM have been installed on the system (as shown below).
C:\Users\Webners> npm install -g create-react-native-app
- Browse to the required folder and create a new React Native project as shown below.
- NodeJS Python Jdk8 if not installed in the system
- Install React Native CLI. We can install its command-line interface on npm, using the below command:
npm install -g react-native-cli
Start it and to check the installation browse through the project folder and try starting the project using the start command.
- Eject the project and if you want to run an Android emulator using an android studio, come out of the current command line by pressing ctrl+c. Then, execute run eject command as
npm run eject
- Install Android Studio
- Configure AVD Manager (choose device like Nexus5x)
- Run android and after this open command prompt, browse through your project folder and execute the react-native run-android command.
- Create local.properties file and open the android folder in your respective project folder SampleReactNative/android (in this case). Create a file with named local.properties and add the following path in that.
sdk.dir = /C:\\Users\\Webners\\AppData\\Local\\Android\\Sdk
- Check Hot Reloading and to build application modify the App.js and the changes will be automatically updated on the android emulator. If not, click on the android emulator press ctrl+m then, select Enable Hot Reloading option.
- Covers Both Android and iOS
- Better efficiency.
- Compatible with third-party plugins.
- Easy to use.
- Focused on the User interface.
- Reduce time and efforts as single code runs on android and iOS.
- Hot reloading to see changes immediately.
Some of its editors for Mobile App Development
- Visual Studio Code
- Sublime Text
- Vim Editor
- GNU Emacs Editor
- Deco IDE
- Textmate Editor
- Gives optimal performance.
- Reuses code and inbuilt components.
- Large community developers.
- Live and hot reloading feature.
- Cost efficient as compared to native development.
- Easy User Interface.
- Easily integrate with third-party plugins and libraries.
- A large number of projects on GitHub as compared to other hybrid.development platforms.
- Lacks the Security Robustness.
- Sometimes it takes more time to Initialize.
- Sometimes managing memory is a little bit difficult.
- Less smooth navigation.
- Complicated UI and animations are not strong sides.