Skip to main content

Movie Viewer Applet

Development Example

The movie viewer can be used by third party applications. These applications can launch the movie viewer application directly, and pass in a video file. In order to launch a video the application passes the location of the file they wish to open. This video must be saved locally on the device.

Applications broadcast Intent.ACTION_VIEW with the file’s URI and Mime type.

File movie = 
new File(Environment.getExternalStorageDirectory(), "document.pdf");
String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(document), mimeType);

View Full Source Code