SlideShare a Scribd company logo
How To Integrate Native Android App With
React Native?
The popularity of React Native Technology cannot be contained. The growing
inclination of the app industry towards this cross-platform technology has
triggered the curiosity of many domains. Therefore, we need to learn more about
related development concepts. So today, let us learn the way to integrate Native
Android App with React Native!
Checkout Steps For React Native Integration With Native Android App!
If you are looking for an applicable solution to React Native integration with the
android application, then we have an early Christmas gift for you. Here’s how you
can do the same-
1# Environment setup-
1. Install node
2. Install watchman
3. Install JDK Java8
4. Install Android Studio
5. Download and install SDK from android studio
2# Setup Directory Structure-
1. Copy all existing android files to /android folder
2. Create package.json file – {
“name”: “MyReactNativeApp”,
“version”: “0.0.1”,
“private”: true,
“scripts”: {
“start”: “yarn react-native start”
}
}
3# Open terminal in current directory & Install react native with – yarn add react-
native, install yarn if not installed
4#. Add react native dependecies to app level build.gradle – dependencies {
implementation “com.android.support:appcompat-v7:27.1.1”
implementation “com.facebook.react:react-native:+” // From node_modules
implementation “org.webkit:android-jsc:+”
}
5# Replace allprojects block in the top-level build.gradle with – allprojects {
repositories {
maven {
url “$rootDir/../node_modules/react-native/android”
}
maven {
url(“$rootDir/../node_modules/jsc-android/dist”)
}
}
}
6# Setup auto linking by adding – apply from: file(“../node_modules/@react-
native-community/cli-platform-android/native_modules.gradle”);
applyNativeModulesSettingsGradle(settings) to settings.gradle file
7# Add apply from: file(“../../node_modules/@react-native-community/cli-
platform-android/native_modules.gradle”);
applyNativeModulesAppBuildGradle(project) in app/build.gradle
8# Define activity – <activity
android:name=”com.facebook.react.devsupport.DevSettingsActivity” /> in
AndroidManifest file
9# Apply the usesCleartextTraffic option to application tag in your
AndroidManifest.xml
JS Code integration Steps
1. Create an index.js file in root of project folder – index.js is the starting point
for React Native applications, and it is always required. It can be a small file
that requires other files that are part of your React Native component or
application, or it can contain all the code that is needed for it. In our case,
we will put everything in index.js
2. Add to index.js file – import React from ‘react’;
import {
AppRegistry,
StyleSheet,
Text,
View
} from ‘react-native’;
class HelloWorld extends React.Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.hello}>Hello, World</Text>
</View>
);
}
}
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: ‘center’
},
hello: {
fontSize: 20,
textAlign: ‘center’,
margin: 10
}
});
AppRegistry.registerComponent(
‘MyReactNativeApp’,
() => HelloWorld
);
3. In order to start the React Native runtime and tell it to render our JS
componentCreate new Activity.java as normal and add also don’t forget to
import all dependencies & define this activity in manifest file — public class
MyReactActivity extends Activity implements
DefaultHardwareBackBtnHandler {
private ReactRootView mReactRootView;
private ReactInstanceManager mReactInstanceManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SoLoader.init(this, false);
mReactRootView = new ReactRootView(this);
List<ReactPackage> packages = new PackageList(getApplication()).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for
example:
// packages.add(new MyReactNativePackage());
// Remember to include them in `settings.gradle` and `app/build.gradle` too.
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setCurrentActivity(this)
.setBundleAssetName(“index.android.bundle”)
.setJSMainModulePath(“index”)
.addPackages(packages)
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
// The string here (e.g. “MyReactNativeApp”) has to match
// the string in AppRegistry.registerComponent() in index.js
mReactRootView.startReactApplication(mReactInstanceManager,
“MyReactNativeApp”, null);
setContentView(mReactRootView);
}
@Override
public void invokeDefaultOnBackPressed() {
super.onBackPressed();
}
}
4. Perform Sync with gradle
5. Add android:theme=”@style/Theme.AppCompat.Light.NoActionBar” to
newly create activity class
6. Pass in some lifecycle methods – @Override
protected void onPause() {
super.onPause();
if (mReactInstanceManager != null) {
mReactInstanceManager.onHostPause(this);
}
}
@Override
protected void onResume() {
super.onResume();
if (mReactInstanceManager != null) {
mReactInstanceManager.onHostResume(this, this);
}
}
@Override
protected void onDestroy() {
super.onDestroy();
if (mReactInstanceManager != null) {
mReactInstanceManager.onHostDestroy(this);
}
if (mReactRootView != null) {
mReactRootView.unmountReactApplication();
}
}
@Override
public void onBackPressed() {
if (mReactInstanceManager != null) {
mReactInstanceManager.onBackPressed();
} else {
super.onBackPressed();
}
}
7. Finally, we need to hook up the dev menu with. – @Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) {
mReactInstanceManager.showDevOptionsDialog();
return true;
}
return super.onKeyUp(keyCode, event);
}
8. All steps have covered for integration
9. Run the package manager with – npm start
10.Run your android app with – react-native run-android
Top 5 Reasons Why You Must Choose React Native For Your Next App!
Apart from its fast and efficient mobility solutions, React Native has much more to
offer. Take a look-
• Allows developers to create applications faster.
• The app’s performance is commendable.
• All of the required resources are easily available.
• Code can be shared across cross platforms.
• Developers can use native code.
In A Nutshell
This is the entire technical process to integrate Native Android App with React
Native. If you want to learn more about exciting development concepts then stay
tuned to this space.
React Native mobile app development is emerging out to be an exciting
opportunity for businesses. It not only offers pocket-friendly choices, but it also
reduces the development time. If you want to upheave your revenue funnel then
connect with our experienced professionals who can guide you in the right
direction.
So what are you waiting for? Connect with us today and learn more about
progressive opportunities in the app industry.
Contact Us
Address :- A-26, Lohia Rd, A Block, Sector 63,
Noida, Uttar Pradesh 201301
Mobile No. :- 096671 34400
Mail Id :- sales@techugo.com
Website :- https://www.techugo.com/
***Thankyou***

