如何在Android应用程序中提供翻译服务
如何在 Android 应用程序中调用翻译服务?我们可以有一个可以将多种语言翻译成另一种语言的应用程序吗?
How can a translation service be called in an Android app? Can we have an app that can translate multiple languages into another?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你问:
Google 翻译 似乎是 Android 应用中显而易见的服务。
您可以在应用程序中使用非官方 Java 客户端 API拨打谷歌翻译电话。
如果您使用此功能,请确保为您的应用程序提供
INTERNET
权限,以便它可以建立适当的网络连接。绝对可以创建一个 Android 应用来执行此操作,因为 Google已经制作了 Google 翻译应用程序,许多其他人也制作了这样的应用程序。
You asked:
Google Translate would seem to be the obvious service to use in an Android App.
There is an unofficial Java client API you could use in your application to make the calls to Google Translate.
If you use this, make sure you give your application the
INTERNET
permission so it can make the appropriate network connections.It's definitely possible to create an Android app to do this because Google already have made a Google Translate application, as have lots of other people.
考虑到我发布的这个答案已经很晚了,但它可以帮助其他人。
首先,谷歌已经弃用了翻译器 API 版本 1,并且它推出的版本 2 属于付费服务。这是来自 bing 的链接,它是完全免费的,并给出了在应用程序中使用它的完整步骤。http://www.microsoft.com/web/post/using-the-free -bing-翻译-api
considering the fact that this answer I am posting is quite late,but it could help other.
first thing google has deprecated translater api version 1,and the version 2 it has launched comes under paid service.here is a link from bing which is totally free and has given complete steps to use it in your application.http://www.microsoft.com/web/post/using-the-free-bing-translation-apis
我编写了一个基于 google-api-translate 轻松翻译文本的类。您所要做的就是获取设备的区域设置,然后您就可以轻松地将任何文本翻译为设备当前的语言设置。请参阅 android-translate-api
I wrote a class to easily translate text based on google-api-translate. All you have to do is get the device's locale and you can easily translate any text to the devices current language setting. See android-translate-api