B4A Library DJI Drones UI - use DJI widgets in your App

This Library is based on the Source (thanx for sharing it!!) of the DJI Library posted here.
@Erel will combine the two libraries at some time. My permission is granted for this.

The difference in the two libs are that the DJI Drones UI Lib is using the Mobile UI Library from DJI. With the Mobile UI Library you are able to use some nice UI Widgets in your App.

Find out more about the UI Widget and their prefered Sizes here.

See this reference for a complete list of all widgets.
Please note that the "Panels" are not really working for me. I´m still investigating. But away from that there are some really nice to have Widgets and i do not want to hide them from you.

Here some examples:

DJITakeOffWidget

TAKEOFF.gif



DJIReturnHomeWidget

HOME.gif



DJIFlightModeWidget

FLIGHTMODE.gif





To use this Library instead of the Original DJI Library you need to replace the DJI.xml and DJI.jar with the ones attached to this post.
The Setup in the manifesteditor are the same. You can just use the Example

Additional you need to
download this Archive
(which contains the AAR and the additional jar). Copy all files in the zip to your additional Library folder.


DJI
Author:
Erel (Base) DonManfred (UIwidgets and additions)
Version: 4.5
  • CameraSettingAdvancedPanel
  • CameraSettingExposurePanel
  • DJICameraControlsWidget
  • DJIBatteryWidget
  • DJICameraControlsWidget
  • DJICompassWidget
  • DJIConnectionWidget
  • DJIDashboardWidget
  • DJIDistanceHomeWidget
  • DJIDistanceRCWidget
  • DJIExposureSettingsMenu
  • DJIFPVOverlayWidget
  • DJIFPVWidget
  • DJIFlightModeWidget
  • DJIFocusModeWidget
  • DJIGPSSignalWidget
  • DJIHorizontalVelocityWidget
  • DJIPictureVideoSwitch
  • DJIPreFlightCheckListPanel
  • DJIPreFlightStatusWidget
  • DJIRemainingFlightTimeWidget
  • DJIRemoteControlSignalWidget
  • DJIReturnHomeWidget
  • DJIVerticalVelocityWidget
  • DJIVideoSignalWidget
  • DJIWiFiSignalWidget
  • DJIAircraft
    Events:
    • BatteryState (Battery As Object, RemainingPercentage As Int)
    • ProductConnectivityChanged (Connected As Boolean)
    • Result (Success As Boolean, ErrorMessage As String)
    • ResultWithValue (Success As Boolean, ErrorMessage As String, Value As Object)
    Methods:
    • GetName As Object
      Gets the aircraft name. The ResultWithValue event will be raised.
      Returns an object that can be used as the sender filter parameter.
      Example:<code>
      Wait for (aircraft.GetName) Aircraft_ResultWithValue (Success As Boolean, ErrorMessage As String, Value As Object)
      If Success Then
      aircraftName = Value
      End If</code>
    • Initialize (EventName As String, AircraftData As Object)
      Initializes the object.
      EventName - Sets the subs that will handle the events.
      AircraftData - The parameter passed to DJISDKManager ProductChanged event.
    • IsInitialized As Boolean
    • RegisterBatteryStateEvent
      Registers the battery state listener.
    Properties:
    • BatteryReady As Boolean [read only]
      Returns true if the battery is ready.
    • CameraReady As Boolean [read only]
      Returns true if the camera is ready.
    • Connected As Boolean [read only]
    • Model As String [read only]
      Returns the model.
    • Tag As Object
  • DJIAltitudeWidget
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Padding()() As Int
    • Parent As Object [read only]
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
  • DJIAttitude
    Methods:
    • IsInitialized As Boolean
    Properties:
    • Pitch As Double [read only]
    • Roll As Double [read only]
    • Yaw As Double [read only]


  • DJICamera
    Events:
    • FrameReceived (Data() As Byte)
    Methods:
    • CreateVideoView As ConcreteViewWrapper
      Creates the view that will show the camera feed.
    • Initialize (EventName As String, Aircraft As DJIAircraftWrapper)
    • IsInitialized As Boolean
  • DJICameraCaptureWidget
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Padding()() As Int
    • Parent As Object [read only]
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Padding()() As Int
    • Parent As Object [read only]
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
  • DJIFlightController
    Events:
    • IMUStateChanged (State As DJIIMUState)
    • Result (Success As Boolean, ErrorMessage As String)
    • ResultWithValue (Success As Boolean, ErrorMessage As String, Value As Object)
    Methods:
    • AutoLanding As Object
      Starts an auto-landing action. The Result event will be raised.
      Returns an object that can be used as the sender filter parameter.
    • GetLEDsEnabled As Object
      Gets the LEDs status. The ResultWithValue event will be raised.
      Returns an object that can be used as the sender filter parameter.
      Example:<code>
      Wait For(controller.GetLEDsEnabled) Controller_ResultWithValue (Success As Boolean, ErrorMessage As String, Value As Object)
      If Success Then
      Log($"LED status: " ${Value}"$)
      End If</code>
    • GoHomeCancel As Object
      Cancels a go home action.
      The Result event will be raised.
    • GoHomeStart As Object
      Starts a go home action.
      The Result event will be raised.
    • Initialize (EventName As String, Aircraft As DJIAircraftWrapper)
      Initializes the flight controller.
    • IsInitialized As Boolean
    • SetGoHomeHeightInMeters (Height As Float) As Object
      Sets the go home flight height. Should be between 20 to 500.
      The Result event will be raised.
    • SetHomeLocationUsingAircraftCurrentLocation As Object
      Sets the home location based on the current aircraft location.
      The Result event will be raised.
      Example:<code>
      Dim sf As Object = controller.SetHomeLocationUsingAircraftCurrentLocation
      Wait For (sf) Controller_Result (Success As Boolean, ErrorMessage As String)
      If Success Then
      Log("Home location set.")
      Else
      Log("Error: " & ErrorMessage)
      End If</code>
    • SetLEDsEnabled (Enabled As Boolean) As Object
      Sets the LEDS status. The Result event will be raised.
      Returns an object that can be used as the sender filter parameter.
      Example: <code>
      Wait For (controller.SetLEDsEnabled(True)) Controller_Result (Success As Boolean, ErrorMessage As String)
      Log($"LED state changed. Success = ${Success}"$)</code>
    • TakeOff As Object
      Starts a takeoff action. The engine will start automatically.
      The Result event will be raised.
      Returns an object that can be used as the sender filter parameter.
    Properties:
    • Connected As Boolean [read only]
    • CurrentState As DJIFlightControllerCurrentStateWrapper [read only]
      Returns the current state.
    • Heading As Double [read only]
      Returns the aircraft heading.
    • SimulatorStarted As Boolean [read only]
      Returns true if the simulator has started.
    • Tag As Object
  • DJIFlightControllerCurrentState
    Methods:
    • IsInitialized As Boolean
    Properties:
    • AircraftLocation As DJILocation3DWrapper [read only]
      Returns the aircraft location.
    • AreMotorsOn As Boolean [read only]
      Returns true if the motors are on.
    • Attitude As DJIAttitudeWrapper [read only]
      Returns the aircraft attitude (pitch, roll and yaw).
    • FlightMode As String [read only]
      Returns the current flight mode.
      Possible values: Manual, Atti, AttiCourseLock, AttiHover, Hover, GPSBlake, GPSAtti, GPSCourseLock, GPSHomeLock, GPSHotPoint,
      AssistedTakeOff, AutoTakeOff, AutoLanding, AttiLanding, GPSWaypoint, GoHome, ClickGo, Joystick, AttiLimited,
      GPSAttiLimited, GPSFollowMe, Tracking, Pointing, PANO, Farming, FPV, GPSSport, GPSNovice,
      ConfirmLanding, TerrainTracking, NaviAdvGoHome, NaviAdvLanding, TripodGPS, TrackHeadLock, MotorsJustStarted, GPSGentle, Unknown
    • Flying As Boolean [read only]
      Returns True if the aircraft is flying.
    • GPSStatus As Int [read only]
      Returns 255 if there is no signal. Otherwise returns a value between 0 (weak signal) to 5 (strong signal).
    • GoHomeHeight As Float [read only]
      Returns the go home height in meters.
    • GoingHome As Boolean [read only]
      Returns True if the aircraft is going home.
    • HomeLocation As DJILocation2DWrapper [read only]
      Returns the home location.
    • HomeLocationSet As Boolean [read only]
      Returns true if the home location was set.
    • IMUPreheating As Boolean [read only]
      Returns True if the IMU is preheating.
    • SatelliteCount As Double [read only]
      Returns the number of GPS satellites found.
    • VelocityX As Double [read only]
      Returns the x-axis velocity measured in meters per second.
    • VelocityY As Double [read only]
      Returns the y-axis velocity measured in meters per second.
    • VelocityZ As Double [read only]
      Returns the z-axis velocity measured in meters per second.

  • DJIHotpointMissionOperator
    Events:
    • MissionFinish (Error As String)
    • MissionStart
    • MissionUpdate (Error As String, CurrentState As String, PreviousState As String, Radius As Float)
    • Result (Success As Boolean, ErrorMessage As String)
    • ResultWithValue (Success As Boolean, ErrorMessage As String, Value As Object)
    Methods:
    • Initialize (EventName As String)
      Initializes the mission operator.
    • IsInitialized As Boolean
    • Pause As Object
      Pauses a mission. The Result event will be raised.
    • Resume As Object
      Resumes a mission. The Result event will be raised.
    • StartMission (hotpointLat As Double, hotpointLon As Double, altitude As Double, radius As Double, angularVelocity As Float, isClockwise As Boolean, startPoint As String, heading As String) As Object
      Starts a mission. The Result event will be raised.
    • Stop As Object
      Stops a mission. The Result event will be raised.
    Properties:
    • Connected As Boolean [read only]
    • Tag As Object

  • DJIIMUState
    Methods:
    • IsInitialized As Boolean
    Properties:
    • AccelerometerStatus As String [read only]
      Returns one of the following values:
      UNKNOWN, DISCONNECTED, CALIBRATING, CALIBRATION_FAILED, DATA_EXCEPTION, WARMING_UP, IN_MOTION, NORMAL_BIAS, MEDIUM_BIAS, LARGE_BIAS.
    • CalibrationStatus As String [read only]
      Returns one of the following values:
      NONE, CALIBRATING, SUCCESSFUL, FAILED, UNKNOWN.
    • GyroscopeState As String [read only]
      Returns one of the following values:
      UNKNOWN, DISCONNECTED, CALIBRATING, CALIBRATION_FAILED, DATA_EXCEPTION, WARMING_UP, IN_MOTION, NORMAL_BIAS, MEDIUM_BIAS, LARGE_BIAS.

  • DJILocation2D
    Methods:
    • IsInitialized As Boolean
    Properties:
    • Latitude As Double [read only]
    • Longitude As Double [read only]

  • DJILocation3D
    Methods:
    • IsInitialized As Boolean
    Properties:
    • Altitude As Float [read only]
      Returns the altitude measured by barometer in meters (relative to the take off location).
    • Latitude As Double [read only]
    • Longitude As Double [read only]


  • DJISDKManager
    Events:
    • ComponentConnectivityChanged (Connected As Boolean)
    • ProductChanged (AircraftData As Object)
    • ProductConnectivityChanged (Connected As Boolean)
    • ProductName (Success As Boolean, Name As String)
    • RegisteredResult (Success As Boolean, ErrorMessage As String)
    Methods:
    • Initialize (EventName As String)
      Initializes the DJI SDK. The RegisteredResult event will be raised.
      Note that an internet connection is required on the first run.
    • StartConnectionToProduct
      Tries to connect to the product. The ProductChanged event will be raised.
    Properties:
    • Registered As Boolean [read only]
  • DJITakeOffWidget
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Padding()() As Int
    • Parent As Object [read only]
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int





  • DJIWaypoint
    Methods:
    • AddAction (Action As WaypointActionType, Parameter As Int)
      Adds an action that will be executed when the aircraft reaches the point.
      Action - One of the following values:
      STAY - Stays at the current point. Parameter = Period in milliseconds.
      START_TAKE_PHOTO - Starts to shoot a photo. Parameter is ignored.
      START_RECORD - Starts recordsing. Parameter is ignored.
      STOP_RECORD - Stops recording. Parameter is ignored.
      ROTATE_AIRCRAFT - Rotates the aircraft's yaw. Parameter should be between -180 to 180.
      GIMBAL_PITCH - Rotates the gimbal's pitch. Parameter should be between -90 to 0.
    • Initialize (Latitude As Double, Longitude As Double, Altitude As Float)
      Initializes the waypoint with the given coordinate and altitude (in meters).
    • IsInitialized As Boolean
    Properties:
    • TurnMode As String
    • actionRepeatTimes As Int
    • actionTimeoutInSeconds As Int
    • cornerRadiusInMeters As Float
    • gimbalPitch As Float
    • heading As Float
    • shootPhotoDistanceInterval As Float
    • shootPhotoTimeInterval As Float
    • speed As Float
    • waypointActions As List [read only]

  • DJIWaypointMissionBuilder
    Methods:
    • AddWaypoint (Waypoint As WaypointWrapper)
      Adds a waypoint.
    • Initialize
    • IsInitialized As Boolean
    • SetFinishAction (Action As WaypointMissionFinishedAction)
      Action that will be executed when the mission finishes.
      NO_ACTION - No further action will be taken on completion of mission.
      GO_HOME - The aircraft will go home and land.
      AUTO_LAND - The aircraft will land at the last waypoint.
      GO_FIRST_WAYPOINT - The aircraft will go to the first waypoint.
      CONTINUE_UNTIL_END - Mission will not end until StopMission is called.
    • setPointOfInterest (poiLat As Double, poiLon As Double)
    Properties:
    • AutoFlightSpeed As Float
      Gets or sets the auto flight speed (m/s). This is the default flight speed.
      Valid values are between -15 to 15.
    • HeadingMode As WaypointMissionHeadingMode
    • MaxFlightSpeed As Float
      Gets or sets the maximum flight speed (m/s). Maximum speed is achieved by pushing the throttle joystick.
    • PointOfInterest As LocationCoordinate2D [read only]
  • DJIWaypointMissionOperator
    Events:
    • MissionFinish (Error As String)
    • MissionProgress (ExecutionEvent As Object, TargetWaypointIndex As Int)
    • MissionStart
    • Result (Success As Boolean, ErrorMessage As String)
    • ResultWithValue (Success As Boolean, ErrorMessage As String, Value As Object)
    Methods:
    • Initialize (EventName As String)
      Initializes the mission operator.
    • IsInitialized As Boolean
    • LoadMission (MissionBuilder As WaypointMissionBuilderWrapper)
      Loads a mission. The next step is to upload it with UploadMission.
    • PauseMission As Object
      Pauses a mission. The Result event will be raised.
    • ResumeMission As Object
      Resumes a mission. The Result event will be raised.
    • StartMission As Object
      Starts a mission. The Result event will be raised.
    • StopMission As Object
      Stops a mission. The Result event will be raised.
    • UploadMission As Object
      Uploads a mission. The Result event will be raised.
    Properties:
    • Connected As Boolean [read only]
    • MissionState As String [read only]
      Returns the mission state.
      One of the following values: UNKNOWN, DISCONNECTED, NOT_SUPPORTED, RECOVERING, READY_TO_UPLOAD, UPLOADING, READY_TO_EXECUTE, EXECUTING, EXECUTION_PAUSED.
    • Tag As Object
 

Attachments

  • DJIUIV4.5.zip
    63.8 KB · Views: 656
  • src45.zip
    37 KB · Views: 650
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
This Library is based on the Source (thanx for sharing it!!) of the DJI Library posted here.
@Erel will combine the two libraries at some time. My permission is granted for this.

The difference in the two libs are that the DJI Drones UI Lib is using the Mobile UI Library from DJI. With the Mobile UI Library you are able to use some nice UI Widgets in your App.
I want to buy a drone, but then I should also find a rented apartment
 

PABLO2013

Well-Known Member
Licensed User
Longtime User
i have problem ... tks

Main_activity_create (línea B4A: 29)
Activity.LoadLayout ("1")
Java.lang.ExceptionInInitializerError
En dji.keysdk.KeyManager.getInstance (fuente desconocida)
En dji.ui.dga (Fuente Desconocida)
En dji.ui.base.d.registerDependentKeys (fuente desconocida)
En dji.ui.base.d.onAttachedToWindow (fuente desconocida)
En android.view.View.dispatchAttachedToWindow (View.java:12488)
En android.view.ViewGroup.dispatchAttachedToWindow (ViewGroup.java:2514)
En android.view.ViewGroup.addViewInner (ViewGroup.java:3477)
En android.view.ViewGroup.addView (ViewGroup.java:3309)
En anywheresoftware.b4a.objects.CustomViewWrapper.replaceBaseWithView (CustomViewWrapper.java:109)
En anywheresoftware.b4a.objects.DJIAltitudeWidgetWrapper.DesignerCreateView (DJIAltitudeWidgetWrapper.java:38)
En anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript (CustomViewWrapper.java:70)
En anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout (LayoutBuilder.java:158)
En anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout (ActivityWrapper.java:209)
En b4a.example.main._activity_create (main.java:366)
En java.lang.reflect.Method.invokeNative (Método nativo)
En java.lang.reflect.Method.invoke (Method.java:511)
En anywheresoftware.b4a.BA.raiseEvent2 (BA.java:186)
En b4a.example.main.afterFirstLayout (main.java:102)
En b4a.example.main.access $ 000 (main.java:17)
En b4a.example.main $ WaitForLayout.run (main.java:80)
En android.os.Handler.handleCallback (Handler.java:725)
En android.os.Handler.dispatchMessage (Handler.java:92)
En android.os.Looper.loop (Looper.java:137)
En android.app.ActivityThread.main (ActivityThread.java:5306)
En java.lang.reflect.Method.invokeNative (Método nativo)
En java.lang.reflect.Method.invoke (Method.java:511)
En com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:1102)
En com.android.internal.os.ZygoteInit.main (ZygoteInit.java:869)
En dalvik.system.NativeStart.main (Método nativo)
Causado por: java.lang.UnsatisfiedLinkError: Método nativo no encontrado: dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString :() Ljava / lang / String;
En dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString (Método nativo)
En dji.sdk.sdkmanager.DJISDKManager. <Clinit> (fuente desconocida)
... 29 más
 

