void ConnectGoogleApiClient()
		{
			googleApiClient = new GoogleApiClient.Builder(this)
				.AddApi(WearableClass.API)
				.AddConnectionCallbacks(
					async connectionHint =>
					{
						if (Log.IsLoggable(Tag, LogPriority.Info))
						{
							Log.Info(Tag, "Connected to the Google API client");
						}

						stepCountOn = await XFitWatchfaceConfigHelper.ReadStepCountStatus(googleApiClient);
						UpdateUI();
					},
					cause =>
					{
						if (Log.IsLoggable(Tag, LogPriority.Info))
						{
							Log.Info(Tag, "Connection suspended");
						}
					}
				)
				.Build();

			googleApiClient.Connect();
		}
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.activity_main);
			mClient = new GoogleApiClient.Builder (this).AddApi (AppIndex.APP_INDEX_API).Build ();
			OnNewIntent (Intent);
		}
		void BuildFitnessClient ()
		{
			var clientConnectionCallback = new ClientConnectionCallback ();
            clientConnectionCallback.OnConnectedImpl = () => Subscribe ();
			// Create the Google API Client
			mClient = new GoogleApiClient.Builder (this)
				.AddApi (FitnessClass.RECORDING_API)
				.AddScope (new Scope (Scopes.FitnessActivityRead))
				.AddConnectionCallbacks (clientConnectionCallback)
				.AddOnConnectionFailedListener ((ConnectionResult result) => {
					Log.Info (TAG, "Connection failed. Cause: " + result.ToString ());
					if (!result.HasResolution) {
						// Show the localized error dialog
						GooglePlayServicesUtil.GetErrorDialog (result.ErrorCode, this, 0).Show ();
						return;
					}
					// The failure has a resolution. Resolve it.
					// Called typically when the app is not yet authorized, and an
					// authorization dialog is displayed to the user.
					if (!authInProgress) {
						try {
							Log.Info (TAG, "Attempting to resolve failed connection");
							result.StartResolutionForResult (this, REQUEST_OAUTH);
						} catch (IntentSender.SendIntentException e) {
							Log.Error (TAG, "Exception while starting resolution activity", e);
						}
					}
				}).Build ();
		}
        protected override void OnCreate (Bundle savedInstanceState) 
        {
            base.OnCreate (savedInstanceState);
            SetContentView (Resource.Layout.person_list_activity);

            var options = new PlusClass.PlusOptions.Builder ()
                .AddActivityTypes (MomentUtil.ACTIONS).Build();
            
            mGoogleApiClient = new GoogleApiClient.Builder (this)
                .AddConnectionCallbacks (this)
                .AddOnConnectionFailedListener (this)
                .AddApi (PlusClass.API, options)
                .AddScope (PlusClass.ScopePlusLogin)
                .Build();

            mListItems = new List<String>();
            mListAdapter = new ArrayAdapter<String>(this,
                Android.Resource.Layout.SimpleListItem1, mListItems);
            mPersonListView = FindViewById<ListView> (Resource.Id.person_list);
            mResolvingError = savedInstanceState != null
                && savedInstanceState.GetBoolean (STATE_RESOLVING_ERROR, false);

            int available = GooglePlayServicesUtil.IsGooglePlayServicesAvailable (this);
            if (available != CommonStatusCodes.Success)
                ShowDialog (DIALOG_GET_GOOGLE_PLAY_SERVICES);

            if (Build.VERSION.SdkInt >= BuildVersionCodes.Honeycomb)
                this.ActionBar.SetDisplayHomeAsUpEnabled(true);
        }
