IT tutorials
 
Mobile
 

Java ME on Symbian OS : Handling Diversity - Handling Diverse Multimedia Formats and Protocols

5/28/2013 7:25:13 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

The multimedia support in MMAPI is quite openly defined. The general-purpose design of MMAPI implies that the supported set of protocols and content formats is not mandated and is left for the Java ME implementation to define. Because of the lack of a mandatory set, MMAPI also cannot specify which content types should work on top of which protocol.

In Java ME on Symbian OS, the definition of MMAPI content types and protocol support is derived from the native Symbian OS Multimedia Framework (MMF). This direct link between the two frameworks is because Java ME on Symbian OS tightly integrates with the native Symbian OS MMF. A clear benefit of this approach is that Java ME applications are consistent with the Symbian OS platform in regards to supported content, playing and recording behavior.

In order to give a Java application a way to query the system about its multimedia capabilities, the MMAPI Manager class defines two methods that you can use:

  • Manager.getSupportedContentTypes(String protocol) returns the list of supported content types for a given protocol. For example, if the given protocol is http, then the returned value would be the supported content types that can be played back with the HTTP protocol. To get all the supported content types, you can pass NULL as the protocol.

  • Manager.getSupportedProtocols(String contentType) returns the list of supported protocols for a given content type, which identify the locators that can be used for creating MMAPI players. For example, if the given content type is video/mpeg, then the returned value would be the supported protocols that can be used to play back video/mpeg content. To get all the supported protocols, you can pass NULL as the content type.

The snippet of code below, which can also be added to the Java ME Detectors MIDlet, detects the supported content types and protocols and displays them:

private void detectSupport(){
  try {
    form.append("getSupportedContentTypes:");
    String[] supportedContentTypes =
                                   Manager.getSupportedContentTypes(null);
    for(int i = 0; i < supportedContentTypes.length; i++){
      form.append(supportedContentTypes[i]);
    }
    form.append("getSupportedProtocols:");
    String[] supportedProtocols = Manager.getSupportedProtocols(null);
    for(int i = 0; i < supportedProtocols.length; i++){
      form.append(supportedProtocols[i]);
    }
  }
  catch (Exception e) {
    form.append(e.getMessage());
  }
}

Another source of information is the MMAPI properties that can be queried by System.getProperty(String key). JSR-135 MMAPI defines the following keys:

  • supports.mixing

  • supports.audio.capture

  • supports.video.capture

  • supports.recording

  • audio.encodings

  • video.encodings

  • video.snapshot.encodings

  • streamable.contents.

Now that we know how to detect, let's see how we can use the information. The first decision to take is when to use the detection – during development or dynamically at application run time.

If you detect the multimedia capabilities during development, you can package the multimedia content with the JAR according to the support on the target device. If you are targeting more than one device, you should package content whose type and format is supported by all the targeted devices. The advantage is that, once the suite is installed, the content is available on the device and does not need to be fetched. The disadvantages are that the content increases the JAR size and cannot be dynamically changed. So if your suite needs to be signed you cannot change the content later without going through the signing process again.

If you detect the multimedia capabilities at run time, you can package in your JAR different versions of the same content to be used according to the detected support or you can fetch the appropriate content from a remote server. When the MIDlet starts, it detects the available support and can play the content immediately by creating a Player with the appropriate locator or can fetch content of the appropriate type from the server. For caching, the MIDlet can use the RMS or JSR-75 FileConnection which is supported on all current Symbian smartphones. Handling can be improved further by delegating to the remote server the decision about which content to use or fetch. The MIDlet sends the query results to the remote server without processing them and the decision logic resides on the server. Your application can detect the multimedia capabilities once, the first time it is launched or can do it in subsequent runs.

The advantages of this approach are a smaller JAR size and the dynamic nature of content support. The disadvantage is the dependency on a remote server which must be accessible to download the content (the dependency can be minimized if the content is fetched just once at first application run).

 
Others
 
- Java ME on Symbian OS : Handling Diversity - Supporting Diverse Input Mechanisms
- Windows Phone 7 : Building 2D Games with the XNA Framework - AlienShooter Game Play (part 6) - Updated GameplayScreen Class, Collision Detection and Memory Management
- Windows Phone 7 : Building 2D Games with the XNA Framework - AlienShooter Game Play (part 5) - Missile Class, Game Status Board Class
- Windows Phone 7 : Building 2D Games with the XNA Framework - AlienShooter Game Play (part 4) - Hero Ship Class
- Windows Phone 7 : Building 2D Games with the XNA Framework - AlienShooter Game Play (part 3) - Enemy Class
- Windows Phone 7 : Building 2D Games with the XNA Framework - AlienShooter Game Play (part 2) - Game Object Class
- Windows Phone 7 : Building 2D Games with the XNA Framework - AlienShooter Game Play (part 1) - Sprite Animation
- BlackBerry Bold 9700 and 9650 Series : Connect as a Tethered Modem (part 3) - Using Desktop Manager for Mac
- BlackBerry Bold 9700 and 9650 Series : Connect as a Tethered Modem (part 2) - Using Desktop Manager for Windows
- BlackBerry Bold 9700 and 9650 Series : Connect as a Tethered Modem (part 1) - Understanding the Options for Tethering
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us