DRM Access, User and Device Data

DRM Access

During the development phase of MIDlet which uses In-app APIs, the resource files may not be protected using DRM or Non Nokia DRM method. Since the developer wants to write code in the MIDlet for DRM failure as well DRM access success, SDK provides option to simulate both.

The DRM settings will be used for simulating In-app API getDRMResourceAsStream(..). The success or failure of this function can be simulated for each resource file under res/drm/data, by choosing Success or Fail radio button for each item in the DRM Content list.

The API getDRMResourceAsStream(..) will return normal file stream; if the content is present in the respective path and the result value is set as success in the simulation window.

Figure: DRM Access, User and Device Data UI

For example:

Simulation of successful DRM file access:

  1. Place the resource file/files (example Nokig.gif) in the folder <project_root>\res\drm\data\resourceid_x (exampleres\drm\data\resourceid_12345), where X is the product ID of the corresponding purchase item .

  2. Choose the item “drm/data/resourceid_x/helloworld.gif” from the DRM Content drop-down list.

  3. Select Success.

The above mentioned settings will make sure that the API, getDRMResourceAsStream(..) will return the file stream for the file helloworld.gif which is present in the folder res\drm\data\resourceid_12345\helloworld.gif.

Simulation of DRM file access failure:

To simulate the DRM file access failure, developer can choose the corresponding file from the DRM Content drop-down list and select the radio button Fail .

This setting can be used to simulate no license for a particular DRM content. Developer can test the application behavior, if there is no license installed for a particular DRM content in the MIDlet.

User and Device Data (for Non Nokia DRM)

Developers who are using non-Nokia DRM for protecting the contents of the application, can get the user and device specific data using the In-app API getUserAndDeviceId.

The developer has to enter the details like Country, Device Model, IMEI, Account, Language, and IMSI.

These settings will be used for simulating the In-app API getUserAndDeviceId(..). The above mentioned user data will be passed to the MIDlet listener call back function userAndDeviceDataReceived(..).

The success or failure of the userAndDeviceDataReceived(..) call back function can be simulated by choosing Success or Fail radio button.

For example:

Enter the details of the user like Country, Device Model, IMEI, Account, Language, IMSI.

After doing the above settings, open the MIDlet which uses the getUserAndDeviceId(..) API in the emulator. The user will be able get the user and device details in the listener call back function userAndDeviceDataReceived.