1

When i try to run opencv(2.4.2) sample3 on android 4.1.1(galaxy nexus). i'm getting RuntimeException. Logcat points here: (android.hardware.Camera) mCamera.startPreview();

If i run same sample on android 2.3.6(htc hd2) there is no problem and it works. Is there any idea how can i fix this problem? I search it and people generally say "it's not working on android 4.1.1" but i'm just wondering is there anyone who works it on android 4.1.1.

mavixce
  • 338
  • 3
  • 15

1 Answers1

0

Actually it's not about opencv. Some devices need a SurfaceView to turn on the camera. For more details check this answer.

Community
  • 1
  • 1
mavixce
  • 338
  • 3
  • 15
  • well, thanks for the answer, I think I got exactly the same problem with you after I upgrade my phone to 4.3. would you kindly tell me more specifically what's going on and how to fix this? I am new to android things and works with jni mostly. Thanks again. – flankechen Oct 15 '13 at 08:36
  • After I asked this question long time passed so i don't remember very well but i guess if you turn on camera on your application check what layout you're using for camera view? It should be SurfaceView as i wrote before – mavixce Oct 21 '13 at 12:55