有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java限制google使用改型将查询自动完成放在一个国家

我正在建设的应用程序,其中有地址自动完成编辑文本,我想限制自动完成一个国家。我正在使用改型向GooglePlacesAPI发送请求

        Retrofit retrofit = new Retrofit.Builder()
            .addConverterFactory(GsonConverterFactory.create())
            .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
            .baseUrl("https://maps.googleapis.com/maps/api/")
            .build();
       googleInterface = retrofit.create(GoogleInterface.class);

我的谷歌界面是这样的

public interface GoogleInterface {
@GET("place/queryautocomplete/json")
Call<PredictionModel> getPlace(@Query("input") String text,
                               @Query("types") String types,
                               @Query("key") String key);

}

我应该如何设置component=country:RS,甚至可以通过改型来实现吗


共 (0) 个答案