×

Discussion Board

Results 1 to 10 of 10

Thread: memory problem

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    12

    memory problem(Urgent!!!)

    What is the maximum size that each image and music file that can be loaded on a real phone? And how can I know that??
    Also I am making a game now, and I want to play a wave sound after switching from one scene to another by display.setCurrent(XX), but there is a long delay before loading out the resources. I am not sure what's the problem??
    Can any one help????
    Last edited by J3SK; 2006-05-14 at 16:05.

  2. #2
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: memory problem(Urgent!!!)

    IMHO this purely depends on the device you are using and the free heap memory it have. I never came across any doc mentioning about the file size limits. I do remember that there are some restrictions in low end devices like that pointed in this link
    http://discussion.forum.nokia.com/fo...age+size+limit

    You could find the total memory of a device with "Runtime.getRuntime().totalMemory()" and Free memory with "Runtime.getRuntime().freeMemory()"

    Regards
    Gopal

  3. #3
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: memory problem

    Hi J3SK,

    Can u please post the code that u use to play the wav sound and display switch so that we can confine what has gone wrong in ur code.


    Wang

  4. #4
    Registered User
    Join Date
    May 2006
    Posts
    12

    Re: memory problem

    This code is to check whether the player has lost, if so an animation will be displayed:
    else if(((timeLong==-1)&&(houseStatus == false)&&(finalX != X)&&(finalY != Y)) ||((timeLong==-1)&&(houseStatus == false)&&(X == 0)&&(Y == 0))) || ((timeLong==-1)&&(houseStatus == false)&&(X == 12)&&(Y == 8))|| ((timeLong==-1))){
    TimerStop();
    stopSounds();
    starting = false;
    started = false;

    la = new LostAnime(midletCanvas, this);
    midletCanvas.display.getDisplay(midletCanvas).setCurrent(la);
    timeLong=10;

    }

    And the animation is using thread, which is another class:
    The code that I used in the animation class:
    imgs = new Image[4];
    for(int i=0; i < imgs.length; i++) {
    try {
    imgs[i] = Image.createImage("/End" + String.valueOf(i) + ".png");
    }catch(java.io.IOException e) {}
    }

    try {
    th.sleep(1000);
    }
    catch (InterruptedException ex) {
    }

    try{

    InputStream in= this.getClass().getResourceAsStream("/bomb1.wav");
    pl=Manager.createPlayer(in,"audio/x-wav");
    pl.realize();
    pl.prefetch();
    }catch(IOException e){

    System.out.println("1:" + e);

    }catch(MediaException e){

    System.out.println("2:" + e);

    }catch(Exception e){

    System.out.println("3:" + e);

    }

    try {

    pl.start();
    }
    catch (MediaException ex2) {
    }

    doStart();
    }

    Please help!!Urgent!!

  5. #5
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: memory problem

    Hi j3sk,
    can you please specify the phone that you are using...some latest devices will create player only from the URL...
    Thanks
    soku

  6. #6
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: memory problem

    Hi J3sk,

    what is the size of the images u r using.
    Also plz mention the sizeof the wav file used in the application.

    Where does the delay occuring. Is it occuring between the animation and the sound??

    please also check anything as gone wrong with the thread.

    wang

  7. #7
    Registered User
    Join Date
    May 2006
    Posts
    12

    Re: memory problem

    Actually I can create the sound with 3230, but the size of the audio is 79.7KB, and the images are 7XKB each.

  8. #8
    Registered User
    Join Date
    May 2006
    Posts
    12

    Re: memory problem

    Can any one help?????

  9. #9
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: memory problem

    Hi,
    What is thee format of the audio that you are using.can you reduce the size by changing the format.
    Thanks
    Soku

  10. #10
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: memory problem

    Hi J3SK,

    please try with a short midi file and tell us the results. Because a midi file will have less size whn compared with wav files. Moreover midi files is acceptable in almost all phones.

    Wang

Similar Threads

  1. Problem MMC+USB Connection
    By Fede81 in forum Symbian
    Replies: 1
    Last Post: 2007-06-14, 06:13
  2. Problem MMC+USB Connection
    By Fede81 in forum General Development Questions
    Replies: 3
    Last Post: 2006-07-19, 15:21
  3. Replies: 2
    Last Post: 2006-05-02, 07:19
  4. memory problem in Byte array (6230i)
    By harlem13 in forum Mobile Java General
    Replies: 2
    Last Post: 2006-04-12, 20:46
  5. 7650 and 3650 Canvas and FullCanvas memory
    By marcilgen in forum Mobile Java General
    Replies: 5
    Last Post: 2003-07-08, 12:24

Posting Permissions

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