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.

File size using RecordControl.setRecordSizeLimit(Integer.MAX VALUE) not set accordingly in Series 40 (Known Issue)

From Wiki
Jump to: navigation, search
Article Metadata
Code ExampleTested with
Devices(s): Series 40 3rd Edition
Series 40 3rd Edition, FP1
Series 40 5th Edition
Created: User:Technical writer 1 (11 Nov 2008)
Last edited: hamishwillee (13 Aug 2013)



File size is not set to the maximum size available in Series 40 when using RecordControl.setRecordSizeLimit(Integer.MAX_VALUE).


When using RecordControl.setRecordSizeLimit(Integer.MAX_VALUE), the file size of the recorded video should be set to its maximum, enabling video recording longer than one minute. However, in Series 40 devices prior to Series 40 5th Edition, Feature Pack 1, the MMAPI player records only for a couple of seconds and exists then abruptly when the value Integer.MAX_VALUE is used.

How to reproduce

  1. To reproduce this issue, implement the source code available at: File:Video recorder file size test MIDlet using
  2. Install and launch the MIDlet in the test device. The MIDlet starts to record video and stops recording within a couple of seconds.


For the affected devices, the workaround is as follows:

  1. Modify the example MIDlet's source code by removing the following lines:
      /***Replace part***/ 
    /***Replace part***/
    Replace the removed lines with these lines:
      int size =  (int) fc.availableSize(); 
    if(size < 100*1024) // if less than 100Kb available
    Alert memoryAlert = new Alert("Error", "Not enough memory", null, AlertType.ERROR);
    rc.setRecordSizeLimit(size - 100*1024); /* set the record size limit
    based on the free memory in the video folder, leave 100Kb available to the system */

  2. Install and launch the MIDlet using a test device. The MIDlet starts to record video and stops when it reaches the file size defined in the previous step.
This page was last modified on 13 August 2013, at 10:51.
44 page views in the last 30 days.