react-native-camera2-gjcamera
This project is Created in order to understand the working of android.hardware.camera2 package. It is in react-native language. It has a default Image Preview and Image Quality of 1600X1200. It is supposed to take a picture and show it's storage path to t
Last updated 8 months ago by gaurjo .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install react-native-camera2-gjcamera 
SYNC missed versions from official npm registry.

react-native-camera2-gjcamera

This project is Created in order to understand the working of android.hardware.camera2 package. It is in react-native language. It has a default Image Preview and Image Quality of 1600X1200. It is supposed to take a picture and show it's storage path to the user.

In order to take multiple pictures put the condition in the returnHome function as per your need.

Installation

npm install --save react-native-camera2-gjcamera

in Native:-

  1. AndroidMainfest.xml
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.hardware.camera2.full" />
...
<application
...
<activity android:name="com.gjcamera.GJCamera"/>
/>
  1. settings.gradle:-
include ':react-native-camera2-gjcamera'
project(':react-native-camera2-gjcamera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera2-gjcamera/android')
  1. build.gradle(Module: app):-
implementation project(':react-native-camera2-gjcamera')
  1. MainApplication.java:-
import com.gjcamera.GJCameraPackage;
...
return Arrays.asList(
...
new GJCameraPackage()
);

Images

  1. 2. 3.
1.Before Click
2.Image Clicked 
3.After Clicked

Usage

in React:-

import GJ from 'react-native-camera2-gjcamera'

...

this.state = {
...
imgPATH: "LOL"
};
...
OpenMyCamer = async () => {
const result = await GJ.OpenMyCamera();
this.setState({ imgPATH: result.imgPath });
}
...
render(){
return(
...
<TouchableOpacity onPress={() => this.OpenMyCamer()}>
<Text>Open Camera</Text>
</TouchableOpacity>
<Text style={styles.signInText}>{this.state.imgPATH}</Text>
...
);
}

Hope you will like it.

Licence

The MIT License (MIT)

Copyright (c) 2015 Howard Yang

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current Tags

  • 1.0.3                                ...           latest (8 months ago)

3 Versions

  • 1.0.3                                ...           8 months ago
  • 1.0.2                                ...           8 months ago
  • 1.0.1                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 4
Last Month 0
Dependencies (1)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |