I followed the guidelines on Huawei Developer website about Cloud DB service.Then I just created a simple app trying to query data from Cloud DB and test it via Android Studio Emulator.
But i am getting following error that make the app crush with message on screen: ExampleCloudDBApp keeps stopping.
Process: com.huawei.agc.clouddb.quickstart, PID: 6400
java.lang.UnsatisfiedLinkError: No implementation found for long com.huawei.agconnect.cloud.database.AGConnectCloudDB.nativeGetInstance(com.huawei.agconnect.cloud.database.CertificateService, java.lang.String, java.lang.String) (tried Java_com_huawei_agconnect_cloud_database_AGConnectCloudDB_nativeGetInstance and Java_com_huawei_agconnect_cloud_database_AGConnectCloudDB_nativeGetInstance__Lcom_huawei_agconnect_cloud_database_CertificateService_2Ljava_lang_String_2Ljava_lang_String_2)
at com.huawei.agconnect.cloud.database.AGConnectCloudDB.nativeGetInstance(Native Method)
at com.huawei.agconnect.cloud.database.AGConnectCloudDB.initialize(AGConnectCloudDB.java:128)
at com.huawei.agc.clouddb.quickstart.model.CloudDBZoneWrapper.initAGConnectCloudDB(CloudDBZoneWrapper.java:103)
at com.huawei.agc.clouddb.quickstart.CloudDBQuickStartApplication.onCreate(CloudDBQuickStartApplication.java:28)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5871)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
CloudDBQuickStartApplication class's initAGConnectCloudDB method:
public class CloudDBQuickStartApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
//Initialize AGConnectCloudDB
CloudDBZoneWrapper.initAGConnectCloudDB(this);
}
@Override
public void onTerminate() {
super.onTerminate();
}
CloudDBZoneWrapper class content that calls initialize method of AGConnectCloudDB class:
public static void initAGConnectCloudDB(Context context) {
AGConnectCloudDB.initialize(context);
}
You mentioned to test your Cloud DB app on Android Studio Emulator.
Based on my observation throghout the Huawei Kits' implementations, it was a less painful practice to use real android/huawei device or even a cloud based smartphone test environment provided on Huawei developer website.Some errors i faced using emulator was not appear on real device at all.