Skip to content

Commit

Permalink
Added Manual Installation Steps for Android (#23)
Browse files Browse the repository at this point in the history
* Added Manual Installation Steps for Android

Added descriptive manual linking process for android

* Update README.md

* Update README.md
  • Loading branch information
hkxicor authored and alvaromb committed Mar 16, 2018
1 parent 0fa9975 commit 1567d31
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,48 @@ Link

`$ react-native link`

#### Manual installation

**Android:**

1. In your android/settings.gradle file, make the following additions:
```java
include ':react-native-version-number'
project(':react-native-version-number').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-version-number/android')
```

2. In your android/app/build.gradle file, add the `:react-native-version-number` project as a compile-time dependency:

```java
...
dependencies {
...
compile project(':react-native-version-number')
}
```

3. Update the MainApplication.java file to use `react-native-version-number` via the following changes:

```java
import com.apsl.versionnumber.RNVersionNumberPackage;

public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNVersionNumberPackage(), // here
);
}
};
...
}
```


## Usage
```javascript
import VersionNumber from 'react-native-version-number';
Expand Down

0 comments on commit 1567d31

Please sign in to comment.