Category : google-places-api

I get the address but not the latlng package shweta.com.googleplacesautocomplete import android.util.Log import android.webkit.WebStorage import com.google.android.gms.maps.CameraUpdateFactory import com.google.android.gms.maps.GoogleMap import com.google.android.gms.maps.model.LatLng import com.google.android.gms.maps.model.LatLngBounds import com.google.android.gms.tasks.Tasks import com.google.android.libraries.places.api.model.AutocompletePrediction import com.google.android.libraries.places.api.model.AutocompleteSessionToken import com.google.android.libraries.places.api.model.Place import com.google.android.libraries.places.api.model.TypeFilter import com.google.android.libraries.places.api.net.FetchPlaceRequest import com.google.android.libraries.places.api.net.FindAutocompletePredictionsRequest import com.google.android.libraries.places.api.net.PlacesClient import java.util.concurrent.ExecutionException import java.util.concurrent.TimeUnit import java.util.concurrent.TimeoutException const val TASK_AWAIT = 120L const val MAP_CAMERA_ZOOM = 11f const ..

Read more

I’m trying to use the Google Places API to search for nearby Gym locations as one of my functions for my school project, but whenever I run the code, it always crashes and give this error. java.lang.NullPointerException: Attempt to invoke virtual method ‘void com.google.android.gms.maps.GoogleMap.clear()’ on a null object reference) I just can’t seem to figure ..

Read more

I am currently using the Google Places API within my (Java) Android application to get the current device location and display it into an editText. Currently when I make the call to placesClient.findCurrentPlace(request), a list of the closest places and the likelihood of the device being there are returned, like so: Place ‘XXXXXXX’ has likelihood: ..

Read more

I am trying to implement something similar to this (https://github.com/ankitsinghmyself/SearchNearByPlace) in my Android application. I have tried running the persons code straight from GitHub with my own API key and it works but will not allow Nearby Search. I have tried two YouTube tutorials and two GitHub repos and no luck with Nearby Search. Can ..

Read more