本文整理汇总了Java中dji.common.error.DJISDKError类的典型用法代码示例。如果您正苦于以下问题:Java DJISDKError类的具体用法?Java DJISDKError怎么用?Java DJISDKError使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DJISDKError类属于dji.common.error包,在下文中一共展示了DJISDKError类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onGetRegisteredResult
import dji.common.error.DJISDKError; //导入依赖的package包/类
@Override
public void onGetRegisteredResult(DJIError error) {
if(error == DJISDKError.REGISTRATION_SUCCESS) {
DJISDKManager.getInstance().startConnectionToProduct();
} else {
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
@Override
public void run() {
Toast.makeText(getApplicationContext(),
R.string.sdk_registration_message,
Toast.LENGTH_LONG).show();
}
});
}
Log.v(TAG, error.getDescription());
}
开发者ID:ShaolinZhang,项目名称:HACKxFDU-CrisisProbingUAV,代码行数:20,代码来源:DJISampleApplication.java
示例2: startSDKRegistration
import dji.common.error.DJISDKError; //导入依赖的package包/类
private void startSDKRegistration() {
if (isRegistrationInProgress.compareAndSet(false, true)) {
AsyncTask.execute(new Runnable() {
@Override
public void run() {
showToast( "registering, pls wait...");
DJISDKManager.getInstance().registerApp(getApplicationContext(), new DJISDKManager.SDKManagerCallback() {
@Override
public void onRegister(DJIError djiError) {
if (djiError == DJISDKError.REGISTRATION_SUCCESS) {
DJILog.e("App registration", DJISDKError.REGISTRATION_SUCCESS.getDescription());
DJISDKManager.getInstance().startConnectionToProduct();
showToast("Register Success");
} else {
showToast( "Register sdk fails, check network is available");
}
Log.v(TAG, djiError.getDescription());
}
@Override
public void onProductChange(BaseProduct oldProduct, BaseProduct newProduct) {
Log.d(TAG, String.format("onProductChanged oldProduct:%s, newProduct:%s", oldProduct, newProduct));
}
});
}
});
}
}
开发者ID:DJI-Mobile-SDK-Tutorials,项目名称:Android-Phantom4Missions,代码行数:29,代码来源:MainActivity.java
示例3: startSDKRegistration
import dji.common.error.DJISDKError; //导入依赖的package包/类
private void startSDKRegistration() {
if (isRegistrationInProgress.compareAndSet(false, true)) {
AsyncTask.execute(new Runnable() {
@Override
public void run() {
showToast("registering, pls wait...");
DJISDKManager.getInstance().registerApp(MainActivity.this.getApplicationContext(), new DJISDKManager.SDKManagerCallback() {
@Override
public void onRegister(DJIError djiError) {
if (djiError == DJISDKError.REGISTRATION_SUCCESS) {
showToast("Register Success");
DJISDKManager.getInstance().startConnectionToProduct();
} else {
showToast("Register sdk fails, please check the bundle id and network connection!");
}
Log.v(TAG, djiError.getDescription());
}
@Override
public void onProductChange(BaseProduct oldProduct, BaseProduct newProduct) {
mProduct = newProduct;
if(mProduct != null) {
mProduct.setBaseProductListener(mDJIBaseProductListener);
}
notifyStatusChange();
}
});
}
});
}
}
开发者ID:DJI-Mobile-SDK-Tutorials,项目名称:Android-ImportAndActivateSDKInAndroidStudio,代码行数:34,代码来源:MainActivity.java
注:本文中的dji.common.error.DJISDKError类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论