Skip to content

Commit ac808cf

Browse files
committed
Modified Readme and minor changes
1 parent 0e833c6 commit ac808cf

File tree

2 files changed

+189
-12
lines changed

2 files changed

+189
-12
lines changed

QR-ReaderExample/qRReaderExample/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<uses-sdk
88
android:minSdkVersion="8"
9-
android:targetSdkVersion="17" />
9+
android:targetSdkVersion="21" />
1010

1111
<uses-permission android:name="android.permission.CAMERA"/>
1212

README.md

Lines changed: 188 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,190 @@
1+
QRCodeReaderView [ ![Download](https://api.bintray.com/packages/dlazaro66/maven/QRCodeReaderView/images/download.svg) ](https://bintray.com/dlazaro66/maven/QRCodeReaderView/_latestVersion)
2+
====
3+
4+
#### Modification of ZXING Barcode Scanner project for easy Android QR-Code detection in portrait mode and AR purposes. ####
5+
6+
This project implements an Android view which show camera and notify when there's a QR code inside the preview.
7+
8+
Some Classes of camera controls and autofocus are taken and slightly modified from Barcode Scanner Android App.
9+
10+
You can also use this for Augmented Reality purposes, as you get QR control points coordinates when decoding.
11+
12+
Usage
13+
-----
14+
15+
How to use:
16+
17+
- Create an Activity which implements onQRCodeReadListener, and let implements required methods
18+
- Make sure Activity orientation is PORTRAIT and give Camera permision in the manifest.xml
19+
- Add a "QRCodeReaderView" in the layout editor like you actually do with a button for example
20+
21+
```xml
22+
23+
<com.dlazaro66.qrcodereaderview.QRCodeReaderView
24+
android:id="@+id/qrdecoderview"
25+
android:layout_width="match_parent"
26+
android:layout_height="match_parent" />
27+
28+
```
29+
30+
31+
- In your onCreate method, you can find the view as usual, using findViewById() function.
32+
- Set onQRCodeReadListener to the QRCodeReaderView.
33+
- Start & Stop camera preview in onPause() and onResume() overriden methods.
34+
- Use onQRCodeReadListener callbacks as you want.
35+
- You can place widgets or views over QRDecoderView
36+
37+
```java
38+
public class DecoderActivity extends Activity implements OnQRCodeReadListener {
39+
40+
private TextView myTextView;
41+
private QRCodeReaderView mydecoderview;
42+
43+
@Override
44+
protected void onCreate(Bundle savedInstanceState) {
45+
super.onCreate(savedInstanceState);
46+
setContentView(R.layout.activity_decoder);
47+
48+
mydecoderview = (QRCodeReaderView) findViewById(R.id.qrdecoderview);
49+
mydecoderview.setOnQRCodeReadListener(this);
50+
51+
myTextView = (TextView) findViewById(R.id.exampleTextView);
52+
}
53+
54+
55+
// Called when a QR is decoded
56+
// "text" : the text encoded in QR
57+
// "points" : points where QR control points are placed
58+
@Override
59+
public void onQRCodeRead(String text, PointF[] points) {
60+
myTextView.setText(text);
61+
}
62+
63+
64+
// Called when your device have no camera
65+
@Override
66+
public void cameraNotFound() {
67+
68+
}
69+
70+
// Called when there's no QR codes in the camera preview image
71+
@Override
72+
public void QRCodeNotFoundOnCamImage() {
73+
74+
}
75+
76+
@Override
77+
protected void onResume() {
78+
super.onResume();
79+
mydecoderview.getCameraManager().startPreview();
80+
}
81+
82+
@Override
83+
protected void onPause() {
84+
super.onPause();
85+
mydecoderview.getCameraManager().stopPreview();
86+
}
87+
}
88+
```
89+
90+
91+
Add it to your project
92+
----------------------
93+
94+
95+
Add QRCodeReaderView dependency to your build.gradle
96+
97+
```groovy
98+
99+
dependencies{
100+
compile 'com.dlazaro66.qrcodereaderview:qrcodereaderview:1.0.0'
101+
}
102+
103+
```
104+
105+
Do you want to contribute?
106+
--------------------------
107+
108+
Please send a PR or open an issue with your comments!
109+
110+
Libraries used in this project
111+
------------------------------
112+
113+
* [ZXING] [1]
114+
115+
Screenshots
116+
-----------
117+
118+
![Image](../master/readme_images/app_example.png?raw=true)
119+
120+
121+
Developed By
122+
------------
123+
124+
* David Lázaro Esparcia - <[email protected]>
125+
126+
<a href="https://twitter.com/_dlazaro">
127+
<img alt="Follow me on Twitter" src="http://imageshack.us/a/img812/3923/smallth.png" />
128+
</a>
129+
<a href="https://www.linkedin.com/pub/david-l%C3%A1zaro-esparcia/">
130+
<img alt="Add me to Linkedin" src="http://imageshack.us/a/img41/7877/smallld.png" />
131+
</a>
132+
133+
134+
Who's using it
135+
--------------
136+
137+
*Does your app use QRCodeReaderView? If you want to be featured on this list drop me a line.*
138+
139+
Contributors
140+
------------
141+
* [David Lázaro Esparcia][2]
142+
* [Daniel Comas Fernández][3]
143+
144+
License
145+
-------
146+
147+
Copyright 2013 David Lázaro
148+
149+
Licensed under the Apache License, Version 2.0 (the "License");
150+
you may not use this file except in compliance with the License.
151+
You may obtain a copy of the License at
152+
153+
http://www.apache.org/licenses/LICENSE-2.0
154+
155+
Unless required by applicable law or agreed to in writing, software
156+
distributed under the License is distributed on an "AS IS" BASIS,
157+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
158+
See the License for the specific language governing permissions and
159+
limitations under the License.
160+
161+
162+
[1]: https://github.com/zxing/zxing/
163+
[1]: https://github.com/dlazaro66
164+
[1]: https://github.com/danicomas
165+
166+
167+
168+
169+
170+
171+
172+
173+
174+
175+
176+
177+
178+
179+
180+
181+
182+
183+
184+
185+
186+
187+
1188
QRCodeReaderView
2189
================
3190

@@ -14,30 +201,20 @@ You can also use this for Augmented Reality purposes, as you get QR control poin
14201

15202
Original work and code can be found here: https://code.google.com/p/zxing/
16203

17-
---
18-
From now, this project is licensed under the Apache License v2.0, the same as original project. It is not a copyleft license like the GPL; it is relatively generous about what you can do with the code.
19204

20205
---
21206
How to use:
22207

23208
- Add library to your project.
24-
- Check your App uses it as library (properties->Android->Library->Add...)
25209
- Create an Activity which implements onQRCodeReadListener, and let implements required methods
26210
- Make sure Activity orientation is PORTRAIT and give Camera permision in the manifest.xml
27-
- Drag&Drop a "QRCodeReaderView" in the layout editor from "Custom & library views" like you actually do with a button for example
28-
29-
![Image](../master/readme_images/add_view.png?raw=true)
30-
211+
- Add a "QRCodeReaderView" in the layout editor like you actually do with a button for example
31212
- In your onCreate method, you can find the view as usual, using findViewById() function.
32213
- Set onQRCodeReadListener to the QRCodeReaderView.
33214
- Start & Stop camera preview in onPause() and onResume() overriden methods.
34215
- Use onQRCodeReadListener callbacks as you want.
35216
- You can place averlay widgets or views over QRDecoderView
36217

37-
![Image](../master/readme_images/add_overlay.png?raw=true)
38-
39-
##### Example included in this repository: #####
40-
41218
```java
42219
public class DecoderActivity extends Activity implements OnQRCodeReadListener {
43220

0 commit comments

Comments
 (0)