0

I am implementing camera application using then example comes with blackberry plugin for eclipse named "CameraDemo" the problem is that when the screen loses focus It does not display the camera view istead of it shows like this
after opening menu before opening menu


has anybody faced such problem whats the solution?

Dhruv
  • 1,129
  • 2
  • 13
  • 32

1 Answers1

2

This way of taking picture (using the Player and VideoControl.getSnapshot()) does not work nice on all BB models. I'd even say it works nice only on a narrow set of BB models. So if you are going to use your app on a wide range of BB models, then this is not the right way to go.

Instead to take a picture use a built-in Camera app. Here is a starting point on how to do that.

Basically you invoke the built-in Camera app and listen for the file-system changes to detect a new image file path. Then you need to close the built-in Camera app somehow - it's possible to do that by simulating two 'Esc' button presses.

Yes, this sounds a bit hacky/over-complicated, but that's how BB engeneers arranged that for us. :) BTW, this is actually not so bad if compare with Android where different device manufactorers violate the common rules and implement the Camera app in their specific way so you are not able to write the code once covering all Androids.

Community
  • 1
  • 1
Vit Khudenko
  • 28,288
  • 10
  • 63
  • 91
  • Thanks for the link Arhimed. Can you provide information about on the devices this method works? or a link may work for me.I am currently trying to make some workaround when the screen loses focus. – Dhruv Jul 04 '11 at 04:17
  • 1
    @TechnodHr: Sorry, I have not tracked the list of devices. I remebmer this worked OK on Bold 4.6.0, but failed on Storm 4.7.0. Then it also failed on another couple devices so we decided to not use this way at all because of an unpredictable behaviour on future devices. – Vit Khudenko Jul 04 '11 at 08:02