More Related Content

Similar to How To Integrate Native Android App With React Native. (20)

PPTX
Getting Started With React Native Presntation
Knoldus Inc.
 
PPTX
How to create components in react js
BOSC Tech Labs
 
PDF
Hacking the Codename One Source Code - Part IV - Transcript.pdf
ShaiAlmog1
 
PPTX
Build web apps with react js
dhanushkacnd
 
PDF
Simple React Todo List
Ritesh Chaudhari
 
PDF
Introduction to React for Frontend Developers
Sergio Nakamura
 
PPTX
React js programming concept
Tariqul islam
 
PDF
How React Native has changed Web and Mobile Application Development, Engineer...
engineermaste solution
 
PDF
React js t1 - introduction
Jainul Musani
 
KEY
Android Workshop
Junda Ong
 
PPTX
Modern web app with REACT
AndryRajohnson
 
PPTX
React django
Heber Silva
 
PDF
Full Stack React Workshop [CSSC x GDSC]
GDSC UofT Mississauga
 
PDF
React Native: Is It Worth It? UA Mobile 2017.
UA Mobile
 
PPTX
Nativescript with angular 2
Christoffer Noring
 
PDF
React Native
vishal kumar
 
PPTX
React Basic and Advance || React Basic
rafaqathussainc077
 
PPTX
Pluginkla2019 - React Presentation
Angela Lehru
 
PDF
Introduction to React JS
Bethmi Gunasekara
 
Getting Started With React Native Presntation
Knoldus Inc.
 
How to create components in react js
BOSC Tech Labs
 
Hacking the Codename One Source Code - Part IV - Transcript.pdf
ShaiAlmog1
 
Build web apps with react js
dhanushkacnd
 
Simple React Todo List
Ritesh Chaudhari
 
Introduction to React for Frontend Developers
Sergio Nakamura
 
React js programming concept
Tariqul islam
 
How React Native has changed Web and Mobile Application Development, Engineer...
engineermaste solution
 
React js t1 - introduction
Jainul Musani
 
Android Workshop
Junda Ong
 
Modern web app with REACT
AndryRajohnson
 
React django
Heber Silva
 
Full Stack React Workshop [CSSC x GDSC]
GDSC UofT Mississauga
 
React Native: Is It Worth It? UA Mobile 2017.
UA Mobile
 
Nativescript with angular 2
Christoffer Noring
 
React Native
vishal kumar
 
React Basic and Advance || React Basic
rafaqathussainc077
 
Pluginkla2019 - React Presentation
Angela Lehru
 
Introduction to React JS
Bethmi Gunasekara
 

More from Techugo (20)

PDF
Delivering Delights- How Java Technology is Reshaping Food Ordering in Dubai
Techugo
 
PDF
Elevating Your Laundry Routine- Selecting the Ideal Laundry App Development C...
Techugo
 
PDF
Empowering Financial Inclusion- How Dubai’s Fintech App Development Companies...
Techugo
 
PDF
Unveiling the Advantages and Core Elements of Cloud Native Architecture
Techugo
 
PDF
A Platter of Insights on Navigating IoT Trends
Techugo
 
PDF
Estimating the Price of a Fetchr-Inspired Delivery Application
Techugo
 
PDF
The Rise of Hyperlocal Delivery Platform- The Next Step in the Business Revol...
Techugo
 
