架设谷歌云平台。希望使用它的翻译器API。停止连接应用程序的步骤。在我的台阶上有一个img,我在那里储存
我在Windows 10上设置了环境变量。
在那之后有一段代码
// If you don't specify credentials when constructing the client, the
// client library will look for credentials in the environment.
Storage storage = StorageOptions.getDefaultInstance().getService();
Page<Bucket> buckets = storage.list();
for (Bucket bucket : buckets.iterateAll()) {
// do something with the info
}
但不明白我该拿它做什么。我的下一步是什么。以及如何将附加到我的应用程序中。这与添加库类似吗?
有一个指南https://cloud.google.com/docs/authentication/getting-started#auth-cloud-implicit-java的链接
有没有人看过android谷歌云平台中一步一步的指南?
发布于 2017-10-12 17:52:39
有教程使用Firebase函数作为后端这里。您只需创建一个插入实时数据库的Android客户端即可。
或者,如果您想直接从android客户端调用url,则需要一个api密钥,该密钥可以在https://console.cloud.google.com/apis/credentials中获得。
https://www.googleapis.com/language/translate/v2?key=${apiKey}&source=en&target=${lang}&q=${text}
对于在Android中调用api url,可以使用Retrofit2
或FastAndroidNetworking
库。但是它并不安全,因为您需要将api键放在客户端源代码中。
发布于 2017-10-12 17:44:26
使用Translate的最简单方法是使用HTTP请求发送。我认为您应该看到REST引用,通过API键发出一个简单的POST请求,您就会知道。
https://stackoverflow.com/questions/46715476
复制相似问题