PABLO2013

Well-Known Member
Licensed User
Longtime User
Greetings DonManfred ... a great library and a great work .... I still have problems ... I copied all the resources of aar to res directory ... but I do not succeed ... I am using the sample erel project With the manifiest and my keys, i only put a widget in a layout... tks

main$ResumableSub_Activity_Createresume (B4A line: 39)
Activity.LoadLayout("1")
java.lang.ExceptionInInitializerError
at dji.keysdk.KeyManager.getInstance(Unknown Source)
at dji.ui.d.g.a(Unknown Source)
at dji.ui.base.d.registerDependentKeys(Unknown Source)
at dji.ui.base.d.onAttachedToWindow(Unknown Source)
at android.view.View.dispatchAttachedToWindow(View.java:12488)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2514)
at android.view.ViewGroup.addViewInner(ViewGroup.java:3477)
at android.view.ViewGroup.addView(ViewGroup.java:3309)
at anywheresoftware.b4a.objects.CustomViewWrapper.replaceBaseWithView(CustomViewWrapper.java:109)
at anywheresoftware.b4a.objects.DJIAltitudeWidgetWrapper.DesignerCreateView(DJIAltitudeWidgetWrapper.java:38)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:70)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:158)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at b4a.dji.test1.main$ResumableSub_Activity_Create.resume(main.java:401)
at b4a.dji.test1.main._activity_create(main.java:374)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
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:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5306)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Native method not found: dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString:()Ljava/lang/String;
at dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString(Native Method)
at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown Source)
 

