|
|
@@ -0,0 +1,33 @@
|
|
|
+package com.example.smartbowlib;
|
|
|
+
|
|
|
+import android.content.Context;
|
|
|
+import android.provider.Settings;
|
|
|
+
|
|
|
+import com.hpplay.sdk.source.api.IBindSdkListener;
|
|
|
+import com.hpplay.sdk.source.api.LelinkSourceSDK;
|
|
|
+import com.hpplay.sdk.source.browse.api.IAPI;
|
|
|
+
|
|
|
+public class ScreenProjection {
|
|
|
+ static Context curContext;
|
|
|
+
|
|
|
+ public static void initSDK(Context context) {
|
|
|
+ curContext = context;
|
|
|
+ LelinkSourceSDK.getInstance().bindSdk(
|
|
|
+ context, "21602", "123e35a2f7a9b8e3ee8c00d2c4562328", mBindSdkListener);
|
|
|
+ UnityMsgSender.log("initSDK");
|
|
|
+ }
|
|
|
+
|
|
|
+ static IBindSdkListener mBindSdkListener = new IBindSdkListener() {
|
|
|
+ @Override
|
|
|
+ public void onBindCallback(boolean success) {
|
|
|
+ UnityMsgSender.log("onBindCallback:" + success);
|
|
|
+ if (!success) {
|
|
|
+ UnityMsgSender.error("bindSDK Fail");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ LelinkSourceSDK.getInstance().setPermissionMode(IAPI.PERMISSION_MODE_CLOUD_LICENSE,
|
|
|
+ Settings.Secure.getString(curContext.getContentResolver(), Settings.Secure.ANDROID_ID));
|
|
|
+ UnityMsgSender.log("License Permission");
|
|
|
+ }
|
|
|
+ };
|
|
|
+}
|