2024年2月15日发(作者:帛灵松)
在Target Android Devices中:选择 Phone and Tablet选择 API 19: Android 4.4 (KitKat).在 Add an Activity to Mobile 中选择 Empty Activity.在 Configure Activity 中:设置 Activity Name: 为 “MainActivity”.勾选 Generate Layout File设置 Layout Name: 为 “activity_main”.点击完成
配置Grade脚本打开 (Module: app)
更新内容如下:
打开 :
_PHONE_STATE, }; private List missingPermission = new ArrayList<>(); private AtomicBoolean isRegistrationInProgress = new AtomicBoolean(false); private static final int REQUEST_PERMISSION_CODE = 12345; @Override protected void onCreate(Bundle savedInstanceState) { te(savedInstanceState); // When the compile and target version is higher than 22, please request the following permission at runtime to ensure the SDK works well. if (_INT >= N_CODES.M) { checkAndRequestPermissions(); } setContentView(ty_main); //Initialize DJI SDK Manager mHandler = new Handler(nLooper()); } /** * Checks if there is any missing permissions, and * requests runtime permission if needed. */ private void checkAndRequestPermissions() { // Check for permissions for (String eachPermission : REQUIRED_PERMISSION_LIST) { if (elfPermission(this, eachPermission) != SION_GRANTED) { (eachPermission); } } // Request for missing permissions if (y()) { startSDKRegistration(); } else if (_INT >= N_CODES.M) { showToast("Need to grant the permissions!"); tPermissions(this, y(new String[()]), REQUEST_PERMISSION_CODE); } } /** * Result of runtime permission request */ @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { estPermissionsResult(requestCode, permissions, grantResults); // Check for granted permission and remove from missing list if (requestCode == REQUEST_PERMISSION_CODE) { for (int i = - 1; i >= 0; i--) { if (grantResults[i] == SION_GRANTED) { (permissions[i]); } } } // If there is enough permission, we will start the registration if (y()) { startSDKRegistration(); } else { showToast("Missing permissions");
2024年2月15日发(作者:帛灵松)
在Target Android Devices中:选择 Phone and Tablet选择 API 19: Android 4.4 (KitKat).在 Add an Activity to Mobile 中选择 Empty Activity.在 Configure Activity 中:设置 Activity Name: 为 “MainActivity”.勾选 Generate Layout File设置 Layout Name: 为 “activity_main”.点击完成
配置Grade脚本打开 (Module: app)
更新内容如下:
打开 :
_PHONE_STATE, }; private List missingPermission = new ArrayList<>(); private AtomicBoolean isRegistrationInProgress = new AtomicBoolean(false); private static final int REQUEST_PERMISSION_CODE = 12345; @Override protected void onCreate(Bundle savedInstanceState) { te(savedInstanceState); // When the compile and target version is higher than 22, please request the following permission at runtime to ensure the SDK works well. if (_INT >= N_CODES.M) { checkAndRequestPermissions(); } setContentView(ty_main); //Initialize DJI SDK Manager mHandler = new Handler(nLooper()); } /** * Checks if there is any missing permissions, and * requests runtime permission if needed. */ private void checkAndRequestPermissions() { // Check for permissions for (String eachPermission : REQUIRED_PERMISSION_LIST) { if (elfPermission(this, eachPermission) != SION_GRANTED) { (eachPermission); } } // Request for missing permissions if (y()) { startSDKRegistration(); } else if (_INT >= N_CODES.M) { showToast("Need to grant the permissions!"); tPermissions(this, y(new String[()]), REQUEST_PERMISSION_CODE); } } /** * Result of runtime permission request */ @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { estPermissionsResult(requestCode, permissions, grantResults); // Check for granted permission and remove from missing list if (requestCode == REQUEST_PERMISSION_CODE) { for (int i = - 1; i >= 0; i--) { if (grantResults[i] == SION_GRANTED) { (permissions[i]); } } } // If there is enough permission, we will start the registration if (y()) { startSDKRegistration(); } else { showToast("Missing permissions");