Zxing vertical screen support

Asked 2 years ago, Updated 2 years ago, 140 views

We are creating an application that reads bar codes using zxing.
I have a question, but when the camera is started, the screen is horizontal from the vertical.

Is there a way to start on a vertical screen?

Development Environment Android Studio 1.3.1 zxing-android-embedded: 3.0.3
zxing:core:3.2.0

Thank you for your cooperation.

java android android-layout

2022-09-30 20:25

2 Answers

If you are using the Camera class, you can do it with setDisplayOrientation.

http://developer.android.com/reference/android/hardware/Camera.html#setDisplayOrientation(int)


2022-09-30 20:25

It's too late, but here's the answer.

For zxing-android-embedded, the only way to make it vertical was to create an empty activity that inherited CaptureActivity and specify orientation in manifest.

https://github.com/journeyapps/zxing-android-embedded#changing-the-orientation

I wanted to do a little more for my use, so I stopped using it and used another library that implements my own View.It was quite easy to use, so please consider it.

https://github.com/dm77/barcodescanner


2022-09-30 20:25

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.