Embedded Section Index
Where can I learn (more) about using Java's JNI (Java Native Interface) to interface Java with platform native code?
Check out the jGuru JNI FAQ.
Where can I learn (more) about Sun's Jini network technology?
Check out the jGuru Jini FAQ.
Is it possible to adjust the tempo when playing back a MIDI file using the Mobile Media API?
That would be with the TempoControl. Get it from the Player and call the setTempo() method, passing in a value for the number of milli-beats per minute.more
Using the Mobile Media API, how can I loop the playback of my song?
Use the setLoopCount() method of Player to playback media with looping. A value of -1 means forever. A value of 1 is the default. 0 is invalid.more
Using the Mobile Media API, how do you know when a song/video is done playing?
You need to attach a PlayerListener to the Player.
Using the Mobile Media API, how do you find out information like song title?
You have to get the MetaDataControl object for the associated player. There are four predefined keys that you can ask for: TITLE_KEY, DATE_KEY, COPYRIGHT_KEY, and AUTHOR_KEY, though other informat...more
How do you discover the set of mime types supported by your platform for the Mobile Media API?
The Manager class offers a getSupportedContentTypes() method for just such a purpose. Pass in a value of null to get the whole set returned.more
Using the Mobile Media API, how do you take a picture?
Use the locator string of "capture://video" to create the Player, then get the VideoControl for the viewfinder, and finally VideoControl.getSnapshot(String type) to take the picture.
Using the Mobile Media API, how do you control the volume of what is played?
You need to get the VolumeControl object from the Player and change the volume through that:
vc = (VolumeControl) player.getControl("VolumeControl");
if(vc != null) {
vc.setVolume(50);
}
more
Using the Mobile Media API, how do you generate a tone?
The Manager has a static playTone() method to generate tones. You can also create a Manager.TONE_DEVICE_LOCATOR player object with Player player = Manager.createPlayer(Manager.TONE_DEVICE_LOCATOR)...more
Using the Mobile Media API, how do you play a video?
This is similar to playing an audio file but requires you to get the control to display the video on. You need to see the results, not just hear them.
InputStream is = getClass().getResourceAsStr...more
Using the Mobile Media API, how do you play a media file stored in an RMS record store?
RecordStore rs = RecordStore.open("name");
byte record[] = rs.getRecord(id);
ByteArrayInputStream bais = new ByteArrayInputStream(record);
Player player = Manager.createPlayer(bais, "audio/x-wav"...more
Using the Mobile Media API, how do you play a sound file that comes in the JAR?
You need to know the mime type of the audio file and pass it as a stream to the Player object.
InputStream is = getClass().getResourceAsStream("/example.wav");
Player player = Manager.createPlaye...more
How do I play a MIDI file using the Mobile Media API (MMAPI)?
Player player = Manager.createPlayer("http://example.com/example.midi");
player.start();
How does an Xlet tell the application manager it wants to end?
Call the notifyDestroyed() method of the XletContext.