-2

i am new in Android development and now i am developing small application of google map. i have integrated google map,but now i want to show google places on map therefore i want to call google api web service to get locations, but i don't know how to call web service in android.enter code here

enter code here

public void getLocation()

{
    HttpClient httpClient = new HttpClient()
    AsyncHttpClient client =new AsyncHttpClient();
}
kushal
  • 181
  • 14

1 Answers1

0

You can call Url's with HttpConnection.

For Example:

public String getValuefromUrl(String url)
{
    try
    {
        DefaultHttpClient httpClient = new DefaultHttpClient();
        HttpGet httpGet = new HttpGet(url);
        ResponseHandler<String> resHandler = new BasicResponseHandler();
        String page = httpClient.execute(httpGet, resHandler);
        Log.v("PAGE",page);
        return page;
    }
    catch(Exception ex)
    {
        ex.printStackTrace();
        return "zero";  

    }
}
bfmv991
  • 109
  • 1
  • 12