Esempio n. 5
0
        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            listView = FindViewById<ListView> (Resource.Id.listView);
            textSearch = FindViewById<AutoCompleteTextView> (Resource.Id.textSearch);

            googleApiClient = new GoogleApiClient.Builder (this)
                .EnableAutoManage (this, 0, this)
                .AddApi (PlacesClass.GEO_DATA_API)
                .Build ();

            adapter = new PlacesAutocompleteAdapter (this, googleApiClient, BOUNDS_GREATER_SYDNEY, null);
            textSearch.Adapter = adapter;


            textSearch.ItemClick += (sender, e) => {
                var item = adapter [e.Position];

                // Go to details of place:
                var intent = new Intent (this, typeof (PlaceDetailsActivity));
                intent.PutExtra ("PLACE_ID", item.PlaceId);
                StartActivity (intent);
            };
        }
        protected override void OnCreate(Android.OS.Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
           
            SetContentView(Resource.Layout.activity_detail);

            friends = Util.GenerateFriends();
            imageLoader = ImageLoader.Instance;

            var toolbar = FindViewById<V7Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            if (monkey == null)
            { 
                var t = Intent.GetStringExtra("Name");
                monkey = friends.First(m => m.Name == t);
            }

            ShowMonkey();


            client = new GoogleApiClient.Builder(this).AddApi(AppIndex.API).Build();
            url = $"http://monkeysapp.com/Home/Detail/{monkey.Name.Replace(" ", "%20")}";
            title = monkey.Name;
            description = monkey.Details;
            schemaType = "http://schema.org/Article";
        }
			void ConnectGoogleApiClient()
			{
				googleApiClient = new GoogleApiClient.Builder(owner)
					.AddApi(FitnessClass.HISTORY_API)
					.AddApi(FitnessClass.RECORDING_API)
					.UseDefaultAccount()
					.AddConnectionCallbacks(
						connectionHint =>
						{
							if (Log.IsLoggable(Tag, LogPriority.Info))
							{
								Log.Info(Tag, "Connected to the Google API client");
							}

							ConnectFitnessApi();
						},
						cause =>
						{
							if (Log.IsLoggable(Tag, LogPriority.Info))
							{
								Log.Info(Tag, "Connection suspended");
							}
						}
					)
					.Build();

				googleApiClient.Connect();
			}
		public async static Task<bool> ReadStepCountStatus(GoogleApiClient googleApiClient)
		{
			var nodeApiLocalNode = await WearableClass.NodeApi.GetLocalNodeAsync(googleApiClient);
			if (nodeApiLocalNode == null || !nodeApiLocalNode.Status.IsSuccess || nodeApiLocalNode.Node == null)
			{
				// error
			}
			else {
				var localNode = nodeApiLocalNode.Node.Id;
				var uri = new Android.Net.Uri.Builder()
							.Scheme("wear")
							.Path(PathWithFeature)
							.Authority(localNode)
							.Build();
				var dataItemResult = await WearableClass.DataApi.GetDataItemAsync(googleApiClient, uri) as IDataApiDataItemResult;
				if (dataItemResult == null || !dataItemResult.Status.IsSuccess || dataItemResult.DataItem == null)
				{
					// not found
				}
				else {
					var dataMapItem = DataMapItem.FromDataItem(dataItemResult.DataItem);
					var stepCountOn = dataMapItem.DataMap.GetBoolean("stepcount");
					return stepCountOn;
				}
			}
			return true; // default is "ON"
		}
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.activity_main);

			if (savedInstanceState != null) {
				mIsResolving = savedInstanceState.GetBoolean (KEY_IS_RESOLVING);
				mShouldResolve = savedInstanceState.GetBoolean (KEY_SHOULD_RESOLVE);
			}

			FindViewById (Resource.Id.sign_in_button).SetOnClickListener (this);
			FindViewById (Resource.Id.sign_out_button).SetOnClickListener (this);
			FindViewById (Resource.Id.disconnect_button).SetOnClickListener (this);

			FindViewById<SignInButton> (Resource.Id.sign_in_button).SetSize (SignInButton.SizeWide);
			FindViewById (Resource.Id.sign_in_button).Enabled = false;

			mStatus = FindViewById<TextView> (Resource.Id.status);

			mGoogleApiClient = new GoogleApiClient.Builder (this)
				.AddConnectionCallbacks (this)
				.AddOnConnectionFailedListener (this)
				.AddApi (PlusClass.API)
				.AddScope (new Scope (Scopes.Profile))
				.Build ();
		}
Esempio n. 10
0
		void BuildFitnessClient ()
		{
			var clientConnectionCallback = new ClientConnectionCallback ();
            clientConnectionCallback.OnConnectedImpl = () => FindFitnessDataSources ();
			mClient = new GoogleApiClient.Builder (this)
				.AddApi (FitnessClass.SENSORS_API)
				.AddScope (new Scope (Scopes.FitnessLocationRead))
				.AddConnectionCallbacks (clientConnectionCallback)
				.AddOnConnectionFailedListener ((ConnectionResult result) => {
					Log.Info(TAG, "Connection failed. Cause: " + result);
					if (!result.HasResolution) {
						// Show the localized error dialog
						GooglePlayServicesUtil.GetErrorDialog (result.ErrorCode, this, 0).Show ();
								return;
					}
					if (!authInProgress) {
						try {
							Log.Info (TAG, "Attempting to resolve failed connection");
							authInProgress = true;
							result.StartResolutionForResult (this, REQUEST_OAUTH);
						} catch (IntentSender.SendIntentException e) {
							Log.Error (TAG, "Exception while starting resolution activity", e);
						}
					}
				}).Build ();
		}
