如何在Xamarin中获得GoogleApiClient? [英] How to get GoogleApiClient in Xamarin?

查看:120
本文介绍了如何在Xamarin中获得GoogleApiClient?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我使用Xamarin开发的Android应用程序中实现类似这个的内容,但无法找到 GoogleApiClient 所在的命名空间。任何人都可以帮忙吗?

解决方案

GoogleApiClient 位于 Android.Gms.Common.Apis 命名空间。



该命名空间位于 Xamarin.GooglePlayServices.Basement >assembly,但不直接安装。

因此,假设您在尝试访问某个Android位置/地图开发中的内容,请安装以下nuget: / p>

Xamarin Google Play Services - 位置 a>


Google Play服务的Xamarin.Android绑定 - 位置

一个移动应用程序的独特功能是位置
的意识。移动用户随身携带他们的设备,
为您的应用添加位置感知功能,为用户提供更多背景的
体验。 Google Play服务
中提供的位置API可帮助您通过自动
位置跟踪,地理围栏和活动识别功能为您的应用添加位置感知。



安装Xamarin Google Play服务 - 位置,在包管理器控制台中运行以下
命令




  PM>安装包Xamarin.GooglePlayServices.Location 

使用子句:

 使用Android.Gms.Common.Apis; 

代码:

  var foo = GoogleApiClient(); 


I want to implement something like this in my Android application that I'm developing in Xamarin but can not find a namespace in which the GoogleApiClient is. Can anybody help?

解决方案

GoogleApiClient is in the Android.Gms.Common.Apis namespace.

That namespace is in the "Xamarin.GooglePlayServices.Basement" assembly, but you do not install that directly.

So, assuming you are trying to access that in doing some Android Location/Map development, install this nuget:

Xamarin Google Play Services - Location

Xamarin.Android Bindings for Google Play Services - Location

One of the unique features of mobile applications is location awareness. Mobile users take their devices with them everywhere, and adding location awareness to your app offers users a more contextual experience. The location APIs available in Google Play services facilitate adding location awareness to your app with automated location tracking, geofencing, and activity recognition.

To install Xamarin Google Play Services - Location, run the following command in the Package Manager Console

PM> Install-Package Xamarin.GooglePlayServices.Location

Using clause:

using Android.Gms.Common.Apis;

Code:

var foo = GoogleApiClient ();

这篇关于如何在Xamarin中获得GoogleApiClient?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