I have generated Current location
value and i am passing it to the URL dynamically. I am getting value of Latitude
and 'Longitude' in my Logcat. but dynamic URl for LatLongUrl
is not generated currently.
Log.d(String.valueOf(mLastLocation.getLatitude()),"Latitude");
Log.d(String.valueOf(mLastLocation.getLongitude()),"Longitude");
//urlJsonObj = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=21.2150756,72.8880545&radius=500&type=hospital&key=AIzaSyBldIefF25dfjjtMZq1hjUxrj4T4hK66Mg";
urlJsonObj = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location="+String.valueOf(mLastLocation.getLatitude()+","+String.valueOf(mLastLocation.getLongitude()+"&radius=500&type=hospital&key=AIzaSyBldIefF25dfjjtMZq1hjUxrj4T4hK66Mg";
Log.d(urlJsonObj,"LatLongUrl");
Logcat displaying as bellow in which value of Latitude and 'Longitude' generated but dynamic URl for LatLongUrl
is not generated currently.
04-20 15:00:45.477 3209-3209/com.example.chaitanya.nearbyplace D/21.225225225225223: Latitude
04-20 15:00:45.477 3209-3209/com.example.chaitanya.nearbyplace D/72.8905100797212: Longitude
[ 04-20 15:00:45.477 3209: 3209 D/https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=21.225225225225223&radLatLongUrl
Updated quetion
i have update code as bellow. but its still not generateed URL properly.
String Latitude = String.valueOf(mLastLocation.getLatitude());
String Longitude = String.valueOf(mLastLocation.getLongitude());
urlJsonObj = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location="+Latitude+","+Longitude+"&radius=500&type="+TypeName+"&key=AIzaSyBldIefF25dfjjtMZq1hjUxrj4T4hK66Mg";
Log.d(urlJsonObj,"LatLongUrl");
in Logcat
[ 04-20 15:24:57.826 23415:23415 D/https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=21.225225225225223,72.LatLongUrl