×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Thumbs up Problem with Nokia6300 (S40)

    Hi friends,

    I have written an application which reads media file from specific drive.

    I have placed the cutegirl.3gp in E:

    here is the code:
    fc = (FileConnection)Connector.open("file:///E:/Data/Sounds/cutegirl.3gp");
    InputStream is = fc.openInputStream();

    Player player = Manager.createPlayer(is,"video/3gpp");
    player.prefetch();
    player.realize();
    player.start();

    Its working fine on E61i which is S60.

    when I tried to run the same code on Nokia 6300 which is S40,
    it could not able to play the media file and an alert comes saying "media exception".

    what could be the problem?

    Please help me.

    Thanks,
    Manoj.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Problem with Nokia6300 (S40)

    Hi Manoj,

    you're getting that Exception since that path is not correct when working on S40 devices. Generally speaking, when accessing predefined folders (e.g.: photos, videos..) you should use System properties that give you their exact path, instead of using hard-coded paths like in your code.

    Check this page for a full listing of related System properties:

    http://www.forum.nokia.com/document/...79F5BE26E.html

    In your case, using "fileconn.dir.tones" or "fileconn.dir.music" properties should work.

    Pit

  3. #3
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Re: Problem with Nokia6300 (S40)

    Hi jappit,

    Thanks for your reply. I solved that one.

    my mobile model is Nokia 6300.

    But I am getting new exception,
    java.lang.OutOfMemory,
    javax.microedition.media.MediaException: OutOfMemoryError at Realizing

    I am creating player by creating input stream and passing argument to Manager.createPlayer();

    Can you please tell me why I am getting?

    Thanks,
    Manoj.

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Problem with Nokia6300 (S40)

    Hi Manoj,

    from OutOfMemoryError JavaDocs:
    Thrown when the Java Virtual Machine cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector.
    So, your 3gp file is probably too big to be handled by Java heap memory available on your test device.

    Pit

  5. #5
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Re: Problem with Nokia6300 (S40)

    Hi jappit,

    actually, my device has free memory of 50MB.
    Still it gives the exception.

    if I play the song directly by taking the url of the media file,
    then it is playing.
    ex:
    url = "file:///E:/Data/sounds/cutegirl.3gp";
    Player p = Manager.createPlayer(url);

    but when I use inputstream I am getting exception for only 6300.
    But not on E61i.
    ex:
    fc = (FileConnection)Connector.open(url);
    InputStream is = fc.opneInputStream();
    Player p = Manager.createPlayer(is,"video/3gpp");
    player.start();--->getting exception on Nokia 6300.

    Thanks,
    Manoj.

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Problem with Nokia6300 (S40)

    Hi Manoj,

    Java heap memory is not the same as memory available on the device. You should refer to device specifications to spot out the Java heap memory for each of them.

    As for Nokia 6300, as you can see on its specifications page:

    http://www.forum.nokia.com/devices/6300

    it has an Heap size of 2MB, while instead Nokia E61i has an unlimited heap size.

    As for your memory problem, it is a known issue on S40 2nd and 3rd edition devices:

    http://wiki.forum.nokia.com/index.ph...tOfMemoryError

    Pit

  7. #7
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Re: Problem with Nokia6300 (S40)

    Hi Jappit,

    Thanks for your reply. It helped me a lot.

    Thanks once again.

    -
    Manoj.

Similar Threads

  1. 3500 (s40) playing audio problem
    By ahmadi2c in forum Mobile Java General
    Replies: 2
    Last Post: 2007-03-07, 08:03
  2. S40 Theme Studio 1.2 - Corrupted theme problem w/ 5140i!
    By mika.vuorinen in forum Streaming and Video
    Replies: 3
    Last Post: 2006-11-02, 13:15
  3. S40 theme studio problem
    By personalcomm in forum Tools and SDK Feedback (Closed)
    Replies: 0
    Last Post: 2006-05-28, 09:29
  4. s40 GUI problem with adding Command
    By melas21 in forum Mobile Java General
    Replies: 0
    Last Post: 2004-12-06, 10:02
  5. Who can help me?? A monstrous problem about the HttpConnection of S40
    By pipicao in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2004-11-23, 13:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •