Still valid to use FileJournalListener to capture the image of the camera in 6.0?

I'm having a problem with a screenshot of the app native camera on JDE 6.0 and the 9800 Simulator.  I use the old 'good practices' referring to the native camera app and save a FileSystemJournalListener:

{Synchronized (UiApplication.getEventLock ())}
UiApplication.getUiApplication () .addFileSystemJournalListener (this);
Invoke.invokeApplication (Invoke.APP_TYPE_CAMERA, new CameraArguments());
}

When I get a FileSystemJournalEntry.FILE_ADDED, I get the file and encode it.

Public Sub fileJournalChanged()
{
next sequence number file system will use
Long USN = FileSystemJournal.getNextUSN ();
        
for (long I = USN - 1; i > = lastUSN & I)< usn;="">
{
Entry FileSystemJournalEntry = FileSystemJournal.getEntry (i);
If (input == null)
{
break;
}
            
If (entry.getEvent () is FileSystemJournalEntry.FILE_ADDED)
{
Path String = entry.getPath ();
If (path! = null & path.indexOf ('.jpg')! = - 1).
{
We found a new JPEG image, treat it
String result = processImage ("file://" + path);
                    
clean
closeCamera();
                    
break;
}
}
}
        
do not forget the change log file number,
If we do not find the same events over and over again
lastUSN = USN;
}

The problem is that the Torch 9800 Simulator choke on it.  "I get randomly ' JVM error 104: Eception: OutOfMemoryError.  I say randomly because sometimes after taking pictures of 3-5 successfully, and sometimes it pours on the first attempt to photograph.  I've cleaned many times Simulator.

The same code works perfectly in 5.0 simulators (9550, 9530).  I can take pictures until I'm blue in the face without an exception OutOfMemoryError.

I saw this method of capture an image (using the MMAPI implementation)...

Take a photo in an application device of BlackBerry - Multimedia - Development Guide - BlackBerry Java...

.. .but I want the user to be able to have the user of the native camera of experience.  Therefore, listen to JPG file was added.  Is it still valid in 6.0?  It is, of course, to some extent, or my photo app would not work.  Is there something with log being numbered differently?

The FileSystemJournalListener is not the problem.

The exception OutOfMemoryError seems to be related sending images of native Java coding to JavaScript.

Only one problem in 6.0.

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • How to restore examples by default after accidentally remove/change?

    Hi all I have modified the examples directory of NEITHER and to restore the original files. Is it possible to do? Kind regards Gagan

  • Linksys E4200 - range WUSB600N V2 / signal issues

    Router Linksys E4200 dualband and Win7 64 bit Linksys WUSB600N v2.Both in the same room, the distance is about 10 meters.I compare the results on 5 GHz btw the stick of Linksys and btw another laptop with Intel Advanced-N 6200 AGN wifi chip.Running a

  • HP Pavilion 15-e034tx: upgrade HP Pavilion Notebook RAM

    The laptop came with a 4 GB of RAM (total 2 slots, 1 vacancy location). What is the limit of the extension of memory for my laptop? It is 8GB per slot or 8 GB memory total? (I mean total memory = 8 GB or 16 GB?). If I could extend up to 16 GB, what a

  • The SG300 1.3.5.58 firmware upgrade problem

    Hello We have two new switches SG300 managed. I updated the firmware of the stock to 1.3.5.58 without problem, but when I upgrade to the new firmware - 1.4.x I get the following error on the two switches: The files transferred: 7011840Status: Failed

  • Zoom in Photoshop (Alt/Option + space + mouse click)

    Hello community,could please tell me that this is possible and how it is to bind the zoom rear ALT/Option + space + mouse click?This Photoshop-like behavior is already existing for zoom in: command + space + mouse click.Thanks a lot and what is natur