Hi, We write an app to use camera's SurfaceView . We can use it on our phone . When we use it on UDOO dual , it always break . And it shows "program no response". We guess the problem is that we have no permission to use camera. When we use the SurfaceView , the program run to "Start.View()" . It beaks . Is there have other way to deal this solution ?
Have you tried running the debugger on it whilst running your app. on the Udoo? What is the output of logcat?
Try with the new version of Android 4.3 we released two days ago. We fixed lots of bugs and now it works great: http://www.udoo.org/android-4-3-available-on-udoo/
Code: 05-30 14:47:09.844: D/CameraCaptureActivity(797): getCameraInstance()Camera:: null 05-30 14:47:09.855: D/CameraCaptureActivity(797): getCameraInstance()open:: null 05-30 14:47:09.855: D/CameraCaptureActivity(797): mCamera:: null 05-30 14:47:09.895: D/CameraCaptureActivity(797): mCamera :: null 05-30 14:47:09.895: D/CameraCaptureActivity(797): mSurfaceHolder :: android.view.SurfaceView$4@40d06ef8 05-30 14:47:09.924: D/CameraCaptureActivity(797): mCameraPreview :: com.example.demo.CameraPreview{40d06860 V.E..... ......I. 0,0-0,0} 05-30 14:47:09.924: D/CameraCaptureActivity(797): FrameLayout :: android.widget.FrameLayout{40cfa7d8 V.E..... ......I. 0,0-0,0 #7f080000 app:id/camera_preview} 05-30 14:47:09.954: D/CameraCaptureActivity(797): captureButton :: android.widget.Button{40cfad50 VFED..C. ......I. 0,0-0,0 #7f080001 app:id/button_capture} 05-30 14:47:04.327: D/AndroidRuntime(797): Shutting down VM 05-30 14:47:04.327: W/dalvikvm(797): threadid=1: thread exiting with uncaught exception (group=0x40a71930) 05-30 14:47:04.458: E/AndroidRuntime(797): FATAL EXCEPTION: main 05-30 14:47:04.458: E/AndroidRuntime(797): java.lang.NullPointerException 05-30 14:47:04.458: E/AndroidRuntime(797): at com.example.demo.CameraPreview.surfaceCreated(CameraPreview.java:33) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.view.SurfaceView.updateWindow(SurfaceView.java:569) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.view.SurfaceView.access$000(SurfaceView.java:86) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:174) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:680) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1842) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.view.Choreographer.doCallbacks(Choreographer.java:562) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.view.Choreographer.doFrame(Choreographer.java:532) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.os.Handler.handleCallback(Handler.java:725) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.os.Handler.dispatchMessage(Handler.java:92) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.os.Looper.loop(Looper.java:137) 05-30 14:47:04.458: E/AndroidRuntime(797): at android.app.ActivityThread.main(ActivityThread.java:5041) 05-30 14:47:04.458: E/AndroidRuntime(797): at java.lang.reflect.Method.invokeNative(Native Method) 05-30 14:47:04.458: E/AndroidRuntime(797): at java.lang.reflect.Method.invoke(Method.java:511) 05-30 14:47:04.458: E/AndroidRuntime(797): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 05-30 14:47:04.458: E/AndroidRuntime(797): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 05-30 14:47:04.458: E/AndroidRuntime(797): at dalvik.system.NativeStart.main(Native Method) we find the problem is Camera can't catch
Is just an hypothesis but remember UDOO have only one camera not two as standard smartphones. These cameras are classified as front-camera and back-camera. It will be possible SurfaceView need to use, for example, front-camera and android UDOO have back-camera only or something similar? The "official" android app detect and show the camera correctly this mean the device is working...
Sorry, no example, I just tried to hypotize. In your case the official android camera app is workign as expected?
https://play.google.com/store/apps/deta ... e&hl=zh_TW I install this apk can catch the camera information