私はGoogleがAndroidの開発APIを再生使用するアクセストークンを取得しようとしています、と私はこれまでのところthe Google API Java Client documentation exampleを使用してしまった:GoogleCredentialからアクセストークンを取得するにはどうすればよいですか?
HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
JsonFactory JSON_FACTORY = new JacksonFactory();
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(HTTP_TRANSPORT)
.setJsonFactory(JSON_FACTORY)
.setServiceAccountId("...gserviceaccount.com")
.setServiceAccountScopes("https://www.googleapis.com/auth/androidpublisher")
.setServiceAccountPrivateKeyFromP12File(keyFile)
.build();
しかし、どのように私はこの資格からアクセストークンを得るのですか? credential.getAccessToken()
はnull
を返します。間違ったことをしているのですか、いくつかのステップがありませんか?
また、すべての機能を動作させるために必要な手順については、http://stackoverflow.com/a/24264696/165708こちらをご覧ください。 –