You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear all:
I am trying to use Dronekit-Android to develop an Android APP that can take off the plane on JMAVSim simulator. However, I cannot even connect the drone. If anybody knows, please reply, thanks. I posted my code as below. When I run the APP and click on the button, it crashes on the socket connection part. Am I using it right?
1. run JMAVSim on ubuntu sucessfully
#2. run my APP and press the button to connect
Dear all:
1. run JMAVSim on ubuntu sucessfully #2. run my APP and press the button to connectI am trying to use Dronekit-Android to develop an Android APP that can take off the plane on JMAVSim simulator. However, I cannot even connect the drone. If anybody knows, please reply, thanks. I posted my code as below. When I run the APP and click on the button, it crashes on the socket connection part. Am I using it right?
package com.o3dr.hellodrone;
import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.Toast;
import com.o3dr.android.client.ControlTower;
import com.o3dr.android.client.Drone;
import com.o3dr.android.client.interfaces.DroneListener;
import com.o3dr.android.client.interfaces.TowerListener;
import com.o3dr.services.android.lib.drone.attribute.AttributeEvent;
import com.o3dr.services.android.lib.drone.connection.ConnectionParameter;
import com.o3dr.services.android.lib.drone.connection.ConnectionResult;
import com.o3dr.services.android.lib.drone.connection.ConnectionType;
import com.o3dr.services.android.lib.drone.property.Type;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
//listen for events sent from the Drone library to APP
public class MainActivity extends ActionBarActivity implements DroneListener, TowerListener {
/*
@OverRide
public void onDroneConnectionFailed(ConnectionResult result) {
*/
@OverRide
public void onDroneServiceInterrupted(String errorMsg) {
}
The text was updated successfully, but these errors were encountered: