Pages

Friday, February 3, 2012

Multimedia Development Guide

BlackBerry Applications and multimedia

You can create a BlackBerry® Application that plays media in the BlackBerry® Browser, or plays media in the media application on the BlackBerry smartphone. You can also create a BlackBerry Application that is a media application. You can create a BlackBerry Application that is a media application and plays binary SVG content. You can create an application that records audio or sends audio to a Bluetooth® enabled headset.
For more information about media types that the BlackBerry smartphone supports, visit www.blackberry.com/btsc/support to read knowledge base article KB05482.

Using audio and video in a BlackBerry Application


Accessing stored media


You can create a BlackBerry® Application that uses the Connector class and FileConnection interface to access media stored on the BlackBerry smartphone or a microSD card.
Access media on a BlackBerry smartphone
Invoke Connector.open(). Pass the following parameters: the file protocol and the location of the media file on the BlackBerry® smartphone.
 FileConnection fconn = (FileConnection)Connector.open("file:///store/home/user/audio/newfile.mp3");

Access media on a microSD card
Invoke Connector.open(). Pass the following parameters: the file protocol and the location of the media file on the microSD card.
 FileConnection fconn = (FileConnection)Connector.open("file:///SDCard/music/newfile.mp3");

Playing media in the BlackBerry Browser


A BlackBerry® Application can use the methods of the Browser class and BrowserSession class to play media in the BlackBerry® Browser.


Play audio in the BlackBerry Browser
Invoke Browser.getDefaultSession().
BrowserSession soundclip = Browser.getDefaultSession();
Invoke BrowserSession.displaypage().
soundclip.displayPage("file:///SDCard/BlackBerry/music/yourFile.mp3");
 Play a video in the BlackBerry Browser
Invoke Browser.getDefaultSession().
BrowserSession soundclip = Browser.getDefaultSession();
Invoke BrowserSession.displaypage().
soundclip.displayPage("file:///SDCard/BlackBerry/Video/soccergame.avi");
 Playing media in the media application


On the BlackBerry® smartphones that include the media application, a BlackBerry Application can use the javax.microedition.content and net.rim.device.api.content packages to start the media application with or without content.

Start the media application with or without content
  1. Import the javax.microedition.content package into your application code. Import javax.microedition.content;
  2. Invoke Registry.getRegistry(). Pass the following parameter: the classname parameter which is the name of the class in the application that extends javax.microedition.midlet.MIDletnet.rim.device.api.system.Application, or net.rim.device.api.ui.UiApplication. Store a reference to the returned object in a Registry object. Registry reg = Registry.getRegistry(String classname);
and more... click this link to get more explanation

1 comment:

  1. And we all know that the more graphic intense the site is, the longer it takes to load. How do we find the middle point and effectively use it is our quest...

    mobile apps development

    ReplyDelete