Android Question You have exceeded your daily request quota for this API Error

Azhar

Active Member
Licensed User
Longtime User
Hi

I have been away from development for a few months when today I recompiled my application without any changes and this error persisted.

I'm using the OkHTTP v1.20 library to do a request for finding GPS Long/Lat co-ordinates from the user entered town name. I had no problems with this a few months ago.

The other part of the error response message is : "
We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/apis/credentials?project=_",

Can anyone suggest how to get around this?

Kind regards,

Azhar
 

DonManfred

Expert
Licensed User
Longtime User
You are calling a Google Api and you are not using your own Api-Key.
As suggested by google you need to register your own project to get an access-token for this Api and then you need to use this Token in your Api-Calls.
 
Upvote 0

Azhar

Active Member
Licensed User
Longtime User
You are calling a Google Api and you are not using your own Api-Key.
As suggested by google you need to register your own project to get an access-token for this Api and then you need to use this Token in your Api-Calls.

I see. I have registered for an API key and got that but I'm unsure on how to actually use it to make an API call.

I've put this in the project's manifest editor:

AddApplicationText(<meta-data
android:name="com.google.android.geo.API_KEY"
android:value=" AIzaSyDsilKVXoMFV_Qog12oGkAAENBATC_1O2M"/>
/>)

Is there any tutorial on how to do this at all?

Kind regards,

Azhar
 
Upvote 0

Azhar

Active Member
Licensed User
Longtime User
Please post the code you are using.

Hi


This is the modified API call with the API Key generated for me:


B4X:
Sub getElevationData()  '(URL As String, taskID As Int)
    Http.Initialize("Http")
    Private HttpRequest1 As OkHttpRequest
    ALat = Starter.loc.Latiude
    BLat = Starter.loc.Latiude
    ALng = Starter.loc.Longitude
    BLng = Starter.loc.Longitude
    Log("Probing Elevation from URL Request...")
    URL1 = "http://maps.googleapis.com/maps/api/elevation/json?locations="&ALat&","&ALng&"%7C"&BLat&","&BLng&",+CA&key=AIzaSyDsilKVXoMFV_Qog12oGkAAENBATC_1O2M"
    HttpRequest1.InitializeGet(URL1)
    Http.Execute(HttpRequest1,1)
End Sub

At the end of the URL1, I appended the ",+CA&key=AIzaSyDsilKVXoMFV_Qog12oGkAAENBATC_1O2M"
This key is what Google has given me.

I've commented out what I put into the Manifest Editor as I thought it wasn't needed. But nevertheless, this was what I thought had to be entered into the Manifest Editor file:

B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="19"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddApplicationText(<meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="AIzaSyDsilKVXoMFV_Qog12oGkAAENBATC_1O2M"/>
/>)
#additionaljar: com.android.support:support-v4
'End of default text.
 
Upvote 0
Top