Closed yoqim closed 7 years ago
In your application, have you overriden the method onGetRegisteredResult(DJIError) ?
It seems you did not override it.
/**
* When starting SDK services, an instance of interface DJISDKManager.DJISDKManagerCallback will be used to listen to
* the SDK Registration result and the product changing.
*/
private DJISDKManager.DJISDKManagerCallback mDJISDKManagerCallback = new DJISDKManager.DJISDKManagerCallback() {
//Listens to the SDK registration result
@Override
public void onGetRegisteredResult(DJISDKError 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(), "register sdk fails, check network is available", Toast.LENGTH_LONG).show();
}
});
}
Log.e("TAG", error.toString());
}
//Listens to the connected product changing, including two parts, component changing or product connection changing.
@Override
public void onProductChanged(DJIBaseProduct oldProduct, DJIBaseProduct newProduct) {
mProduct = newProduct;
if(mProduct != null) {
mProduct.setDJIBaseProductListener(mDJIBaseProductListener);
}
notifyStatusChange();
}
};
thanks. it works out when i change the DJISDKError in the public void onGetRegisteredResult(DJISDKError error) to DJIError. But now I can't register successfully, so have you meet the problem?
Hi, please check if the App Key you register in DJI developer website is put in the right place of AndroidManifest.xml file and check your android device's network and try again. For more details of registering your application using DJI SDK, please check Android Studio Project Integration Tutorial
when I run the demo,why there is a problem in application? says that:
Error:(48, 115) 错误: <匿名com.example.myapp.FPVTutorialApplication$1>不是抽象的, 并且未覆盖DJISDKManagerCallback中的抽象方法onGetRegisteredResult(DJIError)
Can you explain it?