Results 1 to 4 of 4

Thread: Player Class from Java J2ME

  1. #1
    Join Date
    May 2008
    Posts
    95

    Player Class from Java J2ME

    Hi, can anyone give me information about the j2me programming regarding the player class. If you have some information about the player class then just give me that, so I can able to view that and see if it is useful to me or not. So, if you have any information then give it to me, it can be anything, code, details or anything but, it may be helpful to me.

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Player Class from Java J2ME

    Hey, where did you find this? I have heard this term first time and when I searched on internet regarding this, I am not able to get any information about it. If it is helpful to create something different in j2me then please give some details about it to me. I am also wanted to know more about java j2me, so if it is a new concept then it will help me to get more information and improve my knowledge. So, give me reply about the details of Player class in j2me.

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    Re: Player Class from Java J2ME

    Hello, Player class from J2ME mostly used for playing the .wav files which is the reason while using the player class in the program. It's required to import the javax.microedition.media package to use this class in your example.

    Methods:

    * addPlayerListener(PlayerListener playerListener)
    * close()
    * deallocate()
    * getContentType()
    * getDuration()
    * getMediaTime()
    * getState()
    * prefetch()
    * realize()
    * removePlayerListener(PlayerListener playerListener)
    * setLoopCount(int count)
    * setMediaTime(long now)
    * start()
    * stop()

    Manager class has following Methods:

    * createPlayer(InputStream stream, String type)
    * createPlayer(String locator)
    * getSupportedContentTypes(String protocol)
    * getSupportedProtocols(String content_type)
    * playTone(int note, int duration, int volume)

  4. #4
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Player Class from Java J2ME

    Hi, the code below will help you get more knowledge about the Player clas and also about the use of it. So, I think you will come to know how to use the player class in your program. Use it.

    Code:
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.media.*;
    
    public class soundclass extends MIDlet 
    {
    public void startApp()
    {
    try 
    {
    Player pl = Manager.createPlayer(getClass().
    getResourceAsStream("/CatBird.wav"),"audio/x-wav");
    pl.start();
    } 
    catch(Exception e) 
    {
    e.printStackTrace();
    }
    }
    public void pauseApp() 
    {
    }
    public void destroyApp(boolean unconditional) 
    {
    }
    }

Similar Threads

  1. Converting java class to java bean class
    By Ucchal in forum Software Development
    Replies: 6
    Last Post: 09-08-2010, 10:24 AM
  2. What is TransferSupport Class in Java?
    By DANIEL 602 in forum Software Development
    Replies: 4
    Last Post: 13-02-2010, 06:54 AM
  3. J2ME Ticker from java
    By REDBULL in forum Software Development
    Replies: 3
    Last Post: 09-12-2009, 10:04 AM
  4. Trojan targets mobiles phones running Java (J2ME) applications
    By CLONEOPS in forum Networking & Security
    Replies: 2
    Last Post: 17-09-2008, 07:30 PM
  5. Java Programming Language Basics: Reflection Basics and Class Class
    By mayuri_gunjan in forum Guides & Tutorials
    Replies: 6
    Last Post: 29-08-2005, 12:04 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,019,123.37439 seconds with 16 queries