public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId) { string newToxid = intent.GetStringExtra("toxid"); string newPort = intent.GetStringExtra("port"); mBinder = new SharpLinkBinder(this); Utils.setLog(mBinder.Log); if (toxid != newToxid || port != newPort) { toxid = newToxid; port = newPort; Task.Run(() => { mSharpLink.Connect(new string[] { "23232", toxid, "127.0.0.1", port }); }); } return(StartCommandResult.RedeliverIntent); }
public override IBinder OnBind(Intent intent) { string newToxid = intent.GetStringExtra("toxid"); string newPort = intent.GetStringExtra("port"); mBinder = new SharpLinkBinder(this); Utils.setLog(mBinder.Log); if (toxid != newToxid || port != newPort) { toxid = newToxid; port = newPort; Task.Run(() => { mSharpLink.Connect(new string[] { "23232", toxid, "127.0.0.1", port }); }); } return(mBinder); }
public override void OnDestroy() { mBinder = null; base.OnDestroy(); }
public void OnServiceDisconnected(ComponentName name) { IsConnected = false; Binder.setClient(null); Binder = null; }
public void OnServiceConnected(ComponentName name, IBinder service) { Binder = service as SharpLinkBinder; IsConnected = Binder != null; Binder.setClient(client); }
public SharpLinkConnection(MainActivity client) { IsConnected = false; Binder = null; this.client = client; }