SlideShare a Scribd company logo
1 of 10
Download to read offline
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.

How to create components in react js
How to create components in react jsHow to create components in react js
How to create components in react jsBOSC Tech Labs
 
Hacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdfHacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdfShaiAlmog1
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react jsdhanushkacnd
 
Introduction to React for Frontend Developers
Introduction to React for Frontend DevelopersIntroduction to React for Frontend Developers
Introduction to React for Frontend DevelopersSergio Nakamura
 
React js programming concept
React js programming conceptReact js programming concept
React js programming conceptTariqul islam
 
How React Native has changed Web and Mobile Application Development, Engineer...
How React Native has changed Web and Mobile Application Development, Engineer...How React Native has changed Web and Mobile Application Development, Engineer...
How React Native has changed Web and Mobile Application Development, Engineer...engineermaste solution
 
React js t1 - introduction
React js   t1 - introductionReact js   t1 - introduction
React js t1 - introductionJainul Musani
 
Android Workshop
Android WorkshopAndroid Workshop
Android WorkshopJunda Ong
 
Modern web app with REACT
Modern web app with REACTModern web app with REACT
Modern web app with REACTAndryRajohnson
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]GDSC UofT Mississauga
 
React Native: Is It Worth It? UA Mobile 2017.
React Native: Is It Worth It? UA Mobile 2017.React Native: Is It Worth It? UA Mobile 2017.
React Native: Is It Worth It? UA Mobile 2017.UA Mobile
 
React Basic and Advance || React Basic
React Basic and Advance   || React BasicReact Basic and Advance   || React Basic
React Basic and Advance || React Basicrafaqathussainc077
 
Pluginkla2019 - React Presentation
Pluginkla2019 - React PresentationPluginkla2019 - React Presentation
Pluginkla2019 - React PresentationAngela Lehru
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxkarthikaparthasarath
 

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

How to create components in react js
How to create components in react jsHow to create components in react js
How to create components in react js
 
Hacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdfHacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdf
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react js
 
Simple React Todo List
Simple React Todo ListSimple React Todo List
Simple React Todo List
 
Introduction to React for Frontend Developers
Introduction to React for Frontend DevelopersIntroduction to React for Frontend Developers
Introduction to React for Frontend Developers
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
How React Native has changed Web and Mobile Application Development, Engineer...
How React Native has changed Web and Mobile Application Development, Engineer...How React Native has changed Web and Mobile Application Development, Engineer...
How React Native has changed Web and Mobile Application Development, Engineer...
 
React js t1 - introduction
React js   t1 - introductionReact js   t1 - introduction
React js t1 - introduction
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Modern web app with REACT
Modern web app with REACTModern web app with REACT
Modern web app with REACT
 
React django
React djangoReact django
React django
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
React Native: Is It Worth It? UA Mobile 2017.
React Native: Is It Worth It? UA Mobile 2017.React Native: Is It Worth It? UA Mobile 2017.
React Native: Is It Worth It? UA Mobile 2017.
 
Nativescript with angular 2
Nativescript with angular 2Nativescript with angular 2
Nativescript with angular 2
 
React Native
React Native React Native
React Native
 
React Basic and Advance || React Basic
React Basic and Advance   || React BasicReact Basic and Advance   || React Basic
React Basic and Advance || React Basic
 
Pluginkla2019 - React Presentation
Pluginkla2019 - React PresentationPluginkla2019 - React Presentation
Pluginkla2019 - React Presentation
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docx
 

More from Techugo

Delivering Delights- How Java Technology is Reshaping Food Ordering in Dubai
Delivering Delights- How Java Technology is Reshaping Food Ordering in DubaiDelivering Delights- How Java Technology is Reshaping Food Ordering in Dubai
Delivering Delights- How Java Technology is Reshaping Food Ordering in DubaiTechugo
 
Elevating Your Laundry Routine- Selecting the Ideal Laundry App Development C...
Elevating Your Laundry Routine- Selecting the Ideal Laundry App Development C...Elevating Your Laundry Routine- Selecting the Ideal Laundry App Development C...
Elevating Your Laundry Routine- Selecting the Ideal Laundry App Development C...Techugo
 
Empowering Financial Inclusion- How Dubai’s Fintech App Development Companies...
Empowering Financial Inclusion- How Dubai’s Fintech App Development Companies...Empowering Financial Inclusion- How Dubai’s Fintech App Development Companies...
Empowering Financial Inclusion- How Dubai’s Fintech App Development Companies...Techugo
 
