B4A Library DJI Drones

Status
Not open for further replies.

WhoIsShmoove

Active Member
Licensed User
Hi Erel yes i use b4a 8.0 last drone firmware and last DJI library 4.41 too. I check too with library helper and don't have inside DJIMissionManager

Untitled-1.jpg
 
Last edited:

DonManfred

Expert
Licensed User
1. Register with DJI: https://developer.dji.com/ and create an app in the User Center page. You will see an App Key that you need to add to the manifest editor.
May i suggest to add the info that the Bundle Identifier in the console must match the Packagename!
 

ELCHARO

Member
Licensed User
Hello Erel!

I run the app. In Samsung S7 Edge. The problem is the screen are inverse and can't rotate. All apps do is no android problem. Rotation is enable.
But the djidemo (both) are inverted and is imposible to rotate (fixed)
What can i do?

Thanks
 

Roberto P.

Well-Known Member
Licensed User
Hi,
I tried to compile your examples, but I have these errors. What can they be?
thank you
regards
 

Attachments

Roberto P.

Well-Known Member
Licensed User
1. You should start a new thread for any Question you have!
2. You should post errors as TEXT instead of an Image
Ok DonManfred,
next time I create new thread.

here is error in text format:

Logger connected to: 1TSB3DF72B
--------- beginning of system
--------- beginning of main
**************************** BaseApplication **************************
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main$ResumableSub_Activity_Createresume (java line: 383)
java.lang.VerifyError: Verifier rejected class dji.sdk.sdkmanager.DJISDKManager due to bad method void dji.sdk.sdkmanager.DJISDKManager.<init>() (declaration of 'dji.sdk.sdkmanager.DJISDKManager' appears in /data/app/b4a.dji.test1-1/base.apk:classes2.dex)
at anywheresoftware.b4a.objects.DJISDKManagerWrapper.Initialize(DJISDKManagerWrapper.java:44)
at b4a.dji.test1.main$ResumableSub_Activity_Create.resume(main.java:383)
at b4a.dji.test1.main._activity_create(main.java:344)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at b4a.dji.test1.main.afterFirstLayout(main.java:102)
at b4a.dji.test1.main.access$000(main.java:17)
at b4a.dji.test1.main$WaitForLayout.run(main.java:80)
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)
(Exception) java.lang.Exception: java.lang.VerifyError: Verifier rejected class dji.sdk.sdkmanager.DJISDKManager due to bad method void dji.sdk.sdkmanager.DJISDKManager.<init>() (declaration of 'dji.sdk.sdkmanager.DJISDKManager' appears in /data/app/b4a.dji.test1-1/base.apk:classes2.dex)
** Activity (main) Resume **
main_activity_resume (java line: 457)
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean dji.sdk.sdkmanager.DJISDKManager.hasSDKRegistered()' on a null object reference
at anywheresoftware.b4a.objects.DJISDKManagerWrapper.getRegistered(DJISDKManagerWrapper.java:87)
at b4a.dji.test1.main._activity_resume(main.java:457)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at b4a.dji.test1.main.afterFirstLayout(main.java:108)
at b4a.dji.test1.main.access$000(main.java:17)
at b4a.dji.test1.main$WaitForLayout.run(main.java:80)
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)
(NullPointerException) java.lang.NullPointerException: Attempt to invoke virtual method 'boolean dji.sdk.sdkmanager.DJISDKManager.hasSDKRegistered()' on a null object reference
** Activity (main) Pause, UserClosed = true **
No wakelock.
**************************** BaseApplication **************************
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
main$ResumableSub_Activity_Createresume (java line: 412)
java.lang.VerifyError: Verifier rejected class dji.sdk.sdkmanager.DJISDKManager due to bad method void dji.sdk.sdkmanager.DJISDKManager.<init>() (declaration of 'dji.sdk.sdkmanager.DJISDKManager' appears in /data/app/b4a.dji.test1-2/base.apk:classes2.dex)
at anywheresoftware.b4a.objects.DJISDKManagerWrapper.Initialize(DJISDKManagerWrapper.java:44)
at b4a.dji.test1.main$ResumableSub_Activity_Create.resume(main.java:412)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:240)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.keywords.Common$14.run(Common.java:1717)
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)
(Exception) java.lang.Exception: java.lang.VerifyError: Verifier rejected class dji.sdk.sdkmanager.DJISDKManager due to bad method void dji.sdk.sdkmanager.DJISDKManager.<init>() (declaration of 'dji.sdk.sdkmanager.DJISDKManager' appears in /data/app/b4a.dji.test1-2/base.apk:classes2.dex)
main$ResumableSub_btnStartMission_Clickresume (java line: 708)
java.lang.VerifyError: Verifier rejected class dji.common.mission.waypoint.WaypointMission$Builder due to bad method void dji.common.mission.waypoint.WaypointMission$Builder.<init>(dji.midware.data.model.P3.DataFlycDownloadWayPointMissionMsg) (declaration of 'dji.common.mission.waypoint.WaypointMission$Builder' appears in /data/app/b4a.dji.test1-2/base.apk)
at anywheresoftware.b4a.objects.WaypointMissionOperatorWrapper$WaypointMissionBuilderWrapper.Initialize(WaypointMissionOperatorWrapper.java:134)
at b4a.dji.test1.main$ResumableSub_btnStartMission_Click.resume(main.java:708)
at b4a.dji.test1.main._btnstartmission_click(main.java:682)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
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)
(Exception) java.lang.Exception: java.lang.VerifyError: Verifier rejected class dji.common.mission.waypoint.WaypointMission$Builder due to bad method void dji.common.mission.waypoint.WaypointMission$Builder.<init>(dji.midware.data.model.P3.DataFlycDownloadWayPointMissionMsg) (declaration of 'dji.common.mission.waypoint.WaypointMission$Builder' appears in /data/app/b4a.dji.test1-2/base.apk)
** Activity (main) Pause, UserClosed = true **
thank you
 

