views:

84

answers:

1

Hello, we are using the native BlackBerry camera in our app, using the Invoke class to start the camera. We listen for an image being written to the filesystem, and when the user is finished with the camera, we call

Application.getApplication().requestForeground();

inside fileJournalChanged() to get back to our app.

This caused a problem with the camera lingering on the image taking on some devices, some of the time. If you want gory details you can see my post on the BB forums from a while back.

http://supportforums.blackberry.com/t5/Java-Development/restore-invoked-camera-after-deleting-an-image-from-the/m-p/511332

Suffice to say, I am still trying to fix this. Using EventInjector to inject an ESC key press works, however in this question

http://stackoverflow.com/questions/1907053/getting-event-injector-permission

it is described as a security threat. However this is widely suggested as the way to close the camera and work around other issues. Has anyone had problems using this method to close the camera or to do anything else? Is there a better "best practices" method for closing the camera, as there apparently is in Android (I don't actually know, a senior developer here mentioned it)?

By "problems" I guess I really mean business rules types of problems... app getting blacklisted by an organization, slammed in the app store, etc?

Thanks in advance, this has been troubling me for a while.

+1  A: 

I think the biggest problem you'll face is that using event injection requires special application permissions - ApplicationPermissions.PERMISSION_INPUT_SIMULATION to be exact. Since granting an application this permission basically allows it to simulate input events into ANY application at any time, it is considered quite dangerous because a badly-written or intentionally malicious application could do a lot of damage. Therefore many end-users and business do not allow applications that require this permission.

Marc Novakowski
We're still not sure how we're going to resolve this, but this is confirmation I was looking for. Thanks.
spacemanaki