Esempio n. 11
0
 private void Init (Context ctx)
 {
     googleApiClient = new GoogleApiClient.Builder (ctx)
     .AddApi (WearableClass.API)
     .Build ();
     googleApiClient.Connect ();
 }
		public static void SaveStepCountStatus(GoogleApiClient googleApiClient, bool stepCountOn)
		{
			var putDataMapRequest = PutDataMapRequest.Create(PathWithFeature);
			putDataMapRequest.DataMap.PutBoolean("stepcount", stepCountOn);
			var putDataRequest = putDataMapRequest.AsPutDataRequest();
			putDataRequest.SetUrgent();
			WearableClass.DataApi.PutDataItem(googleApiClient, putDataRequest);
		}
Esempio n. 13
0
		protected void buildGoogleApiClient ()
		{
			mGoogleApiClient = new GoogleApiClient.Builder (this)
				.AddConnectionCallbacks (this)
				.AddOnConnectionFailedListener (this)
				.AddApi (Android.Gms.Location.ActivityRecognition.API)
				.Build ();
		}
		public override void OnCreate ()
		{
			base.OnCreate ();
			mGoogleApiClient = new GoogleApiClient.Builder (this.ApplicationContext)
				.AddApi (WearableClass.API)
				.Build ();
			mGoogleApiClient.Connect ();
		}
Esempio n. 15
0
		protected void BuildGoogleApiClient ()
		{
			mGoogleApiClient = new GoogleApiClient.Builder (this)
				.AddConnectionCallbacks (this)
				.AddOnConnectionFailedListener (this)
				.AddApi (LocationServices.API)
				.Build ();
		}
        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            buttonCheck = FindViewById<Button> (Resource.Id.buttonCheck);
            buttonVerify = FindViewById<Button> (Resource.Id.buttonVerify);
            buttonVerify.Enabled = false;

            googleApiClient = new GoogleApiClient.Builder (this)
                .EnableAutoManage (this, 1, result => {
                    Toast.MakeText (this, "Failed to connect to Google Play Services", ToastLength.Long).Show ();
                })
                .AddApi (SafetyNetClass.API)
                .Build ();

            buttonCheck.Click += async delegate {
                
                var nonce = Nonce.Generate (); // Should be at least 16 bytes in length.
                var r = await SafetyNetClass.SafetyNetApi.AttestAsync (googleApiClient, nonce);

                if (r.Status.IsSuccess) {

                    // Store for future verification with google servers
                    attestationResult = r;

                    // Get the JSON from the JWS result by decoding
                    var decodedResult = r.DecodeJwsResult (nonce);

                    string error = null;

                    // Try and verify the body of the response
                    if (VerifyAttestResponse (decodedResult, nonce, out error)) {
                        Toast.MakeText (this, "Compatibility Passed!", ToastLength.Long).Show ();
                        buttonVerify.Enabled = true;
                    } else {
                        Toast.MakeText (this, "Compatibility Failed: " + error, ToastLength.Long).Show ();
                    }
                } else {
                    // Error
                    Toast.MakeText (this, "Failed to Check Compatibility", ToastLength.Long).Show ();
                }
            };


            buttonVerify.Click += async delegate {
               
                // Validate the JWS response with Google to ensure it came from them
                var valid = await attestationResult.ValidateWithGoogle (DEVELOPERS_CONSOLE_API_KEY);

                if (valid)
                    Toast.MakeText (this, "Successfully validated response with Google!", ToastLength.Short).Show ();
                else
                    Toast.MakeText (this, "Failed response validation with Google!", ToastLength.Short).Show ();
            };
        }
		public override void OnCreate ()
		{
			base.OnCreate ();
			mGoogleApiClient = new GoogleApiClient.Builder (this)
				.AddApi (WearableClass.API)
				.AddConnectionCallbacks (this)
				.AddOnConnectionFailedListener (this)
				.Build();
		}
