Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Snapshot is taken before security dialog is displayed in S60 MIDlet (Known Issue)

From Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Nokia 5800 XpressMusic
Created: User:Technical writer 1 (December 29, 2006; Updated September 8, 2009)
Last edited: hamishwillee (22 Oct 2013)


In S60 Editions, because taking the snapshot would be delayed if such a security dialog were displayed before the snapshot is really taken, the S60 implementation takes the picture first and also plays the shutter sound before the confirmation is asked from the user.

According to the MIDP security domain policy recommendation, access to certain APIs is restricted for unsigned MIDlets (as well as MIDlets signed to trusted 3rd party domain). This applies also to multimedia recording APIs including taking a snapshot. For unsigned MIDlets, by default, a confirmation is asked every time these APIs are accessed. For trusted 3rd-party MIDlets the default is to ask once per session.

If the user does not allow the snapshot to be taken (answers "no" to the confirmation dialog), the SecurityException is correctly thrown.

In S60 5th Edition, the delay for the security prompt to appear can be up to 10+ seconds after the image has been taken. In addition, in some cases image capturing does not succeed until the MIDlet is closed and restarted and the capture is attempted again.

How to reproduce

This issue can be tested by using this code snippet:
Taking a picture in Java ME


Currently no workaround exists.

This page was last modified on 22 October 2013, at 06:44.
20 page views in the last 30 days.