mirror of
https://github.com/expo/react-native-image-picker-android.git
synced 2026-11-21 07:59:25 -10:00
master
What is it?
It's an Android counterpart to the
UIImagePicker native module for iOS.
Thanks marcshilling and everyone else that contributed for that one!
How can I try it?
This project can be run out of the box to try out the image picker. Get
react-native-cli if you don't have it already with npm install -g react-native-cli. Run react-native run-android from the root directory of
this project with a device attached or an Android simulator running. Make sure
you don't have other react packagers fighting for ports.
How can I use it in my own projects?
Follow these steps to integrate with your own project. Each step links to a commit detailing what to do. The commits have comments explaining the purpose of each change.
- Add
ActivityResultListener.java,ImagePickerModule.javaandImagePickerPackage.javato the Java code for your react-native application. This commit does that for this project. - Add code to your
MainActivityto registerImagePickerPackageand notify it of Activity results. Here's a commit showing how. - Use it in your JavaScript code. The API right now just supports
.launchCamera(...)and.launchImageLibrary(...)and doesn't support any of the extra options. This commit shows how it was done in our example.
Description
A camera and gallery image picker native module for Android, giving a subset of the API of https://github.com/marcshilling/react-native-image-picker
122 KiB
0 Stars
1 Watchers
0 Forks
Languages
Java
48.1%
Objective-C
31%
JavaScript
20.9%