简体   繁体   中英

Google Appengine Multiple Versions Android App

I'm trying to test out an updated appengine version without ruining my live version. The current code is:

themeendpoint.Builder endpointBuilder = new themeendpoint.Builder(
                AndroidHttp.newCompatibleTransport(),
                new AndroidJsonFactory(),
                new HttpRequestInitializer() {
                    @Override
                    public void initialize(HttpRequest httpRequest) throws IOException {

                    }
                }
        );


        themeendpoint endpoint = CloudEndpointUtils.updateBuilder(
                endpointBuilder).build();

Which works fine for the default version. I'm trying to access the "dev" version that I uploaded. I understand that normally you are supposed to add the version at the beginning like "dev.project.appspot" but I'm struggling to get this into the Android App. I tried adding the following:

endpointBuilder.setRootUrl("https://dev.project.appspot.com/_ah/api/");

Just before creating the endpoint. When running the app I get the following error:

java.io.IOException: Hostname 'dev.project.appspot.com' was not verified

I'm at a loss as to how to access my non-default version.

Turns out I almost had it right. Per this link I need to use "-dot-" notation for HTTPS. Plus, I was missing a small piece of the URL. Full line of code is:

endpointBuilder.setRootUrl("https://dev-dot-project.appspot.com/_ah/api/");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM