I am developing an android application (Photo Album) which renders OMA
DRM protectes image files (Forward Lock and Combined delivery).
Android version : Android 2.2 and later versions (not honeycomb)
I am using availavle OMA DRM libraries (libdrm.so and libdrm1_jni.so)
to render the images.
But i am not getting proper results with OMA DRM class provided.
Sample code :
File file = new File ("/sdcard/Sunset.dm");
File rightsFile = new File ("/sdcard/test.xml");
FileInputStream is = null;
FileInputStream rFile = null;
DrmRawContent drc = null;
byte[] buffer = null;
int length = 0;
int readCount = 0;
DrmRights rights = null;
try {
is = new FileInputStream(file);
rFile = new FileInputStream(rightsFile);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
length = rFile.available();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
drc = new DrmRawContent(is, (int)is.available(),
DrmRawContent.DRM_MIMETYPE_MESSAGE_STRING);
// rFile =
drc.getContentInputStream(rights);
} catch (DrmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
DrmRightsManager mgr = DrmRightsManager.getInstance();
rights = mgr.queryRights(drc);
if (rights == null)
{
try {
rights = mgr.installRights(rFile,
(int)rFile.available(),
DrmRightsManager.DRM_MIMETYPE_RIGHTS_WBXML_STRING);
} catch (DrmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
DrmConstraintInfo in =
rights.getConstraint(DrmRights.DRM_PERMISSION_DISPLAY);
boolean b =
rights.consumeRights(DrmRights.DRM_PERMISSION_DISPLAY);
-----
-----
When try to installrights or queryrights using DRMRIGHTSMANAGER class
APIs, getting rights as null always. I have tried with different
content and rights file aswell.
Please let me know if i am missing something in the sequence or guide
me how to achieve this.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en