Im making android app, that have to get connection with drone, subscribe to the camera and display video with the any view. Couldnt find any useful documentation for java - just this thing: https://mavsdk.mavlink.io/v1.4/en/faq.html but there is nothing about java.
So, i made two layouts: first one, that gets address and port, second one that have to display the video. There is onCreate, that inits the server. init code looks like this:
MavsdkServer server = new MavsdkServer();
private System drone;
private Camera camera;
public void initMavlink()
{
MavsdkEventQueue.executor().execute(() -> {
server.run(SYSTEM_ADDRESS, MAVSDK_SERVER_PORT);
drone = new System(SYSTEM_ADDRESS, MAVSDK_SERVER_PORT);
camera = drone.getCamera();
});
Completable completable = camera.startVideoStreaming();
}
public void onTelemetryReceived(Telemetry telemetry) {
}
Now i have no idea what to do, i cant find any method to subscribe streaming. Please, help me.
the dependencies i got:
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment:2.4.1'
implementation 'androidx.navigation:navigation-ui:2.4.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'io.mavsdk:mavsdk:1.3.1'
implementation 'io.mavsdk:mavsdk-server:1.3.1'
implementation 'io.dronefleet.mavlink:mavlink:1.1.11'
implementation 'com.arthenica:mobile-ffmpeg-full:4.4'