0

i am new to react native...... I had a developed android project and now i want to integrate it into React Native. how can i import or migrate or integrate it into React native? any help..........! i.e, if i run react-native run-android in command prompt my old Project have to be run. i have tried to import my entire project as a library even then it was running app folder only by default..... In Android folder instead of app folder my_Project have to be come......

1 Answer 1

3

React Native is great when you are starting a new mobile app from scratch. However, it also works well for adding a single view or user flow to existing native applications. With a few steps, you can add new React Native based features, screens, views, etc.

The keys to integrating React Native components into your Android application are to:

1.Understand what React Native components you want to integrate.

2.Install react-native in your Android application root directory to create node_modules/ directory.

3.Create your actual React Native components in JavaScript.

4.Add com.facebook.react:react-native:+ and a maven pointing to the react-native binaries in node_modules/ to your build.gradle file.

5.Create a custom React Native specific Activity that creates a ReactRootView.

6.Start the React Native server and run your native application.

7.Optionally add more React Native components.

8.Debug.

9.Prepare for deployment.

10.Deploy and Profit!

More Detail refereed this link http://facebook.github.io/react-native/releases/0.42/docs/integration-with-existing-apps.html#integration-with-existing-apps

Sign up to request clarification or add additional context in comments.

9 Comments

sorry, i already checked that link. but no use.... in your answer 2nd point discussed about Root Directory... F:\Ramaraju\workspace\MyOwnProject\app\src\main\java this is my project path(Existing android project not React Project), please tell me what is the root directory there?
F:\Ramaraju\workspace\MyOwnProject\ this your root directory
okay please be patience, i'll explain my steps. please let me know what wrong i did............ 1>open cmd cd to root directory... 2>npm install -g react-native-cli with the second step it won't create any node_module folder in my root project
then you i'll type in cmd "npm init <yourProjectName>"
ok, package.json was created done upto this from "facebook.github.io/react-native/releases/0.42/docs/…" reference. now prob with "index.android.js" file, i didn't find it in my root project. we have to create manually or it'll generate automatically?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.