Thanks Erel.
The result is: java.lang.RuntimeException: Object should first be initialized (JavaObject).
I have no experience in using Java, nor in how to make use of the DJI SDK using direct calls to Java.
Can you give me an example where it can be seen clearly how to do this?
Dim mediamanager As JavaObject = camera
mediamanager.InitializeStatic("dji.sdk.camera")
mediamanager = mediamanager.GetFieldJO("camera").RunMethod("getMediaManager", Null)
Result ERROR:
java.lang.ClassNotFoundException: dji$sdk$camera
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:309)
at java.lang.Class.forName(Class.java:273)
at anywheresoftware.b4j.object.JavaObject.getCorrectClassName(JavaObject.java:274)
at anywheresoftware.b4j.object.JavaObject.InitializeStatic(JavaObject.java:75)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:4809)
at android.view.View$PerformClick.run(View.java:20006)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5282)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:966)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dji$sdk$camera" on path: DexPathList[[zip file "/data/data/com.dji.aerodefectscan/.cache_sdk/sdkclasses2.jar", zip file "/data/data/com.dji.aerodefectscan/.cache_sdk/sdkclasses.jar", zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/com.dji.aerodefectscan-2/base.apk"],nativeLibraryDirectories=[/data/app/com.dji.aerodefectscan-2/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 26 more
Suppressed: java.lang.ClassNotFoundException: dji$sdk$camera
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 27 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
Thanks!