Unveiling the Advantages and Core Elements of Cloud Native Architecture
Unveiling the Advantages and Core Elements of Cloud Native ArchitectureUnveiling the Advantages and Core Elements of Cloud Native Architecture
Unveiling the Advantages and Core Elements of Cloud Native ArchitectureTechugo
 
A Platter of Insights on Navigating IoT Trends
A Platter of Insights on Navigating IoT TrendsA Platter of Insights on Navigating IoT Trends
A Platter of Insights on Navigating IoT TrendsTechugo
 
Estimating the Price of a Fetchr-Inspired Delivery Application
Estimating the Price of a Fetchr-Inspired Delivery ApplicationEstimating the Price of a Fetchr-Inspired Delivery Application
Estimating the Price of a Fetchr-Inspired Delivery ApplicationTechugo
 
The Rise of Hyperlocal Delivery Platform- The Next Step in the Business Revol...
The Rise of Hyperlocal Delivery Platform- The Next Step in the Business Revol...The Rise of Hyperlocal Delivery Platform- The Next Step in the Business Revol...
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
Revolutionizing Laundry Services- The Power of a Laundry App Development CompanyRevolutionizing Laundry Services- The Power of a Laundry App Development Company
Revolutionizing Laundry Services- The Power of a Laundry App Development CompanyTechugo
 
Empowering Excellence- The Journey of a React Native App Development Company
Empowering Excellence- The Journey of a React Native App Development CompanyEmpowering Excellence- The Journey of a React Native App Development Company
Empowering Excellence- The Journey of a React Native App Development CompanyTechugo
 
React Native App Development Company- Crafting Seamless and High-Performing S...
React Native App Development Company- Crafting Seamless and High-Performing S...React Native App Development Company- Crafting Seamless and High-Performing S...
React Native App Development Company- Crafting Seamless and High-Performing S...Techugo
 
Dating App Development Company- Revolutionizing Connections and Relationships
Dating App Development Company-  Revolutionizing Connections and RelationshipsDating App Development Company-  Revolutionizing Connections and Relationships
Dating App Development Company- Revolutionizing Connections and RelationshipsTechugo
 
Mobile app development comapny Middle East.pptx
Mobile app development comapny Middle East.pptxMobile app development comapny Middle East.pptx
Mobile app development comapny Middle East.pptxTechugo
 
The Amalgamation of AR in iPhone Apps Will Enhance the User Experience- Here’...
The Amalgamation of AR in iPhone Apps Will Enhance the User Experience- Here’...The Amalgamation of AR in iPhone Apps Will Enhance the User Experience- Here’...
The Amalgamation of AR in iPhone Apps Will Enhance the User Experience- Here’...Techugo
 
Revolutionizing Healthcare with AI and ChatGPT- Elevating the Game.
Revolutionizing Healthcare with AI and ChatGPT- Elevating the Game.Revolutionizing Healthcare with AI and ChatGPT- Elevating the Game.
Revolutionizing Healthcare with AI and ChatGPT- Elevating the Game.Techugo
 
Shaping Tomorrow’s World With Mobile App Development.pdf
Shaping Tomorrow’s World With Mobile App Development.pdfShaping Tomorrow’s World With Mobile App Development.pdf
Shaping Tomorrow’s World With Mobile App Development.pdfTechugo
 
Crafting Connections through Dating App Development.pdf
Crafting Connections through Dating App Development.pdfCrafting Connections through Dating App Development.pdf
Crafting Connections through Dating App Development.pdfTechugo
 
Unleashing Digital Solutions Leading Mobile App Development Company in India.pdf
Unleashing Digital Solutions Leading Mobile App Development Company in India.pdfUnleashing Digital Solutions Leading Mobile App Development Company in India.pdf
Unleashing Digital Solutions Leading Mobile App Development Company in India.pdfTechugo
 
Leading Mobile App Development Company in India- Empowering Digital Innovation
Leading Mobile App Development Company in India- Empowering Digital InnovationLeading Mobile App Development Company in India- Empowering Digital Innovation
Leading Mobile App Development Company in India- Empowering Digital InnovationTechugo
 
Tech Savvy Solutions- Premier Mobile App Development Company in India
Tech Savvy Solutions- Premier Mobile App Development Company in IndiaTech Savvy Solutions- Premier Mobile App Development Company in India
Tech Savvy Solutions- Premier Mobile App Development Company in IndiaTechugo
 
Serving Convenience - Food Delivery App Development Company
Serving Convenience - Food Delivery App Development CompanyServing Convenience - Food Delivery App Development Company
Serving Convenience - Food Delivery App Development CompanyTechugo
 

More from Techugo (20)

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

Recently uploaded

Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 

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 :- sales@techugo.com Website :- https://www.techugo.com/ ***Thankyou***