example.mmademo
Class SimplePlayer
java.lang.Object
javax.microedition.midlet.MIDlet
example.mmademo.BaseListMidlet
example.mmademo.SimplePlayer
- All Implemented Interfaces:
- Utils.BreadCrumbTrail, Utils.QueryListener, javax.microedition.lcdui.CommandListener
public class SimplePlayer
- extends BaseListMidlet
- implements Utils.BreadCrumbTrail, Utils.QueryListener
An example MIDlet for a generic Player for audio, MIDI media
The top-level URLs are configured in the jad file:
PlayerURL-n
defines the n'th URL
PlayerTitle-n
defines the n'th title
Special URL "protocols" can be used:
resource:
for media data from the jar
rms:
for media data from RMS memory
Examples:
PlayerURL-1: http://server.com/
PlayerTitle-1: Browse server.com
PlayerURL-2: resource:/audio/hello.wav
PlayerTitle-2: hello.wav from jar
PlayerURL-3: http://localhost/movie.mpg
PlayerTitle-3: Funny movie
PlayerURL-4: rms:/
PlayerTitle-4: Browse Record Stores
PlayerURL-5: capture://audio
PlayerTitle-5: Capture Audio from default device
Method Summary |
void |
destroyApp(boolean unconditional)
Called when this MIDlet is destroyed. |
protected void |
fillList(javax.microedition.lcdui.List list)
Child classes must implement this to insert
the displayed list items and commands. |
void |
handle(java.lang.String title,
java.lang.String url)
Main function that decides which class to display
dependent on the url. |
protected static boolean |
isSupported(java.lang.String url)
|
void |
queryCancelled()
|
void |
queryOK(java.lang.String text)
|
protected void |
selectCommand(int index)
Child classes must implement this in response to
a selection in the list |
java.lang.String |
toString()
|
Methods inherited from class javax.microedition.midlet.MIDlet |
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SimplePlayer
public SimplePlayer()
isSupported
protected static final boolean isSupported(java.lang.String url)
fillList
protected void fillList(javax.microedition.lcdui.List list)
- Description copied from class:
BaseListMidlet
- Child classes must implement this to insert
the displayed list items and commands.
- Specified by:
fillList
in class BaseListMidlet
handle
public void handle(java.lang.String title,
java.lang.String url)
- Main function that decides which class to display
dependent on the url.
- Specified by:
handle
in interface Utils.BreadCrumbTrail
selectCommand
protected void selectCommand(int index)
- Description copied from class:
BaseListMidlet
- Child classes must implement this in response to
a selection in the list
- Specified by:
selectCommand
in class BaseListMidlet
queryOK
public void queryOK(java.lang.String text)
- Specified by:
queryOK
in interface Utils.QueryListener
queryCancelled
public void queryCancelled()
- Specified by:
queryCancelled
in interface Utils.QueryListener
destroyApp
public void destroyApp(boolean unconditional)
- Description copied from class:
BaseListMidlet
- Called when this MIDlet is destroyed.
Subclasses should implement this for clean-up.
- Overrides:
destroyApp
in class BaseListMidlet
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object