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
andinputUrl
. 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.