Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using google Place picker in android project

I am trying to learn Google's place picker

  1. I have used the sample project from here
  2. I have linked playservices library for the sample project
  3. Resolved all the dependencies

Problem:

Some depedencies r not resolved ther are,

import com.google.android.gms.location.places.Place;
import com.google.android.gms.location.places.ui.PlacePicker;

Question:

  1. How to solve this
  2. Should I need to add any other project references
like image 509
Devrath Avatar asked Apr 02 '15 06:04

Devrath


People also ask

How Use Google Places Autocomplete Android?

The autocomplete widget is a search dialog with built-in autocomplete functionality. As a user enters search terms, the widget presents a list of predicted places to choose from. When the user makes a selection, a Place instance is returned, which your app can then use to get details about the selected place.

Can I use Google maps for my project?

Generally speaking, as long as you're following our Terms of Service and you're attributing properly, you can use our maps and imagery. In fact, we love seeing creative applications of Google Maps, Google Earth and Street View.


1 Answers

follow this way :

  1. Open the build.gradle file inside your application module directory.
  2. Add a new build rule under dependencies for the latest version of play-services.

For example:

    apply plugin: 'com.android.application'
    ...

    dependencies {
        compile 'com.android.support:appcompat-v7:21.0.3'
        compile 'com.google.android.gms:play-services:7.0.0'
    }
  1. Be sure you update this version number each time Google Play services is updated.

  2. Save the changes and click Sync Project with Gradle Files in the toolbar.

like image 114
Agung Harrys Avatar answered Oct 24 '22 05:10

Agung Harrys