- Java Mobile Media API
The Mobile Media API (MMAPI) is an
APIspecification for the Java MEplatform CDC and CLDCdevices such as mobile phones. Depending on how it's implemented, the APIs allow applications to play and record sounds and video, and to capture still images. MMAPI was developed under the Java Community Processas JSR 135.
The Multimedia Java API is based around four main types of classes in the
PlayerListenerand various types of
Java ME programmers wishing to use JSR 135 would first make use of the static methods of the
Managerclass. Although there are other methods such as
playTone, the main method used is
createPlayer. This takes either a URI or an Javadoc:SE|java/io|InputStream, and a
MIME type. In most cases, URIs are used. Common URI protocols used include:
* resource: (which may extract a file from within the JAR of the MIDlet, but is implementation-dependent)
* capture: (used for recording audio or video)
The MIME type is optional, and is inferred from the data passed in if not supplied.
createPlayermethod returns an implementation of the
Playerinterface (even if you use a "capture:" protocol URI). This has core methods that are applicable to all players, such as starting and stopping the media, and requesting that it loop. You can also
setPlayerListenerto an object implementing the
PlayerListenerinterface, which will receive various events related to the clip (starting, stopping, media finishing, etc.)
Playerclasses also have a
getControlmethod that returns an implementation of a particular
Controlhandles any optional APIs which are not applicable to all media types. Any given
Playermay or may not be able to supply an implementation of any given
Controlreturned is actually the
Playeritself, but this is not guaranteed to be the case.)
The set of controls implemented by a
Playeris not limited; however, some standard ones are defined in the
javax.microedition.media.controlpackage by the JSR:
(Others may be defined in JSR 234 (
Advanced Multimedia Supplements).
A subset of JSR 135 is defined in JSR 118 (
As with most Java ME specifications, implementations differ despite the best efforts of the specification authors to ensure consistency. Two obvious areas for differences are in the controls supported, and in the acceptable URI types in the first place. More obscure areas are whether
mixingis supported; many games would like to play a MIDI music track and layer PCMsound effects on top.
Another source of extreme variance is in performance. For example, if an
HTTPclip is requested, at what point does the clip get downloaded? The specification recognises this by providing two
Playermethods that can be called in advance of actually playing:
prefetch. Depending on the implementation, these may do some of the work of getting the clip into a playable state, thus making it quicker to actually play the clip when it is needed. Some implementations are sophisticated enough to actually stream a clip on request whilst it is being played.
Symbian OScontains a very complete implementation of JSR 135, but even this is highly dependent on the underlying multimedia capabilities of the device, and some device manufacturers may choose not to expose the more obscure parts of Java ME such as recording.
Implementation consistency is ensured by forcing all implementations to pass the Java
Technology Compatibility Kit(TCK). This ensures that each supported URI schema, MIME type and Control is tested, but does not test every permutation of these optional parts.
import javax.microedition.media.*; Player p = Manager.createPlayer("http://www.fishy.com/my.mp3"); p.start();
* [http://www.jcp.org/en/jsr/detail?id=135 JSR 135]
* [http://developers.sun.com/techtopics/mobility/apis/articles/mmapi_overview/index.html Mobile Media API Overview]
Wikimedia Foundation. 2010.
Look at other dictionaries:
Java Mobile Media API — … Википедия
Mobile Media API — (MMAPI, JSR 135) набор классов для J2ME, который позволяет проигрывать звук и видео; часть MIDP 2.0. Содержание 1 Назначение 2 Поддерживаемые форматы … Википедия
Java Specification Request — Java Specification Requests Java Specification Requests (JSR) est un système normalisé ayant pour but de faire évoluer la plateforme Java. Sommaire 1 Présentation 2 Implémentation 3 Interopérabilité informatique … Wikipédia en Français
Java Specification Requests — (JSR) est un système normalisé ayant pour but de faire évoluer la plateforme Java. Sommaire 1 Présentation 2 Implémentation 3 Liste des JSRs 4 Notes et … Wikipédia en Français
Mobile Service Architecture — (MSA) JSR 248 is a specification that describes an end to end wireless environment for Java ME. MSA includes a full set of 16 JSRs and a subset of 8 JSRs: Contents 1 MSA Subset 2 MSA 3 See also 4 … Wikipedia
Java Platform, Micro Edition — Java editions Java Card Micro Edition (ME) Standard Edition (SE) Enterprise Edition (EE) … Wikipedia
Java Platform, Micro Edition — Java Card Micro Edition (ME) Standard Edition (SE) … Википедия
Mobile 3D Graphics API — M3G redirects here, for the morphine metabolite see Morphine 3 glucuronide Screenshot of Asphalt 3: Street Rules, showing the capabilities of the Mobile 3D Graphics API. The Mobile 3D Graphics API, commonly referred to as M3G, is a specification… … Wikipedia
Java (lenguaje de programación) — Este artículo o sección se encuentra desactualizado. Es posible que la información suministrada aquí haya cambiado o sea insuficiente … Wikipedia Español
Mobile application development — is the process by which application software is developed for small low power handheld devices such as personal digital assistants, enterprise digital assistants or mobile phones. These applications are either pre installed on phones during… … Wikipedia