From c8966280b1f6a76c7b23cfc19a2dbbf3738598f0 Mon Sep 17 00:00:00 2001 From: Fabrice Armisen Date: Sun, 24 Jan 2016 19:36:29 -0800 Subject: [PATCH] Adding Android instructions to get started --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 49d48d8..fcbd714 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,13 @@ Below is a list of known issues. Pull requests are welcome for any of these issu - Stills captured to disk will not be cleaned up and thus must be managed manually for now ## Getting started +### Mostly automatic install +1. `npm install rnpm --global` +2. `npm install react-native-camera@latest --save` +3. `rnpm link react-native-camera` +### Manual install +#### iOS 1. `npm install react-native-camera@latest --save` 2. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` 3. Go to `node_modules` ➜ `react-native-camera` and add `RCTCamera.xcodeproj` @@ -18,6 +24,28 @@ Below is a list of known issues. Pull requests are welcome for any of these issu 5. Click `RCTCamera.xcodeproj` in the project navigator and go the `Build Settings` tab. Make sure 'All' is toggled on (instead of 'Basic'). In the `Search Paths` section, look for `Header Search Paths` and make sure it contains both `$(SRCROOT)/../../react-native/React` and `$(SRCROOT)/../../../React` - mark both as `recursive`. 5. Run your project (`Cmd+R`) + +#### Android +1. `npm install react-native-camera@latest --save` +2. Modify the ReactInstanceManager.builder() calls chain in `android/app/main/java/.../MainActivity.java` to include: + + ``` + .addPackage(new RCTCameraPackage()) + ``` +3. Append the following lines to `android/settings.gradle`: + + ``` + include ':react-native-camera' + project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android') + ``` + +4. Insert the following lines inside the dependencies block in `android/app/build.gradle`: + + ``` + compile project(':react-native-camera') + ``` + + ## Usage All you need is to `require` the `react-native-camera` module and then use the