PDF
Revolutionizing Laundry Services- The Power of a Laundry App Development Company
Techugo
 
PDF
Empowering Excellence- The Journey of a React Native App Development Company
Techugo
 
PDF
React Native App Development Company- Crafting Seamless and High-Performing S...
Techugo
 
PDF
Dating App Development Company- Revolutionizing Connections and Relationships
Techugo
 
PPTX
Mobile app development comapny Middle East.pptx
Techugo
 
PDF
The Amalgamation of AR in iPhone Apps Will Enhance the User Experience- Here’...
Techugo
 
PDF
Revolutionizing Healthcare with AI and ChatGPT- Elevating the Game.
Techugo
 
PDF
Shaping Tomorrow’s World With Mobile App Development.pdf
Techugo
 
PDF
Crafting Connections through Dating App Development.pdf
Techugo
 
PDF
Unleashing Digital Solutions Leading Mobile App Development Company in India.pdf
Techugo
 
PDF
Leading Mobile App Development Company in India- Empowering Digital Innovation
Techugo
 
PDF
Tech Savvy Solutions- Premier Mobile App Development Company in India
Techugo
 
PDF
Serving Convenience - Food Delivery App Development Company
Techugo
 
Delivering Delights- How Java Technology is Reshaping Food Ordering in Dubai
Techugo
 
Elevating Your Laundry Routine- Selecting the Ideal Laundry App Development C...
Techugo
 
Empowering Financial Inclusion- How Dubai’s Fintech App Development Companies...
Techugo
 
Unveiling the Advantages and Core Elements of Cloud Native Architecture
Techugo
 
A Platter of Insights on Navigating IoT Trends
Techugo
 
Estimating the Price of a Fetchr-Inspired Delivery Application
Techugo
 
The Rise of Hyperlocal Delivery Platform- The Next Step in the Business Revol...
Techugo
 
Revolutionizing Laundry Services- The Power of a Laundry App Development Company
Techugo
 
Empowering Excellence- The Journey of a React Native App Development Company
Techugo
 
React Native App Development Company- Crafting Seamless and High-Performing S...
Techugo
 
Dating App Development Company- Revolutionizing Connections and Relationships
Techugo
 
Mobile app development comapny Middle East.pptx
Techugo
 
The Amalgamation of AR in iPhone Apps Will Enhance the User Experience- Here’...
Techugo
 
Revolutionizing Healthcare with AI and ChatGPT- Elevating the Game.
Techugo
 
Shaping Tomorrow’s World With Mobile App Development.pdf
Techugo
 
Crafting Connections through Dating App Development.pdf
Techugo
 
Unleashing Digital Solutions Leading Mobile App Development Company in India.pdf
Techugo
 
Leading Mobile App Development Company in India- Empowering Digital Innovation
Techugo
 
Tech Savvy Solutions- Premier Mobile App Development Company in India
Techugo
 
Serving Convenience - Food Delivery App Development Company
Techugo
 
Ad

Recently uploaded (20)

PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
Q2 Leading a Tableau User Group - Onboarding
lward7
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Q2 Leading a Tableau User Group - Onboarding
lward7
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Ad

