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.

How to get full filename of the snapshot taken in JSR 234

From Wiki
Jump to: navigation, search
Article Metadata
Created: senthilat (30 Jun 2007)
Last edited: lpvalente (02 Feb 2014)

This article demonstrates how to get the full filename of a snapshot taken with JSR 234.

While taking camera snapshot using JSR-234, filename of the image saved to the file system of the phone is generated by the JSR itself in a sequence. The MIDlet does not have any control on that. However there are cases where the exact filename is needed to access the file and do subsequent processing.

To get filename you need to implement the player listener interface. There are two events that will be received when save is done: SHOOTING_STOPPED (when the burst shooting stops and the files have been stored into the file system) or STORAGE_ERROR (when there has been an error while storing the files into the file system). In both cases eventData parameter will be a String with filename.


public void playerUpdate(Player player, String event, Object eventData) {
if (event.equals(SnapshotControl.SHOOTING_STOPPED)) {
String filename = (String)eventData;
} else if (event.equals(SnapshotControl.STORAGE_ERROR)) {
String filename = (String)eventData;

Please remember that any "time consuming" operations (like image processing) should be run in separate thread (leave playerUpdate as fast as possible).

Detailed information can be found in SnapshotControl class documentation.

This page was last modified on 2 February 2014, at 11:47.
40 page views in the last 30 days.