Android sample app crashes when changing from portrait to landscape

  • 29 Views
  • Last Post 2 weeks ago
Joni Mikkola posted this 2 weeks ago

Hello, just short question; should the camera recognition also work on landscape mode in Android?

I've compiled the sample code and now have tested out the code in two devices and in both the sample crashes when device changes from portrait to landscape orientation.

I have included devices log below. Thanks!

08-04 12:01:15.504 4711 4711 D AndroidRuntime: Shutting down VM 08-04 12:01:15.505 4711 4711 E AndroidRuntime: FATAL EXCEPTION: main 08-04 12:01:15.505 4711 4711 E AndroidRuntime: Process: com.abbyy.rtr.sample.textcapture, PID: 4711 08-04 12:01:15.505 4711 4711 E AndroidRuntime: java.lang.RuntimeException: setParameters failed 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at android.hardware.Camera.native_setParameters(Native Method) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at android.hardware.Camera.setParameters(Camera.java:2013) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at com.abbyy.mobile.sample.MainActivity.setCameraFocusMode(MainActivity.java:398) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at com.abbyy.mobile.sample.MainActivity.configureCameraAndStartPreview(MainActivity.java:609) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at com.abbyy.mobile.sample.MainActivity.setCameraPreviewDisplayAndStartPreview(MainActivity.java:409) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at com.abbyy.mobile.sample.MainActivity.access$800(MainActivity.java:46) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at com.abbyy.mobile.sample.MainActivity$3.surfaceChanged(MainActivity.java:251) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at android.view.SurfaceView.updateWindow(SurfaceView.java:613) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:184) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2186) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1207) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6320) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:862) 08-04 12:01:15.505 4711 4711 E AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:674)

Oksana Serdyuk posted this 2 weeks ago

The code sample from the Free version of RTR SDK (which is available for downloading on the website rtrsdk.com) does not allow to change the device orientation. It has portrait orientation by default and cannot be changed to landscape. This possibility is not support in this sample. But we also have another sample for the Extended version of the product and this sample supports both orientations of the device. If you are interested in trying it, please contact our sales at http://rtrsdk.com/licensing/.

Close