http client (HttpURLConnection) request the link https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=YOUR_API_KEY

If you limit YOUR_API_KEY to use only on the android application (specify the package name and sha1), then the request stops responding.

It turns out in my case, you can not restrict the key to use only in a specific application?

    1 answer 1

    In your question you yourself and answered it. If you set a specific name of the package of the android application in the restrictions, then the API Key will work only there. If you need a key for different projects - remove the restriction.

    • The project is the same, just in the application I make a get request for an address. I do not use the Geocoder class, but I send a get request to the direct one. Geocoder does not always work .. - noskoffofficial