Esempio n. 18
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.activity_phone);
			googleApiClient = new GoogleApiClient.Builder (this)
				.AddApi (WearableClass.API)
				.AddConnectionCallbacks (this)
				.AddOnConnectionFailedListener (this)
				.Build ();
		}
		public override void OnCreate ()
		{
			base.OnCreate ();
			if (Log.IsLoggable (Constants.TAG, LogPriority.Info))
				Log.Info (Constants.TAG, "HomeListenerService created");
			mGoogleApiClient = new GoogleApiClient.Builder (this.ApplicationContext)
				.AddApi (WearableClass.API)
				.Build ();
			mGoogleApiClient.Connect ();
		}
        private void Initialize()
        {
            this.client = new GoogleApiClient.Builder(Application.Context)
                .AddApi(DriveClass.API)
                .AddScope(DriveClass.ScopeFile)
                .AddConnectionCallbacks(this)
                .AddOnConnectionFailedListener(this)
                .Build();

            client.Connect();
        }
Esempio n. 21
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.main);
			mLogTextView = (TextView)FindViewById (Resource.Id.log);
			mSCroller = (ScrollView)FindViewById (Resource.Id.scroller);
			mGoogleApiClient = new GoogleApiClient.Builder (this).AddApi (WearableClass.API)
				.AddConnectionCallbacks (this)
				.AddOnConnectionFailedListener (this)
				.Build ();
		}
Esempio n. 22
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.main_activity);
			mGoogleApiClient = new GoogleApiClient.Builder (this)
				.AddApi (WearableClass.API)
				.AddConnectionCallbacks (this)
				.AddOnConnectionFailedListener (this)
				.Build ();
			FindViewById (Resource.Id.start_wearable_activity).Click += delegate {
				OnStartWearableActivityClick (null);
			};
		}
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.deep_link_activity);

			FindViewById (Resource.Id.button_ok).SetOnClickListener (this);

			googleApiClient = new GoogleApiClient.Builder (this)
				.AddConnectionCallbacks (this)
				.EnableAutoManage (this, 0, this)
				.AddApi (Android.Gms.AppInvite.AppInviteClass.API)
				.Build ();
		}
Esempio n. 24
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.Main);

			// Set up Google Play location service
			apiClient = new GoogleApiClient.Builder (this, this, this)
				.AddApi (LocationServices.API).Build ();
			apiClient.Connect ();

			lastLocationButton = FindViewById<Button> (Resource.Id.lastLocationButton);
			locationTextView = FindViewById<TextView> (Resource.Id.locationTextView);
			
			// Clicking the button will make a one-time call to get the device's last known location
			lastLocationButton.Click += delegate {
				Android.Locations.Location location = LocationServices.FusedLocationApi.GetLastLocation (apiClient);
				locationTextView.Text = "Last location:\n";
				DisplayLocation(location);
			};		

			locationUpdateButton = FindViewById<Button> (Resource.Id.locationUpdateButton);

			// Clicking the button will send a request for continuous updates
			locationUpdateButton.Click += async delegate {
				if (apiClient.IsConnected)
				{
					locationTextView.Text = "Requesting Location Updates";
					var locRequest = new LocationRequest();

					// Setting location priority to PRIORITY_HIGH_ACCURACY (100)
					locRequest.SetPriority(100);

					// Setting interval between updates, in milliseconds
					// NOTE: the default FastestInterval is 1 minute. If you want to receive location updates more than 
					// once a minute, you _must_ also change the FastestInterval to be less than or equal to your Interval
					locRequest.SetFastestInterval(500);
					locRequest.SetInterval(1000);

					// pass in a location request and LocationListener
					await LocationServices.FusedLocationApi.RequestLocationUpdates (apiClient, locRequest, this);
					// In OnLocationChanged (below), we will make calls to update the UI
					// with the new location data
				}
				else
				{
					locationTextView.Text = "Client API not connected";
				}
			};
		}
