Delay when using PlaceAutocomplete without using Rest API

I am using the Google Places API. But I can’t find a way to reduce the number of requests without implementing the rest of the API.

try { Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_FULLSCREEN) .setFilter(new AutocompleteFilter.Builder() .setTypeFilter(AutocompleteFilter.TYPE_FILTER_ADDRESS).build()) .build(mActivity); startActivityForResult(intent, REQUEST_CODE); } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) { } 
+5
source share
2 answers

I assume you are worried about the cost of the API. If you check the conditions, you will see that you can use unlimited queries if you use the Google user interface (fragment). If you want to avoid many calls to the remote API, the easiest way is to call the REST service manually, but the quota is pretty thin (1000 requests every 24 hours), so you have to wrap the REST api inside the web service your own, and call it from the application. In addition, you must install caching on both sides (server and application), remember that google allows you to cache a request for places for 30 days. In this case, you may decide to call api when the user has entered a certain number of characters.

0
source

A long way.

  • Use JD to decompile a jar based on YouProject...\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-places\9.4.0\jars and Playservices apk
  • Find an activity with an intent filter that has the action "com.google.android.gms.location.places.ui.AUTOCOMPLETE"
  • Get maximum activity
  • Find a variable and change the value of this delay using java reflection.

or Short Road Implement the PlaceCompleteAdapter much easier :)

0
source

Source: https://habr.com/ru/post/1260008/


All Articles