Google Cloud Endpoints 설정 문제

솔로몬 파월

저는 Google의 Cloud Platform을 처음 사용하고 Android 기기에 설정하는 데 문제가 있습니다. 이 튜토리얼 을 따르려고 시도하고 있으며 Android 에뮬레이터로 백엔드를 테스트하려고합니다. 그러나 에뮬레이터는 20 초 후에이 메시지를 표시 합니다. 대신에 내 이름 이 표시 되어야합니다. 지금까지 내 코드는 다음과 같습니다.

MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    buildUI();

    new EndpointsAsyncTask().execute(new Pair<Context, String>(this, "Solomon"));


}

EndpointsAsyncTask.java

public class EndpointsAsyncTask extends AsyncTask<Pair<Context, String>, Void, String> {
private static MyApi myApiService = null;
private Context context;

@Override
protected String doInBackground(Pair<Context, String>... params) {
    if(myApiService == null) {  // Only do this once
        MyApi.Builder builder = new MyApi.Builder(AndroidHttp.newCompatibleTransport(),
                new AndroidJsonFactory(), null)
                // options for running against local devappserver
                // - 10.0.2.2 is localhost's IP address in Android emulator
                // - turn off compression when running against local devappserver
                .setRootUrl("http://10.0.2.2:8080/_ah/api/")
                .setGoogleClientRequestInitializer(new GoogleClientRequestInitializer() {
                    @Override
                    public void initialize(AbstractGoogleClientRequest<?> abstractGoogleClientRequest) throws IOException {
                        abstractGoogleClientRequest.setDisableGZipContent(true);
                    }
                });
        // end options for devappserver

        myApiService = builder.build();
    }

    context = params[0].first;
    String name = params[0].second;

    try {
        return myApiService.sayHi(name).execute().getData();
    } catch (IOException e) {
        return e.getMessage();
    }
}

@Override
protected void onPostExecute(String result) {
    Toast.makeText(context, result, Toast.LENGTH_LONG).show();
}
}

모든 도움에 감사드립니다!

편집 : 문제의 일부는 App Engine 서블릿 백엔드가 아닌 Endpoints 백엔드를 실행하고 있다는 것입니다. 하지만 이제는 "연결이 거부되었습니다"라는 메시지가 표시되고 App Engine 서블릿 백엔드를 실행하고 있습니다. 어떤 아이디어?

솔로몬 파월

힘든 며칠 후 rootUrl http://10.0.2.2:8080/_ah/api/을 내 appspot 도메인 으로 변경해야한다는 문제를 발견했습니다 . 이제 Hello World 메시지를 받았습니다.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Google Cloud Endpoints EOFException

분류에서Dev

Google 계정이없는 Google Cloud Endpoints

분류에서Dev

Google Cloud Endpoints Python 빠른 시작 에코 샘플 문제

분류에서Dev

Data transport optimization with Google cloud endpoints

분류에서Dev

Youtube Data API 및 Google Cloud Endpoints

분류에서Dev

프록시 Google Cloud Endpoints

분류에서Dev

OSX 10.9.1에 Google Cloud SDK 설치 문제

분류에서Dev

Cloud Endpoints, ServiceGenerator, OS X Mavericks 문제

분류에서Dev

Google Cloud Endpoints를 사용하여 내 조직 Google 계정으로 로그인

분류에서Dev

Google Cloud Endpoints의 Facebook 로그인

분류에서Dev

Google App Engine cloud endpoints - inconsistence after updating an Entity

분류에서Dev

GoogleAuthException : Google Cloud Endpoints에서 알 수 없음

분류에서Dev

Google Cloud Endpoints : 웹 소켓 및 JWT

분류에서Dev

자체 Cloud Lab 설정 문제

분류에서Dev

Google Cloud SDK (MacOS High Sierra) 설치 후 경로 변수 문제

분류에서Dev

Google Cloud Run 보안 문제

분류에서Dev

Google Cloud 가격이 제정신가요? 올바르게 설정하는 방법

분류에서Dev

이름이 지정되지 않은 Google Cloud Endpoints의 요청 매개 변수에 액세스

분류에서Dev

Google Cloud Build + Google Secret Manager 대체 문제

분류에서Dev

Google App Engine Endpoints API 액세스 제한

분류에서Dev

Google Endpoints Hipaa 규정 준수 여부

분류에서Dev

외부 클라이언트를위한 Google Cloud Endpoints의 승인

분류에서Dev

Google Cloud Endpoints: NumberFormatException in Android client when response includes DateTime field

분류에서Dev

Google Cloud Endpoints 비 WebApp iOS 클라이언트 Blobstore

분류에서Dev

Google Cloud Endpoints Android 클라이언트-인증 오류

분류에서Dev

Google Cloud Endpoints는 메서드에서 값을 반환합니다.

분류에서Dev

Google Cloud Endpoints 테스트의 콘텐츠 길이 오류

분류에서Dev

What is the migration path for the userinfo.email deprecation for Google Cloud Endpoints apps?

분류에서Dev

Google App Engine Cloud Endpoints 내에서 Drive API를 호출합니다.

Related 관련 기사

  1. 1

    Google Cloud Endpoints EOFException

  2. 2

    Google 계정이없는 Google Cloud Endpoints

  3. 3

    Google Cloud Endpoints Python 빠른 시작 에코 샘플 문제

  4. 4

    Data transport optimization with Google cloud endpoints

  5. 5

    Youtube Data API 및 Google Cloud Endpoints

  6. 6

    프록시 Google Cloud Endpoints

  7. 7

    OSX 10.9.1에 Google Cloud SDK 설치 문제

  8. 8

    Cloud Endpoints, ServiceGenerator, OS X Mavericks 문제

  9. 9

    Google Cloud Endpoints를 사용하여 내 조직 Google 계정으로 로그인

  10. 10

    Google Cloud Endpoints의 Facebook 로그인

  11. 11

    Google App Engine cloud endpoints - inconsistence after updating an Entity

  12. 12

    GoogleAuthException : Google Cloud Endpoints에서 알 수 없음

  13. 13

    Google Cloud Endpoints : 웹 소켓 및 JWT

  14. 14

    자체 Cloud Lab 설정 문제

  15. 15

    Google Cloud SDK (MacOS High Sierra) 설치 후 경로 변수 문제

  16. 16

    Google Cloud Run 보안 문제

  17. 17

    Google Cloud 가격이 제정신가요? 올바르게 설정하는 방법

  18. 18

    이름이 지정되지 않은 Google Cloud Endpoints의 요청 매개 변수에 액세스

  19. 19

    Google Cloud Build + Google Secret Manager 대체 문제

  20. 20

    Google App Engine Endpoints API 액세스 제한

  21. 21

    Google Endpoints Hipaa 규정 준수 여부

  22. 22

    외부 클라이언트를위한 Google Cloud Endpoints의 승인

  23. 23

    Google Cloud Endpoints: NumberFormatException in Android client when response includes DateTime field

  24. 24

    Google Cloud Endpoints 비 WebApp iOS 클라이언트 Blobstore

  25. 25

    Google Cloud Endpoints Android 클라이언트-인증 오류

  26. 26

    Google Cloud Endpoints는 메서드에서 값을 반환합니다.

  27. 27

    Google Cloud Endpoints 테스트의 콘텐츠 길이 오류

  28. 28

    What is the migration path for the userinfo.email deprecation for Google Cloud Endpoints apps?

  29. 29

    Google App Engine Cloud Endpoints 내에서 Drive API를 호출합니다.

뜨겁다태그

보관