Esempio n. 25
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.main_activity);
			delayedConfirmationView = FindViewById<DelayedConfirmationView> (Resource.Id.delayed_confirmation);
			delayedConfirmationView.SetTotalTimeMs (NUM_SECONDS * 1000);
			mGoogleApiClient = new GoogleApiClient.Builder (this)
				.AddApi (WearableClass.Api)
				.AddOnConnectionFailedListener (this)
				.Build ();
			FindViewById (Resource.Id.start_timer).Click += delegate {
				OnStartTimer (null);
			};
		}
 public override void OnCreate (Android.OS.Bundle savedInstanceState)
 {
     base.OnCreate (savedInstanceState);
     if (savedInstanceState != null)
         mPromoWasSelected = savedInstanceState.GetBoolean (KEY_PROMO_CLICKED);
     
     var accountName = ((BikestoreApplication) Activity.Application).AccountName;
     var options = new Android.Gms.Identity.Intents.Address.AddressOptions (WalletConstants.ThemeLight);
     mGoogleApiClient = new GoogleApiClient.Builder (Activity)
         .AddApi (Android.Gms.Identity.Intents.Address.Api, options)
         .SetAccountName (accountName)
         .AddConnectionCallbacks (this)
         .AddOnConnectionFailedListener (this)
         .Build();
 }
Esempio n. 27
0
        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);

            googleApiClient = new GoogleApiClient.Builder (this)
                .AddApi (AppIndex.API)
                .Build ();
            
            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            textId = FindViewById<TextView> (Resource.Id.textId);

            if (Intent != null)
                OnNewIntent (Intent);
        }
        protected override void OnCreate (Android.OS.Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.PlaceDetails);

            textTitle = FindViewById<TextView> (Resource.Id.textTitle);
            textDetails = FindViewById<TextView> (Resource.Id.textDetails);
            textInfo = FindViewById<TextView> (Resource.Id.textInfo);

            googleApiClient = new GoogleApiClient.Builder (this)
                .AddConnectionCallbacks (this)
                .AddOnConnectionFailedListener (this)
                .AddApi (PlacesClass.GEO_DATA_API)
                .Build ();
        }
Esempio n. 29
0
        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            textLastLocation = FindViewById<TextView> (Resource.Id.textLastLocation);
            textLocationUpdates = FindViewById<TextView> (Resource.Id.textLocationUpdates);

            googleApiClient = new GoogleApiClient.Builder (this)
                .AddApi (Android.Gms.Location.LocationServices.API)
                .AddConnectionCallbacks (this)
                .AddOnConnectionFailedListener (this)
                .Build ();
            googleApiClient.Connect ();
        }
Esempio n. 30
0
        public override void OnCreate (Android.OS.Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            if (savedInstanceState != null)
                mSignInButtonClicked = savedInstanceState.GetBoolean (KEY_SIGNIN_BUTTON_CLICKED);
            
            var args = Arguments;
            if (args != null)
                mLoginAction = args.GetInt (LoginActivity.EXTRA_ACTION);
            
            var options = new PlusClass.PlusOptions.Builder ().Build ();
            mGoogleApiClient = new GoogleApiClient.Builder (Activity)
                .AddApi (PlusClass.API, options)
                .AddConnectionCallbacks (this)
                .AddOnConnectionFailedListener(this)
                .AddScope (PlusClass.ScopePlusProfile)
                .AddScope (new Scope (WALLET_SCOPE))
                .Build ();
        }
Esempio n. 31
0
 public static async Task <Statuses> RemoveGeofencesAsync(this IGeofencingApi api, GoogleApiClient client, IList <string> geofenceRequestIds)
 {
     return((await api.RemoveGeofences(client, geofenceRequestIds)).JavaCast <Statuses> ());
 }
 public async Task <RemoteMediaPlayer.IMediaChannelResult> QueueInsertItemsAsync(GoogleApiClient apiClient, Android.Gms.Cast.MediaQueueItem[] itemsToInsert, int insertBeforeItemId, Org.Json.JSONObject customData)
 {
     return((await QueueInsertItems(apiClient, itemsToInsert, insertBeforeItemId, customData)).JavaCast <RemoteMediaPlayer.IMediaChannelResult> ());
 }
Esempio n. 33
0
 public static async Task <LocationSettingsResult> CheckLocationSettingsAsync(this ISettingsApi api, GoogleApiClient client, LocationSettingsRequest request)
 {
     return((await api.CheckLocationSettings(client, request)).JavaCast <Android.Gms.Location.LocationSettingsResult> ());
 }
 public async Task <RemoteMediaPlayer.IMediaChannelResult> QueueAppendItemAsync(GoogleApiClient apiClient, Android.Gms.Cast.MediaQueueItem item, Org.Json.JSONObject customData)
 {
     return((await QueueAppendItem(apiClient, item, customData)).JavaCast <RemoteMediaPlayer.IMediaChannelResult> ());
 }
 public async Task <RemoteMediaPlayer.IMediaChannelResult> QueuePrevAsync(GoogleApiClient apiClient, Org.Json.JSONObject customData)
 {
     return((await QueuePrev(apiClient, customData)).JavaCast <RemoteMediaPlayer.IMediaChannelResult> ());
 }
