0
votes

in my app i want to use google place api to get nearest places such as atm, bus stand etc... but it returning null result.. url is

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=28.568315675,77.33492885&radius=5000&types=ATM&sensor=false&key=AIzaSyAryW3R30sFQCsDb3wQR_EeiZ_dAvyUilQ

and code is::

    String data = "";
    InputStream iStream = null;
    HttpURLConnection urlConnection = null;
    try{
            URL url = new URL(strUrl);                



            urlConnection = (HttpURLConnection) url.openConnection();                


            urlConnection.connect();                


            iStream = urlConnection.getInputStream();

            BufferedReader br = new BufferedReader(new InputStreamReader(iStream));

            StringBuffer sb  = new StringBuffer();

            String line = "";
            while( ( line = br.readLine())  != null){
                    sb.append(line);
            }

            data = sb.toString();

            br.close();

    }catch(Exception e){
            Log.d("Exception while downloading url", e.toString());
    }finally{
            iStream.close();
            urlConnection.disconnect();
    }
    return data;

i hv reffered to many links but no koi help milii....

How can I search places with specific types using Google Places API?

finding both "Shopping_mall" and "food" within single URL for google places API

1

1 Answers

0
votes

you r using key i.e key for android apps.. instead of key for browser app.. use dis.. it will definitely run... gud luck