用于文本和文档翻译的 Android Cloud SDK

使用 GroupDocs.Translation API 向适用于 Android 设备的应用程序添加翻译功能。将翻译带到任何系统——从入门级上网本到智能手机。

  • GroupDocs.Translation Cloud SDK for cURL
  • GroupDocs.Translation Cloud SDK for .NET
  • GroupDocs.Translation Cloud SDK for Java
  • GroupDocs.Translation Cloud SDK for Python
开始免费试用

GroupDocs.Translation offers real-time machine translation for texts, documents, images and resources. Powerful machine learning algorithms and sophisticated neural networks provide a quality close to that of a professional human translator, but much faster and more cost-effective. Running on a high-performance cloud server hosted by GroupDocs, it can translate PDF, Microsoft Office and OpenOffice documents, Markdown files, and .NET resources into 46 European, Middle East and Asian languages (across 128 language pairs). The API not only translates text, but also accurately preserves metadata, structure, styles, and layout of documents.

This SDK greatly simplifies the interaction with GroupDocs.Translation Cloud services from Android apps, allowing you to focus on business logic rather than the technical details. It handles all the routine operations such as establishing connections, sending API requests, and parsing responses, wrapping all these tasks into a few simple methods. The translation is carried out by high-performance cloud servers. You can use the application on any system – from entry-level netbooks to smartphones.

The Android SDK, demo applications, documentation, and examples are open source distributed under the MIT license. You can use them for any purpose and change any part of the code.

GroupDocs.Translation Cloud SDK for Android 的高级功能

Supports 46 languages and 128 language pairs

Translates to and from 46 European, Middle East and Asian languages

翻译 Word 文档和 PowerPoint 演示文稿中的表格

翻译文档中的页眉和页脚

翻译 Word 文档中的脚注和尾注

翻译 Word 文档中的图像标题

翻译 PowerPoint 演示文稿中的文本框、图表和幻灯片

翻译电子表格单元格内的文本

翻译 Excel 工作簿中的图表和数据透视表

翻译保留所有常见 Markdown 格式的 Markdown 文件

翻译来自 URL 和公共存储库的文件

无需额外软件即可将结果转换为不同格式

基于Swagger集合的详细开发者参考

开始使用适用于 Android 的文档翻译 SDK

适用于 Android 的 GroupDocs.Translation Cloud SDK 附带详细的开发人员指南和实时代码示例,可让您立即开始使用 API 功能。只需在 GroupDocs Cloud 创建一个免费帐户,获取 APP SID 和密钥信息即可与 GroupDocs Cloud API 进行通信。

任何语言、平台和存储服务提供商

GroupDocs.Translation for Cloud 是一个 REST API,可以轻松地与任何语言或平台集成,能够管理 HTTP 请求和响应。它支持所有流行的云存储服务,如 Google Cloud、Drive、DropBox 和 Amazon S3,无需任何依赖即可进行交互。

在 Android 中翻译纯文本

  package com.groupdocs;
  // Import classes

  import com.groupdocs.model.*;
  import org.openapitools.client.api.TranslationApi;

  public class TextDemo {
      public static void main(String[] args) {
          String basePath = "https://api.groupdocs.cloud/v2.0/translation";
          String cliendId = "YOUR_CLIENT_ID";
          String clientSecret = "YOUR_CLIENT_SECRET";

          ApiClient defaultClient = new ApiClient(basePath, cliendId, clientSecret, null);
          TranslationApi translationApi = new TranslationApi(defaultClient);
          TextRequest request = new TextRequest();
          request.setSourceLanguage("en");
          request.addTargetLanguagesItem("de");
          request.addTextsItem("Text to translate");
          try {
              String r = translationApi.textPost(request).getId();
              CloudTextResponse response = translationApi.textRequestIdGet(r);
              if (!response.getStatus().toString().equals("500")) {
                  while (true) {
                      response = translationApi.textRequestIdGet(r);
                      if (response.getStatus().toString().equals("200")) {
                          System.out.println(response);
                          break;
                      }
                      try {
                          Thread.sleep(2000);
                      } catch (InterruptedException e) {
                          e.printStackTrace();
                      }
                  }
              }
          }
          catch(ApiException e){
              System.err.println("Exception when calling TranslationApi#textPost");
              System.err.println("Status code: " + e.getCode());
              System.err.println("Reason: " + e.getResponseBody());
              System.err.println("Response headers: " + e.getResponseHeaders());
              e.printStackTrace();
          }
      }
  }

安全和认证

GroupDocs.Translation Cloud API 受 SSL 保护,身份验证请求需要签名和 AppSID 查询参数或 OAuth 2.0 授权标头。

支持和学习资源

GroupDocs.Translation Cloud 为流行的编程语言和平台提供 SDK:

  中文