Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
106 views
in Technique[技术] by (71.8m points)

android - Using Google Places API

I want to develop an application in which i want to display information about places nearby (within 1km )the user by getting its current location..

Say for example i want to display information about Restaurants, Shopping Malls, Hospitals located within 1km related to current location of the android device..

I have gone through this link : Using Google Places API in Android.. But didnt get more.

Have anyone used Google Places API in android ?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Some points to keep in mind:

  • In order to use Google’s Places API, you will need to register and obtain a Google Map’s API Key.
  • In class UrlSigner in the tutorial the variable descriptions are: keyString => is your Google Map api key. urlString is the url you want to sign using the api key.
  • In code you will find inputKey and inputUrl. these 2 variables are just for testing purpose you can omit them if you want. You can directly write code as follows:

    URL url = new URL(urlString);

    UrlSigner signer = new UrlSigner(keyString);

    String request = signer.signRequest(url.getPath(),url.getQuery());

    System.out.println("Signed URL :" + url.getProtocol() + "://" + url.getHost() + request);

in main method of UrlSigner class.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...