android - 如何在 Xamarin 中获取 GoogleApiClient?

标签 android google-maps xamarin google-api

我想实现类似 this 的东西在我用 Xamarin 开发的 Android 应用程序中,找不到 GoogleApiClient 所在的命名空间。有人可以帮忙吗?

最佳答案

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

该命名空间位于“Xamarin.GooglePlayServices.Basement”程序集中,但您不直接安装它。

因此,假设您在进行一些 Android 位置/ map 开发时尝试访问它,请安装此 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 Android.Gms.Common.Apis;

代码:

var foo = GoogleApiClient ();

关于android - 如何在 Xamarin 中获取 GoogleApiClient?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33391731/

相关文章:

c# - NSAttributedString 不适用于 UITextField ios xamarin

java - 如何解决 Stripe xamarin 绑定(bind)错误? (CS0103 名称 'Start' 在当前上下文中不存在)

android - 带有预填充数据库的房间

java - 任务 :react-native-gradle-plugin:compileKotlin FAILED

android - Google map 错误 - Android 应用 ¦¦ v2

ios - 如何在单元格中启用 Google map 按钮?

javascript - ng-view 不会在移动设备上自动隐藏地址/导航栏

android - 在 Android 上使用 FTP 下载文件

java - 使用地理编码器根据纬度和经度检索地址会导致延迟。安卓

xamarin - 从 ViewModel 设置条目的焦点