Search code examples
androidgoogle-app-enginegoogle-cloud-endpointsgae-eclipse-plugin

how do I point my android app to my online apengine endpoint


I have created an app-engine connected android project. Presently I have deployed my backend (endpoint api) to app-engine. Now I want to point the android app (apk) to the online server/api. How do I do that?

Basically, is the following all I have to do?

protected static final boolean LOCAL_ANDROID_RUN = false;

When the line above is all I do, I get the exception

Exception received from server at https://1.myapi.appspot.com/_ah/api/
java.io.IOException: Hostname '1.myapi.appspot.com' was not verified
at libcore.net.http.HttpConnection.verifySecureSocketHostname(HttpConnection.java:224)
at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:446)
    at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:289)
at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:239)
at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)
at libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:188)
at libcore.net.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:281)
at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:78)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:980)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:412)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:345)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:463)

Why is there a 1 preceding my app-id is that normal? Is that the problem? Where would I fix it? Again my project is entirely generated using GEP.


Solution

  • The number 1 just comes from the version number of your API, so it shouldn't be the problem...

    Anyway, what App Engine SDK are you using? The SDK 1.7.6 introduced some bugs in the generation of the endpoint client libraries using GPE that were not present in previous version, but they're solved with the new version SDK 1.7.7.

    See this question for further info about this strange 1, and the bug I was talking about.