0

I want to scan Barcode/QR-Code in my app.

I used Zxing library to achieve this,

implementation 'com.journeyapps:zxing-android-embedded:3.6.0' 

I have no issue on scanning and getting value.

But I don't want the separate page for scanning. I want the scanning part within the layout itself like in an image

enter image description here

Is it possible to achieve this using Surface-view like we use it for in built app camera.

Please help me to achieve this. Thanks

Arnold Brown
  • 1,330
  • 13
  • 28

1 Answers1

2

Hi I have a sample project that I have created for scan barcode/QR codes.

I used com.google.android.gms:play-services:11.0.2 for my Scanning project. And I have used Surface-view to place the camera.

Use this link

Thanks.!

Anupa Dayaratne
  • 358
  • 1
  • 8
  • I have two screens, if scan is successful on first Screen then the Second Activity will open, here how to initiate SurfaceView? It looks black screen! – Arnold Brown Oct 02 '18 at 06:14
  • Hi, In the above project I have initiated a `SurfaceView`. Please refer to above project > MainActivity > line number 134 & 144. If you need more help please ask me. "It looks black screen" - is it from the above shared project or is it from your implementation? – Anupa Dayaratne Oct 02 '18 at 09:25