I have already integrated zxing library in my application. Now i want that zxing camera will work on both mode landscape as well as on portrait mode. now it is working on one mode only. Can somebody help me out how to do this?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
I used compyutech's answer, but there were some things missing. So, I'm putting everything required, here.
1. CameraConfigurationManager : inside
initFromCameraParameters
method :also remove this code from same method :
2. CameraManager :
class variables
getFramingRect
method :getFramingRectInPreview
method :3. DecodeHandler :
inside
decode
method :4. AndroidManifest.xml :
remove orientation settings for
CaptureActivity
.Google this question.
I have used zxing zxing 2.3 and below solution worked for me.
1 In CameraConfigurationManager class, setDesiredCameraParameters Method add below code below pointed line
-> Camera.Parameters parameters = camera.getParameters();
2 In CameraManager class, getFramingRect Method replace code as below
3 In CameraManager class, getFramingRectInPreview Method replace code as below
4 In DecodeHandler class, decode Method add below code below pointed line
-> Result rawResult = null;
Please find my working code
http://www.compyutech.co.in/repo/zxing-dynamic.zip
Hope this will help you....