protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            client = new GoogleApiClientBuilder(this)
                     .AddApi(Android.Gms.Wearable.WearableClass.Api)
                     .AddConnectionCallbacks(this)
                     .AddOnConnectionFailedListener(this)
                     .Build();
            client.Connect();

            var v = FindViewById <WatchViewStub>(Resource.Id.watch_view_stub);

            v.LayoutInflated += delegate
            {
                var send = FindViewById <Button>(Resource.Id.send);
                send.Click += (sender, e) =>
                {
                    var month = new System.Random().Next(0, 11);
                    SendMessageAsync(month);
                };
            };
        }
Example #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            client = new GoogleApiClientBuilder(this)
                     .AddApi(Android.Gms.Wearable.WearableClass.Api)
                     .AddConnectionCallbacks(this)
                     .AddOnConnectionFailedListener(this)
                     .Build();
            client.Connect();
        }