How To Integrate Native Android App With React Native.

  • 1. How To Integrate Native Android App With React Native? The popularity of React Native Technology cannot be contained. The growing inclination of the app industry towards this cross-platform technology has triggered the curiosity of many domains. Therefore, we need to learn more about related development concepts. So today, let us learn the way to integrate Native Android App with React Native! Checkout Steps For React Native Integration With Native Android App! If you are looking for an applicable solution to React Native integration with the android application, then we have an early Christmas gift for you. Here’s how you can do the same- 1# Environment setup- 1. Install node 2. Install watchman
  • 2. 3. Install JDK Java8 4. Install Android Studio 5. Download and install SDK from android studio 2# Setup Directory Structure- 1. Copy all existing android files to /android folder 2. Create package.json file – { “name”: “MyReactNativeApp”, “version”: “0.0.1”, “private”: true, “scripts”: { “start”: “yarn react-native start” } } 3# Open terminal in current directory & Install react native with – yarn add react- native, install yarn if not installed 4#. Add react native dependecies to app level build.gradle – dependencies { implementation “com.android.support:appcompat-v7:27.1.1” implementation “com.facebook.react:react-native:+” // From node_modules implementation “org.webkit:android-jsc:+” } 5# Replace allprojects block in the top-level build.gradle with – allprojects { repositories {
  • 3. maven { url “$rootDir/../node_modules/react-native/android” } maven { url(“$rootDir/../node_modules/jsc-android/dist”) } } } 6# Setup auto linking by adding – apply from: file(“../node_modules/@react- native-community/cli-platform-android/native_modules.gradle”); applyNativeModulesSettingsGradle(settings) to settings.gradle file 7# Add apply from: file(“../../node_modules/@react-native-community/cli- platform-android/native_modules.gradle”); applyNativeModulesAppBuildGradle(project) in app/build.gradle 8# Define activity – <activity android:name=”com.facebook.react.devsupport.DevSettingsActivity” /> in AndroidManifest file 9# Apply the usesCleartextTraffic option to application tag in your AndroidManifest.xml JS Code integration Steps 1. Create an index.js file in root of project folder – index.js is the starting point for React Native applications, and it is always required. It can be a small file that requires other files that are part of your React Native component or application, or it can contain all the code that is needed for it. In our case, we will put everything in index.js
  • 4. 2. Add to index.js file – import React from ‘react’; import { AppRegistry, StyleSheet, Text, View } from ‘react-native’; class HelloWorld extends React.Component { render() { return ( <View style={styles.container}> <Text style={styles.hello}>Hello, World</Text> </View> ); } } var styles = StyleSheet.create({ container: { flex: 1, justifyContent: ‘center’ }, hello: {
  • 5. fontSize: 20, textAlign: ‘center’, margin: 10 } }); AppRegistry.registerComponent( ‘MyReactNativeApp’, () => HelloWorld ); 3. In order to start the React Native runtime and tell it to render our JS componentCreate new Activity.java as normal and add also don’t forget to import all dependencies & define this activity in manifest file — public class MyReactActivity extends Activity implements DefaultHardwareBackBtnHandler { private ReactRootView mReactRootView; private ReactInstanceManager mReactInstanceManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); SoLoader.init(this, false); mReactRootView = new ReactRootView(this); List<ReactPackage> packages = new PackageList(getApplication()).getPackages();
  • 6. // Packages that cannot be autolinked yet can be added manually here, for example: // packages.add(new MyReactNativePackage()); // Remember to include them in `settings.gradle` and `app/build.gradle` too. mReactInstanceManager = ReactInstanceManager.builder() .setApplication(getApplication()) .setCurrentActivity(this) .setBundleAssetName(“index.android.bundle”) .setJSMainModulePath(“index”) .addPackages(packages) .setUseDeveloperSupport(BuildConfig.DEBUG) .setInitialLifecycleState(LifecycleState.RESUMED) .build(); // The string here (e.g. “MyReactNativeApp”) has to match // the string in AppRegistry.registerComponent() in index.js mReactRootView.startReactApplication(mReactInstanceManager, “MyReactNativeApp”, null); setContentView(mReactRootView); } @Override public void invokeDefaultOnBackPressed() { super.onBackPressed();
  • 7. } } 4. Perform Sync with gradle 5. Add android:theme=”@style/Theme.AppCompat.Light.NoActionBar” to newly create activity class 6. Pass in some lifecycle methods – @Override protected void onPause() { super.onPause(); if (mReactInstanceManager != null) { mReactInstanceManager.onHostPause(this); } } @Override protected void onResume() { super.onResume(); if (mReactInstanceManager != null) { mReactInstanceManager.onHostResume(this, this); } } @Override protected void onDestroy() { super.onDestroy();
  • 8. if (mReactInstanceManager != null) { mReactInstanceManager.onHostDestroy(this); } if (mReactRootView != null) { mReactRootView.unmountReactApplication(); } } @Override public void onBackPressed() { if (mReactInstanceManager != null) { mReactInstanceManager.onBackPressed(); } else { super.onBackPressed(); } } 7. Finally, we need to hook up the dev menu with. – @Override public boolean onKeyUp(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) { mReactInstanceManager.showDevOptionsDialog(); return true; } return super.onKeyUp(keyCode, event);
  • 9. } 8. All steps have covered for integration 9. Run the package manager with – npm start 10.Run your android app with – react-native run-android Top 5 Reasons Why You Must Choose React Native For Your Next App! Apart from its fast and efficient mobility solutions, React Native has much more to offer. Take a look- • Allows developers to create applications faster. • The app’s performance is commendable. • All of the required resources are easily available. • Code can be shared across cross platforms. • Developers can use native code. In A Nutshell This is the entire technical process to integrate Native Android App with React Native. If you want to learn more about exciting development concepts then stay tuned to this space. React Native mobile app development is emerging out to be an exciting opportunity for businesses. It not only offers pocket-friendly choices, but it also reduces the development time. If you want to upheave your revenue funnel then connect with our experienced professionals who can guide you in the right direction. So what are you waiting for? Connect with us today and learn more about progressive opportunities in the app industry.
  • 10. Contact Us Address :- A-26, Lohia Rd, A Block, Sector 63, Noida, Uttar Pradesh 201301 Mobile No. :- 096671 34400 Mail Id :- [email protected] Website :- https://www.techugo.com/ ***Thankyou***