PABLO2013

Well-Known Member
Licensed User
Longtime User
Thanks donmanfred, I have been trying to make it work but I do not do it...
I send a small image according to what you sayme and nothing ...
you could indicate the structure in which this works for you ...
or indicate how to properly locate the resources.
I am using it with the erel example of waypoint and your library without adding any windge and still fails,
thanks
 

Attachments

  • dji.png
    dji.png
    50.1 KB · Views: 439

shb777

Active Member
Licensed User
Longtime User
I have been working on my dji app for a month now, a I just found this page yesterday! looks good! is there any sample code on how to use this library, or other documentation of this library?
To be specific, regarding the CameraCaptureWidget, how would I use that in my b4a program? Can I stop and start video recording with that widget?
Also, it looks like you listed the CameraCaptureWidget's methods and properties twice.

Steve
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User

shb777

Active Member
Licensed User
Longtime User
I have been working on my dji app for a month now, a I just found this page yesterday! looks good! is there any sample code on how to use this library, or other documentation of this library? Steve
ok that worked! great! so a widget is like a vb control. really, what i want to do with my
app, is start recording as soon as i'm powered up, without having to tap the widget or hit record on the rc. so i don't have to worry about forgetting to start recording. litchi has
this feature. is there any way i can do this once the widget added to the designer? so i would like to do this with code in AfterAircraftConnected. steve
 
