Android URL Create geoCoderUrlBuilder(double lat, double lng)

Here you can find the source of geoCoderUrlBuilder(double lat, double lng)

Description

Builds a url for google api for the given parameters

License

Open Source License

Parameter

Parameter Description
lat a parameter
lng a parameter

Return

url

Declaration

public static String geoCoderUrlBuilder(double lat, double lng) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*from ww w  . j  av  a2  s. c o  m*/
     * 
     * Builds a url for google api for the given parameters
     * 
     * @param lat
     * @param lng
     * @return url
     */
    public static String geoCoderUrlBuilder(double lat, double lng) {
        String googleurl = "https://maps.google.com/maps/api/geocode/json?key=AIzaSyACYVxd_d-49UnhqibCI6F9f7b5Gw1qTSc&";
        //      Log.v("HTTP" , "Latitude is: " + lat + "Longitude is:" + lng);
        StringBuilder sbuilder = new StringBuilder();
        sbuilder.append(googleurl);
        sbuilder.append("latlng=" + lat + "," + lng);
        sbuilder.append("&sensor=true");
        String url = sbuilder.toString();
        return url;
    }
}

Related

  1. buildBodyParameterString( List> parameters)
  2. buildParameterString( List> parameters, String delimiter, boolean quote)
  3. buildUrlParameterString( List> parameters)
  4. appendParameter(String url, String name, String value)
  5. appendParameter(String url, String name, String value)
  6. makeUrl(String inBaseUrl, String inUrl)