Making a custom QGC like application

I am trying to build a custom mission control software to be deployed on the herelink.
I am building it using QtAndroid 5.15.0.
Using the SDL library I want to access the joystick and other buttons.
SDL initializes properly but I am somehow not able to fetch the controller using SDL_GameController().
I am also not able to get the joysticks using SDL_NumJoysticks().
By reading about herelink, I guess there hardware can only be accessed by QGC or Solex or the proprietary herelink app.
But as I am not sure, I want to know if it is possible to access the joystick and other buttons on the device?

Hi Sahil, I’m also playing around with the herelink to develop a custom app. This is my first go at Android (Kotlin using Android Studio), and wanted to see if I could interact with the Herelink’s peripherals before investing time to learn android app development. With some research and ‘luck’ I managed to interact with the joystick and buttons (except the power button) in my custom app using these methods:


import android.util.Log
import android.view.KeyEvent
import android.view.MotionEvent
import android.widget.Toast


override fun onGenericMotionEvent(event: MotionEvent) : Boolean {
        var joystick_2X = event.getAxisValue(MotionEvent.AXIS_X)
        var joystick_2Y = event.getAxisValue(MotionEvent.AXIS_Y)
        var joystick_1X = event.getAxisValue(MotionEvent.AXIS_Z)
        var joystick_1Y = event.getAxisValue(MotionEvent.AXIS_RZ)
        var joystick_wheel = event.getAxisValue(MotionEvent.AXIS_WHEEL)

        Log.d("joystick_1X : ", joystick_1X.toString())
        Log.d("joystick_1Y : ", joystick_1Y.toString())
        Log.d("joystick_2X : ", joystick_2X.toString())
        Log.d("joystick_2Y : ", joystick_2Y.toString())
        Log.d("joystick_wheel : ", joystick_wheel.toString())

        return super.onGenericMotionEvent(event);


override fun dispatchKeyEvent(event: KeyEvent): Boolean {
        Toast.makeText(this, "Key dispatch : " + event.keyCode.toString(), Toast.LENGTH_SHORT).show()
        return super.dispatchKeyEvent(event)

The keycode for each button is shown as an alert in the app as you press the buttons.
Hope this helps.

If you manage to use the telemetry within your custom app, please let me know how.

1 Like

Hi @kasparjj,
Thanks for your reply.
However I am building the app on Qt and am currently using QGamepad.
Although the joysticks work fine, there is some tweaking required in java to get the buttons to work

Till now I am trying to get the basics right and then move on to telemetry, but I will definitely let you know when I get there.