Пример #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            this.ServiceConnection = new ConnectionServiceConnection(this);
            this.ServiceConnection.Connect(this);
            this.RequestHome();
        }
Пример #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_connect);
            this.Preferences = this.GetSharedPreferences("app", FileCreationMode.Private);

            this.IpAddressText        = this.FindViewById <EditText>(Resource.Id.ip_text);
            this.ConnectButton        = this.FindViewById <Button>(Resource.Id.connect_button);
            this.ConnectButton.Click += this.ConnectButtonClick;
            this.DiscoveryList        = this.FindViewById <RecyclerView>(Resource.Id.recyclerView);
            this.DiscoveryList.SetLayoutManager(new LinearLayoutManager(this));
            this.Adapter            = new DiscoveredDeviceAdapter();
            this.Adapter.ItemClick += this.DiscoveredDeviceClick;
            this.DiscoveryList.SetAdapter(this.Adapter);

            this.ServiceConnection = new ConnectionServiceConnection(this);
            this.ServiceConnection.Connect(this);

            Discoverer.DeviceFound += this.DeviceDiscovered;
        }
Пример #3
0
 public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     this.ServiceConnection = new ConnectionServiceConnection(this);
     this.ServiceConnection.Connect(this.Activity);
 }