Search code examples
androidxamarinxamarin.androidgoogle-places-apigoogle-places-autocomplete

Create Custom Place Picker using New Google Place API in Xamarin.Android


I am trying to create custom place picker for Xamari.Android. I could not find the following plugin in xamarin

com.google.android.libraries.places:places:1.0.0

Can Anyone help me here? I am trying to implement custom place picker using this link: https://codelabs.developers.google.com/codelabs/location-places-android/index.html?index=..%2F..index#8

If you guyz have any other way to sort this out do let me know. I want to create a view to pick a location from a map, search location etc.

Currently I have these package installed. enter image description here


Solution

  • The com.google.android.libraries.places:places aar library is wrapped via the Xamarin.Google.Android.Places package (the current version is 1.1.0.2)

    This Xamarin library source and its sample code are at:

    From the sample code:

    ....
    if (!PlacesApi.IsInitialized)
       PlacesApi.Initialize (this, apiKey);
    
    placesClient = PlacesApi.CreateClient (this);
    placesData = new List<PlaceData> ();
    ....