×

Discussion Board

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

    Thumbs up Handling incoming calls in J2me

    Hi,

    I am writing a VIDEO PLAYER application.

    I am creating player using inputstream:

    long mediatime = 0;
    STARTPLAYER():
    try
    {
    fc = (fileConnection)Connector.open(url);
    inputstream is = fc.openInputStream();
    Player p = Manager.createPlayer(is,null);
    player.setMediaTime(mediatime );
    p.start();
    }
    catch(Exception e)
    {
    //EXCEPTION 1
    }
    PAUSEPLAYER():
    try
    {
    p.stop();
    mediatime = player.getMediaTime();
    }
    catch(Exception e)
    {
    //EXCEPTION 2
    }

    I am using canvas in my application.
    So I implemented showNotify() and hideNotify() as follows:

    showNotify()
    {
    if(player.getState() == Player.PREFETCHED)
    {
    STARTPLAYER();
    }

    hideNotify():
    if(player.getState() == Player.PREFETCHED)
    {
    PAUSEPLAYER();
    }

    the application works fine if no phone call is coming.

    but when I got the incoming call I got exception at EXCEPTION 1: some times I am getting: javax.microedition.MediaException:Could not set media time -5

    and

    for some times I am getting: javax.microedition.MediaException: Could not start: -21

    What is the problem? how can I rectify it.

    Please help me.

    Thanks,
    Manoj.
    Last edited by manojkumar.m; 2008-09-26 at 12:19.

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

    Re: Handling incoming calls in J2me

    Hi,

    Some times I am getting the error:

    App.closed: Main KERN-EXEC 3 and nothing happens.

    could you please provide me a solution for the above listed problems.

    Thanks,
    Manoj.

  3. #3
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: Handling incoming calls in J2me

    hideNotify():
    if(player.getState() == Player.PREFETCHED)
    {
    PAUSEPLAYER();
    }

    This portion is wrong. If the player is already playing a song, its state is "STARTED", not "PREFETCHED". The way it is today, the player is not being paused at all.

    Daniel

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

    Re: Handling incoming calls in J2me

    HI,

    But when incoming call comes, then what is the state of the player?

    Thanks,
    Manoj.

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

    Re: Handling incoming calls in J2me

    Hi,

    I find that the player state is PREFETCHED when a call comes.

    I am sure that the state is PREFETCHED.

    Please help me.

    Thanks,
    Manoj.

Similar Threads

  1. Handling incoming calls
    By ishan.malviya in forum Symbian
    Replies: 4
    Last Post: 2008-05-20, 19:24
  2. handling incoming calls in J2ME project
    By sujoydas in forum Mobile Java General
    Replies: 2
    Last Post: 2004-07-15, 20:57
  3. The procedure of handling more than one incoming calls in j2me
    By bangladeshi in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2004-01-22, 13:57
  4. handling incoming calls
    By sujoydas in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2003-09-29, 12:49
  5. Simulate alpha keys / incoming calls
    By meenuj in forum Symbian
    Replies: 0
    Last Post: 2003-09-02, 10:30

Posting Permissions

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