Last edited:

shb777

Active Member
Licensed User
Longtime User
OMG!

Is the question real? I suggest to go over the B4A Beginners Guide and learn to work with layouts.
so I guess that means no. Steve in visual basic, if you have a mediaplayer control in your program, you can either click the pause button with the mouse, or write code that says mediaplayer1.pause
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
app, is start recording as soon as i'm powered up, without having to tap the widget or hit record on the rc. so i don't have to worry about forgetting to start recording. litchi has
It is not possible with the widgets. The Widget are a user-ui to give them easy access to this feature.
A feature like the one in Litchi must be coded by you.
It is not part of the DJI or the DJI-UI library at this time.

PD: You edited your question, right? At the time i was answering there was no such question if i remember correctly.
 

shb777

Active Member
Licensed User
Longtime User
It is not possible with the widgets. The Widget are a user-ui to give them easy access to this feature.
A feature like the one in Litchi must be coded by you.
It is not part of the DJI or the DJI-UI library at this time.

PD: You edited your question, right? At the time i was answering there was no such question if i remember correctly.
yes i did edit it. thanks for your reply. these new widgets will give me a lot to do this weekend. steve
 

shb777

Active Member
Licensed User
Longtime User
Have a look at the waypoint mission and the waypointactions. A Feature like this should be possible with the WPActions.
For sure. Not at powered up but after you started a Waypointmission.

ok thanks. i'll investigate that. I also had another idea. Informatix says his donation version of the gesturedetector library will allow you to click
any point on the screen programmaticly. so maybe i can add code to click the CameraCaptureWidget in AfterAircraftConnected. steve
 

shb777

Active Member
Licensed User
Longtime User
waldo.jpg
I put the dashboard widget over the pnlCamera, compile it, but when I run it's appearing over my google mapfragment. See pictures. What is going wrong? Steve
dashboard panel.jpg
 
Top