Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Saving and reading DRM-protected files using FileConnection API and Mobile Media API

From Wiki
Jump to: navigation, search
Article Metadata
Code ExampleCompatibilityArticle
Created: User:Technical writer 2 (05 Oct 2006)
Last edited: lpvalente (11 Aug 2014)


This article demonstrates saving and reading DRM-protected files using FileConnection API and Mobile Media API


Saving a DRM-protected file using the FileConnection API is not possible in any of the current implementations. You can download and save a .dm or .dcf file to the device's file system, but the file won't be DRM-protected because the only delivery methods supported normally are HTTP (via browser) and MMS. Some newer devices may support Bluetooth or e-mail, but HTTP and MMS delivery methods are the rule.

Therefore, saving a .dm or .dcf file to the file system will be successful from the FC API's standpoint, but it will be impossible to play it back from either the MMAPI or native application, because it will appear as corrupted, not being registered in the device's DRM content database.

On S60 3rd Edition devices there is some DRM support described as follows:

  • It is possible to open a file protected by DRM, using the following syntax:
    FileConnection fc = (FileConnection)"file:///E:/Sounds/Digital/jack_aac_aac.dcf?drm=enc",Connector.READ);

Note that it is only possible to open the file in read-only mode, so the Connector.READ parameter is mandatory.

  • It is possible to play a DRM-protected file using the Mobile Media API with the following syntax:
    Player p = Manager.createPlayer("file:///E:/Sounds/Digital/jack_aac_aac.dcf"); //without the drm=enc parameter
  • It is still not possible to save a file with DRM protection using Java.
    - The example MIDlet Drmtest with sample code shows how to access and play DRM-protected files on S60 3rd Edition devices.

For all other devices, the behavior is as follows:

  • Downloading a wallpaper (.jpg) file, protected with DRM Forward Lock, and saving it via Java ME does not protect the file locally, neither makes it able to be played with the MMAPI or native applications.
  • Downloading a file via the browser, thus enforcing the DRM protection, and trying to access it via the Java ME FileConnection API shows that the file becomes invisible to the FileConnection.list(); methods, so the file isn't even visible to Java, let alone playable by the MMAPI.
  • Forcing the absolute path of the file, as in"file:///C:/Nokia/Images/file_protected_drm.jpg");
    throws a java.lang.SecurityException: Access Denied. in both Series 40 and S60 devices.

The example MIDlet with sample code shows how the attempt to access and play DRM-protected files on devices other than S60 3rd Edition causes run-time exceptions.

Version Hint

Windows Phone: [[Category:Windows Phone]]
[[Category:Windows Phone 7.5]]
[[Category:Windows Phone 8]]

Nokia Asha: [[Category:Nokia Asha]]
[[Category:Nokia Asha Platform 1.0]]

Series 40: [[Category:Series 40]]
[[Category:Series 40 1st Edition]] [[Category:Series 40 2nd Edition]]
[[Category:Series 40 3rd Edition (initial release)]] [[Category:Series 40 3rd Edition FP1]] [[Category:Series 40 3rd Edition FP2]]
[[Category:Series 40 5th Edition (initial release)]] [[Category:Series 40 5th Edition FP1]]
[[Category:Series 40 6th Edition (initial release)]] [[Category:Series 40 6th Edition FP1]] [[Category:Series 40 Developer Platform 1.0]] [[Category:Series 40 Developer Platform 1.1]] [[Category:Series 40 Developer Platform 2.0]]

Symbian: [[Category:Symbian]]
[[Category:S60 1st Edition]] [[Category:S60 2nd Edition (initial release)]] [[Category:S60 2nd Edition FP1]] [[Category:S60 2nd Edition FP2]] [[Category:S60 2nd Edition FP3]]
[[Category:S60 3rd Edition (initial release)]] [[Category:S60 3rd Edition FP1]] [[Category:S60 3rd Edition FP2]]
[[Category:S60 5th Edition]]
[[Category:Symbian^3]] [[Category:Symbian Anna]] [[Category:Nokia Belle]]

This page was last modified on 11 August 2014, at 19:02.
67 page views in the last 30 days.