-
-
Save ConAlgorithm/e57095d8aa87ad024c21f24de32b3511 to your computer and use it in GitHub Desktop.
Android DrmFramework Sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.polysfactory.DrmFrameworkTest; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import android.app.Activity; | |
import android.drm.DrmManagerClient; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.widget.TextView; | |
public class Top extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
TextView hello = (TextView) findViewById(R.id.Hello); | |
String text = ""; | |
DrmManagerClient drmManagerClient = new DrmManagerClient(this); | |
Method load; | |
try { | |
load = DrmManagerClient.class.getMethod("loadPlugIns"); | |
load.invoke(drmManagerClient); | |
} catch (SecurityException e) { | |
e.printStackTrace(); | |
} catch (NoSuchMethodException e) { | |
e.printStackTrace(); | |
} catch (IllegalArgumentException e) { | |
e.printStackTrace(); | |
} catch (IllegalAccessException e) { | |
e.printStackTrace(); | |
} catch (InvocationTargetException e) { | |
e.printStackTrace(); | |
} | |
String[] engines = drmManagerClient.getAvailableDrmEngines(); | |
for (String engine : engines) { | |
text += engine + "\n"; | |
Log.i("DrmFrameworkTest", engine); | |
} | |
hello.setText(text); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment