# react-native-imagepicker-android

> React Native Image Picker For Android

Latest version **1.1.4** (published 2019-01-11) · GPLv2 license · 0 weekly downloads

## Install

```sh
npm install react-native-imagepicker-android
pnpm add react-native-imagepicker-android
yarn add react-native-imagepicker-android
bun add react-native-imagepicker-android
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2019-01-11 |
| First published | 2019-01-11 |
| Weekly downloads | 0 |
| License | GPLv2 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Saeed Ghanbari |
| Maintainers | sgh370 |
| Keywords | react-native |

## Links

- npm: https://www.npmjs.com/package/react-native-imagepicker-android
- npm.io page: https://npm.io/package/react-native-imagepicker-android

## Recent versions

- 1.1.4 (latest) — 2019-01-11
- 1.1.3 — 2019-01-11
- 1.1.2 — 2019-01-11
- 1.1.0 — 2019-01-11
- 1.0.1 — 2019-01-11
- 1.0.0 — 2019-01-11

## README

# react-native-imagepicker-android

## Getting started

`$ npm install react-native-imagepicker-android --save`

### Mostly automatic installation

`$ react-native link react-native-imagepicker-android`

### Manual installation


#### Android

1. Open up `android/app/src/main/java/[...]/MainApplication.java`
  - Add `import com.sgh370.reactnative.RNImagepickerAndroidPackage;` to the imports at the top of the file
  - Add `new RNImagepickerAndroidPackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
  	```
  	include ':react-native-imagepicker-android'
  	project(':react-native-imagepicker-android').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-imagepicker-android/android')
  	```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
  	```
      compile project(':react-native-imagepicker-android')
  	```


## Usage
```javascript

import React, {PureComponent} from 'react';
import {StyleSheet, Button, View, Image} from 'react-native';

import RNImagepickerAndroid from 'react-native-imagepicker-android';

export default class App extends PureComponent {
    
    state = {
        imageUri: null
    }

    pickImage = async () => {
        const imageSource = await RNImagepickerAndroid.pickImage();
        this.setState({
            imageUri: imageSource
        })
    }

    render() {
        return (
          <View style={styles.container}>
            <Button title="Pick Image From Gallery" onPress={this.pickImage} />
            <Image source={{uri: this.state.imageUri}} width={100} height={100} />
          </View>
        );
    }

}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  }
});
```

---
_Source: https://npm.io/package/react-native-imagepicker-android · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
