File tree Expand file tree Collapse file tree
java/io/mavsdk/mavsdkserver Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ ProGuard users may need to add the following rule:
70702 . For Android, run the ` mavsdk_server ` as follows:
7171
7272``` java
73- MavsdkServer server = new MavsdkServer (context );
73+ MavsdkServer server = new MavsdkServer ();
7474MavsdkEventQueue . executor(). execute(() - > server. run(SYSTEM_ADDRESS , MAVSDK_SERVER_PORT ));
7575```
7676
Original file line number Diff line number Diff line change 66
77#define LOGD (...) __android_log_print(ANDROID_LOG_DEBUG ," MAVSDK-Server" ,__VA_ARGS__)
88
9- extern " C" char * mavsdk_temp_path;
10-
119extern " C"
1210{
1311 JNIEXPORT jlong JNICALL
@@ -80,15 +78,4 @@ extern "C"
8078 mavsdk_server_destroy (mavsdk_server);
8179 }
8280
83- JNIEXPORT void JNICALL
84- Java_io_mavsdk_mavsdkserver_MavsdkServer_setTempDirectory (JNIEnv *env, jobject thiz, jstring temp_dir)
85- {
86- const char * temp_c_str = env->GetStringUTFChars (temp_dir, 0 );
87-
88- static char our_copy[256 ];
89- strncpy (our_copy, temp_c_str, sizeof (our_copy));
90- mavsdk_temp_path = our_copy;
91-
92- env->ReleaseStringUTFChars (temp_dir, temp_c_str);
93- }
9481};
Original file line number Diff line number Diff line change 11package io .mavsdk .mavsdkserver ;
22
3- import android .content .Context ;
4-
53public class MavsdkServer {
64
75 static {
86 java .lang .System .loadLibrary ("native_lib" );
97 }
108
11- public MavsdkServer (Context context ) {
12- String cacheDir = context .getCacheDir ().getAbsolutePath ();
13- setTempDirectory (cacheDir );
14- }
15-
16- public MavsdkServer (String tempDirectory ) {
17- setTempDirectory (tempDirectory );
18- }
19-
209 private long mavsdkServerHandle ;
2110
2211 /**
@@ -136,6 +125,4 @@ public void destroy() {
136125 }
137126
138127 private native void destroy (long mavsdkServerHandle );
139-
140- public native void setTempDirectory (String dir );
141128}
You can’t perform that action at this time.
0 commit comments