Esempio n. 36
0
 public static async Task <Statuses> SetMockModeAsync(this IFusedLocationProviderApi api, GoogleApiClient client, bool isMockMode)
 {
     return((await api.SetMockMode(client, isMockMode)).JavaCast <Statuses> ());
 }
 public async Task <RemoteMediaPlayer.IMediaChannelResult> QueueInsertAndPlayItemAsync(GoogleApiClient apiClient, Android.Gms.Cast.MediaQueueItem item, int insertBeforeItemId, long playPosition, Org.Json.JSONObject customData)
 {
     return((await QueueInsertAndPlayItem(apiClient, item, insertBeforeItemId, playPosition, customData)).JavaCast <RemoteMediaPlayer.IMediaChannelResult> ());
 }
Esempio n. 38
0
 public static int getSdkVariant(GoogleApiClient arg_GoogleApiClient_1)
 {
     return(JavaObjWrapper.StaticInvokeCall <int>(CLASS_NAME, "getSdkVariant", "(Lcom/google/android/gms/common/api/GoogleApiClient;)I", arg_GoogleApiClient_1));
 }
Esempio n. 39
0
 public static object getSettingsIntent(GoogleApiClient arg_GoogleApiClient_1)
 {
     return(JavaObjWrapper.StaticInvokeCall <object>(CLASS_NAME, "getSettingsIntent", "(Lcom/google/android/gms/common/api/GoogleApiClient;)Landroid/content/Intent;", arg_GoogleApiClient_1));
 }
 public async Task <RemoteMediaPlayer.IMediaChannelResult> QueueJumpToItemAsync(GoogleApiClient apiClient, int itemId, Org.Json.JSONObject customData)
 {
     return((await QueueJumpToItem(apiClient, itemId, customData)).JavaCast <RemoteMediaPlayer.IMediaChannelResult> ());
 }
 public async Task <RemoteMediaPlayer.IMediaChannelResult> QueueLoadAsync(GoogleApiClient apiClient, Android.Gms.Cast.MediaQueueItem[] items, int startIndex, int repeatMode, Org.Json.JSONObject customData)
 {
     return((await QueueLoad(apiClient, items, startIndex, repeatMode, customData)).JavaCast <RemoteMediaPlayer.IMediaChannelResult> ());
 }
 public static async Task <CastClass.IApplicationConnectionResult> JoinApplicationAsync(this CastClass.ICastApi api, GoogleApiClient client, string applicationId, string sessionId)
 {
     return((await api.JoinApplication(client, applicationId, sessionId)).JavaCast <CastClass.IApplicationConnectionResult> ());
 }
Esempio n. 43
0
 public static void setGravityForPopups(GoogleApiClient arg_GoogleApiClient_1, int arg_int_2)
 {
     JavaObjWrapper.StaticInvokeCallVoid(CLASS_NAME, "setGravityForPopups", "(Lcom/google/android/gms/common/api/GoogleApiClient;I)V", arg_GoogleApiClient_1, arg_int_2);
 }
Esempio n. 44
0
 public static async Task <Statuses> RemoveGeofencesAsync(this IGeofencingApi api, GoogleApiClient client, Android.App.PendingIntent pendingIntent)
 {
     return((await api.RemoveGeofences(client, pendingIntent)).JavaCast <Statuses> ());
 }
 public async Task <RemoteMediaPlayer.IMediaChannelResult> LoadAsync(GoogleApiClient apiClient, Android.Gms.Cast.MediaInfo mediaInfo, bool autoplay, long playPosition, long[] activeTrackIds, Org.Json.JSONObject customData)
 {
     return((await Load(apiClient, mediaInfo, autoplay, playPosition, activeTrackIds, customData)).JavaCast <RemoteMediaPlayer.IMediaChannelResult> ());
 }
Esempio n. 46
0
 public static async Task <Statuses> SetMockLocationAsync(this IFusedLocationProviderApi api, GoogleApiClient client, global::Android.Locations.Location mockLocation)
 {
     return((await api.SetMockLocation(client, mockLocation)).JavaCast <Statuses> ());
 }