DonManfred

Expert
Licensed User

Roberto P.

Well-Known Member
Licensed User
Hi,
after following all the steps successfully, I can not make the app connect with the drone.

** Activity (main) Pause, UserClosed = false **
**************************** BaseApplication **************************
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Registered successfully!
activation state: UNKNOWN
binding state: UNKNOWN
activation listener added
No connected product
The DJI app connects.

Can you tell me what I have to do to make it connect?

thank you
 

Michael S King

New Member
Licensed User
SUPER COOL! Question? Can you control the camera with this? Specifically I want to change the shutter speed and then capture an image programmatically. In essence, I want to create an true automatic exposure bracketing routine with more control than the built in disaster lacking any imagination.

These kind of things will really inspire a programmer. Sure, I could make an app to fly the Drone but photography and cinematography is why we fly. creating a beautiful HDR (High dynamic range) photograph requires exposure bracketing. from what i read of DJI's version, they change the ISO to create the AEB. I want to not only change the shutter speed but change the number of exposures to infinity if I choose. So essentially:

  • Take and image at the current Shutter speed
  • Drop 1 f stop and take another image
  • drop 2 f stops and take and image
  • Drop 3 f stops and take an image
  • drop 4 f stops and take an image
  • return to original shutter speed
  • add 1 f stop take and image
  • add 2 f stops and take and image
  • add 3 f stops and take and image
  • add 4 f stops and take and image
  • alet me that it is finished.
 
Last edited:

Erel

Administrator
Staff member
Licensed User
Version 4.50 is released. It is based on DJI SDK v4.11.1. It works with 64 bit devices and it is compatible with AndroidX SDK.
It requires B4A v9.5+.

There are some changes in the events. The ProductConnectivityChanged event was removed and there is a new BindingStateChanged event that is used instead.
See the two examples.
 
Status
Not open for further replies.
Top