首页 > 解决方案 > Google 地方信息自动填充功能需要花钱吗?

问题描述

我试图了解 Google 是否会因使用findAutocompletePredictions()他们的 Places API 中的功能而向我收费。这是我在我的应用程序中使用的功能:

fun queryPlaces(searchText: String?) {
    val request = FindAutocompletePredictionsRequest.builder()
        .setSessionToken(token)
        .setQuery(searchText)
        .build()

    placesClient.findAutocompletePredictions(request).addOnSuccessListener { response ->
        searchResults = ArrayList(response.autocompletePredictions)
        adapter.notifyDataSetChanged()
    }.addOnFailureListener { exception ->
        if (exception is ApiException) {
            Log.e("searchtext", "Place not found: " + exception.statusCode)
        }
    }
}

我查看了他们的文档,发现有两个选项可能与我的情况相匹配:

  1. https://developers.google.com/places/android-sdk/usage-and-billing#ac-no-details-session
  2. https://developers.google.com/places/android-sdk/usage-and-billing#ac-with-details-session

其中哪一个与我的代码匹配?

标签: androidkotlingoogle-places-api

解决方案


推荐阅读