Esempio n. 47
0
 public static async Task <Statuses> AddGeofencesAsync(this IGeofencingApi api, GoogleApiClient client, IList <IGeofence> geofences, Android.App.PendingIntent pendingIntent)
 {
     return((await api.AddGeofences(client, geofences, pendingIntent)).JavaCast <Statuses> ());
 }
Esempio n. 48
0
 public static async Task <Statuses> RequestLocationUpdatesAsync(this IFusedLocationProviderApi api, GoogleApiClient client, LocationRequest request, ILocationListener listener, Android.OS.Looper looper)
 {
     return((await api.RequestLocationUpdates(client, request, listener, looper)).JavaCast <Statuses> ());
 }
Esempio n. 49
0
 public static async Task <Statuses> RemoveLocationUpdatesAsync(this IFusedLocationProviderApi api, GoogleApiClient client, ILocationListener listener)
 {
     return((await api.RemoveLocationUpdates(client, listener)).JavaCast <Statuses> ());
 }
 public async Task <RemoteMediaPlayer.IMediaChannelResult> QueueMoveItemToNewIndexAsync(GoogleApiClient apiClient, int itemId, int newIndex, Org.Json.JSONObject customData)
 {
     return((await QueueMoveItemToNewIndex(apiClient, itemId, newIndex, customData)).JavaCast <RemoteMediaPlayer.IMediaChannelResult> ());
 }
Esempio n. 51
0
 public Games_BaseGamesApiMethodImpl(GoogleApiClient arg_GoogleApiClient_1)
 {
     base.CreateInstance(CLASS_NAME, arg_GoogleApiClient_1);
 }
Esempio n. 52
0
 public static string getCurrentAccountName(GoogleApiClient arg_GoogleApiClient_1)
 {
     return(JavaObjWrapper.StaticInvokeCall <string>(CLASS_NAME, "getCurrentAccountName", "(Lcom/google/android/gms/common/api/GoogleApiClient;)Ljava/lang/String;", arg_GoogleApiClient_1));
 }
Esempio n. 53
0
 public static async Task <Statuses> RequestActivityUpdatesAsync(this IActivityRecognitionApi api, GoogleApiClient client, long detectionIntervalMillis, Android.App.PendingIntent callbackIntent)
 {
     return((await api.RequestActivityUpdates(client, detectionIntervalMillis, callbackIntent)).JavaCast <Statuses> ());
 }
Esempio n. 54
0
 public static PendingResult <Status> signOut(GoogleApiClient arg_GoogleApiClient_1)
 {
     return(JavaObjWrapper.StaticInvokeCall <PendingResult <Status> >(CLASS_NAME, "signOut", "(Lcom/google/android/gms/common/api/GoogleApiClient;)Lcom/google/android/gms/common/api/PendingResult;", arg_GoogleApiClient_1));
 }
Esempio n. 55
0
 public static async Task <Statuses> RequestLocationUpdatesAsync(this IFusedLocationProviderApi api, GoogleApiClient client, LocationRequest request, Android.App.PendingIntent callbackIntent)
 {
     return((await api.RequestLocationUpdates(client, request, callbackIntent)).JavaCast <Statuses> ());
 }
