×
Namespaces

Variants
Actions

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

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
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.

Example:

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 14:47.
56 page views in the last 30 days.