This page was last modified 10:42, 14 November 2007.
KIJ000778 - MMAPI Camera MIDlet may fail in allocating memory when taking pictures with Nokia N95
From Forum Nokia Wiki
| ID | KIJ000778 | Creation date | November 14, 2007 |
| Platform | S60 3rd Edition, FP1 | Devices | Nokia N95 |
| Category | Java ME | Subcategory | MMAPI |
Overview
The MMAPI Camera MIDlet may fail in allocating memory when taking pictures with the Nokia N95.
Description
The Camera MIDlet may fail in allocating memory for taking pictures with the Nokia N95. This applies especially when creating a default image out of byte data and adding the created image to a Form. Failure results in the MIDlet throwing an exception and, usually after launching the MIDlet a couple of times, the application hanging (instead of throwing an exception message) when memory runs out.
How to reproduce
1. Create a Player with the capture string:
Player player = Manager.createPlayer("capture://video")
2.Take a picture with the default values:
byte[] data = videoControl.getSnapshot(null)
3. Create an Image by using the byte array:
Image image = Image.createImage(data, 0, data.length)
4. Append the image to the form:
form.append(image)
Solution
Limit the memory usage by defining the image size to be smaller:
videoControl.getSnapshot("encoding=png&width=320&height=240")
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Increasing the image capture resolution to more than 640 * 480 in camera server | rashmi_ghai | General Symbian C++ | 13 | 2004-10-09 21:48 |
| Memory in Java Enabled Phones | zawisza | Mobile Java General | 1 | 2003-05-30 15:02 |
| capture screen | fwojtek | Mobile Java Tools & SDKs | 4 | 2004-05-24 05:44 |
| N95 less memory for applications than N80?? | mfggrilli | General Symbian C++ | 2 | 2008-04-15 22:21 |
| About Nokia 6280 and how to turn the camera shutter sound of... | fedblindkat | Mobile Java General | 4 | 2006-09-11 22:05 |

