Android Studio Google maps url encoding issue in Address

32 Views Asked by At

I am try to get latitude and longitude from Address..

I passed My address to google api along with a valid key, but on responce it is returning an encoded url with that address and it is failed to detect Address and Apikey

public void getLatLongFromAddress(String strAddress, Callback<Object> callback) {

here strAddress i passed is TX to the 1G M,rr,IA,54r67 &key=AIzaXXXXXXXXXXXXXXXXXXXXXXXAZ0

after sending it to geo api, it returns and encoded url and a failed message

https://maps.google.com/maps/api/geocode/json?sensor=false&address=TX%20to%20the%201%20%20GM%2C%20rr%2C%20IA%2C%2054r67%26key%3DAIzaXXXXXXXXXXXXXXXXXXXXXXXAZ0

{ "error_message" : "You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account", "results" : [], "status" : "REQUEST_DENIED" }

Actually key is having in above url butthe line

key = AIzaXxxx being encoded to key %3D AIzaXX so that it could not read the key and getting declained message, also address also ecoded please observe

ofcourse i can manually decode later but, by that time the request has been declined and getting error

What should i do to get rid of this encoded url please advice

0

There are 0 best solutions below