Esempio n. 56
0
        // List<string> listAccount = new List<string>();
        // List<string> listPass = new List<string>();
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            FacebookSdk.SdkInitialize(this.ApplicationContext);
            mProfileTracker = new MyProfileTracker();
            mProfileTracker.mOnProfileChanged += MProfileTracker_mOnProfileChanged;
            mProfileTracker.StartTracking();
            SetContentView(Resource.Layout.LogIn);



            toolbar = FindViewById <SupportToolbar>(Resource.Id.toolbarChild);
            toolbar.SetTitle(Resource.String.login);

            SetSupportActionBar(toolbar);

            toolbar.SetNavigationIcon(Resource.Drawable.abc_ic_ab_back_mtrl_am_alpha);

            ImageView createAccountButton = FindViewById <ImageView>(Resource.Id.createAccount);

            createAccountButton.Click += delegate
            {
                Intent createAccount = new Intent(this, typeof(CreateAccount));
                StartActivity(createAccount);
            };

            //siggnin gg
            mGoogleApiClient = new GoogleApiClient.Builder(this)
                               .AddConnectionCallbacks(this)
                               .AddOnConnectionFailedListener(this)
                               .AddApi(PlusClass.API)
                               .AddScope(PlusClass.ScopePlusProfile)
                               .AddScope(PlusClass.ScopePlusLogin).Build();


            signFace = FindViewById <ImageButton>(Resource.Id.signGoogle);



            signFace.Click += delegate
            {
                //Fire sign in
                if (!mGoogleApiClient.IsConnecting)
                {
                    mSignInClicked = true;
                    ResolveSignInError();
                }
            };

            //facebook

            //FacebookSdk.SdkInitialize(this.ApplicationContext);
            //PackageInfo info = this.PackageManager.GetPackageInfo("PlaceMap.PlaceMap", PackageInfoFlags.Signatures);
            //foreach (Android.Content.PM.Signature signature in info.Signatures)
            //{
            //    MessageDigest md = MessageDigest.GetInstance("SHA");
            //    md.Update(signature.ToByteArray());
            //    string keyhash = Convert.ToBase64String(md.Digest());
            //    Console.WriteLine("KeyHash:", keyhash);
            //}

            //facebook
            signFB           = FindViewById <ImageButton>(Resource.Id.signFacebook);
            mCallBackManager = CallbackManagerFactory.Create();
            LoginManager.Instance.RegisterCallback(mCallBackManager, this);
            signFB.Click += delegate
            {
                if (AccessToken.CurrentAccessToken != null)
                {
                    //The user is logged in through Facebook
                    LoginManager.Instance.LogOut();
                    return;
                }

                else
                {
                    //The user is not logged in
                    LoginManager.Instance.LogInWithReadPermissions(this, new List <string> {
                        "public_profile", "user_friends", "email"
                    });
                }
            };

            // LoginButton button = FindViewById<LoginButton>(Resource.Id.login_button);
            // mBtnShared = FindViewById<ShareButton>(Resource.Id.btnShare);
            // mBtnGetEmail = FindViewById<Button>(Resource.Id.btnGetEmail);
            //button.SetReadPermissions(new List<string> { "public_profile", "user_friends", "email" });

            //mCallBackManager = CallbackManagerFactory.Create();

            //  button.RegisterCallback(mCallBackManager, this);


            //mBtnGetEmail.Click += (o, e) =>
            //{
            //    GraphRequest request = GraphRequest.NewMeRequest(AccessToken.CurrentAccessToken, this);

            //    Bundle parameters = new Bundle();
            //    parameters.PutString("fields", "id,name,age_range,email");
            //    request.Parameters = parameters;
            //    request.ExecuteAsync();
            //};

            // ShareLinkContent content = new ShareLinkContent.Builder().Build();
            //  mBtnShared.ShareContent = content;

            //sign in by app
            account = FindViewById <EditText>(Resource.Id.username);
            pass    = FindViewById <EditText>(Resource.Id.password);
            login   = FindViewById <Button>(Resource.Id.buttonSignin);



            login.Click += async delegate
            {
                List <string> listAccount = await manager.GetListAccount();

                List <string> listPass = await manager.GetListPass();

                if (listAccount.Contains(account.Text) && listPass.Contains(pass.Text))
                {
                    Toast.MakeText(this, "Login successful", ToastLength.Short).Show();
                }
                else
                {
                    Toast.MakeText(this, "Username or password is wrong", ToastLength.Short).Show();
                }
            };
        }
Esempio n. 57
0
 public static async Task <Statuses> RemoveLocationUpdatesAsync(this IFusedLocationProviderApi api, GoogleApiClient client, LocationCallback callback)
 {
     return((await api.RemoveLocationUpdates(client, callback)).JavaCast <Statuses> ());
 }
 public async Task <RemoteMediaPlayer.IMediaChannelResult> PlayAsync(GoogleApiClient apiClient)
 {
     return((await Play(apiClient)).JavaCast <RemoteMediaPlayer.IMediaChannelResult> ());
 }
 public async Task <RemoteMediaPlayer.IMediaChannelResult> QueueRemoveItemsAsync(GoogleApiClient apiClient, int[] itemIdsToRemove, Org.Json.JSONObject customData)
 {
     return((await QueueRemoveItems(apiClient, itemIdsToRemove, customData)).JavaCast <RemoteMediaPlayer.IMediaChannelResult> ());
 }
Esempio n. 60
0
 public static void setViewForPopups(GoogleApiClient arg_GoogleApiClient_1, object arg_object_2)
 {
     JavaObjWrapper.StaticInvokeCallVoid(CLASS_NAME, "setViewForPopups", "(Lcom/google/android/gms/common/api/GoogleApiClient;Landroid/view/View;)V", arg_GoogleApiClient_1, arg_object_2);
 }