1. Open the build.gradle file in the app directory and add build dependencies to the file.

2. You can click a service link in the following table to view the corresponding service SDK integration guide.
Text-related Service | Language/Voice-related Service | Image-related Service | Face/Body-related Service |
3. Full SDK and Base SDK
ML Kit provides two SDK integration modes: full SDK and Base SDK. Their application scenarios vary as follows:
If your app meets the following condition, you can integrate the service in full SDK mode:
On-device capabilities are used, and devices running Android 4.4 or later are available.
If your app meets either of the following conditions, you can integrate the service in base SDK mode:
On-device capabilities are used, and only Huawei phones running EMUI 5.0 or later are supported.
Only on-cloud capabilities need to be used.
For the on-device capabilities provided by ML Kit, the full SDK mode supports a wide range of device models and Android systems. However, after integration, the size of your app package increases greatly. In base SDK mode, the incremental size of your package is small after integration of on-device capabilities, but the supported device models and systems are limited. You can select a proper mode as required.
4. Precautions
Building conflicts may occur if you want to integrate the following service packages of a specific version with some versions of other service packages. In this case, you need to upgrade service packages in the following table to the latest version.
| Service Package | Version | Conflicting Service Package | Conflicting Version |
|---|---|---|---|
| ml-computer-card-bcr-plugin | 2.0.0.300 or later | ml-computer-vision-face | 1.0.3.300 or earlier |
ml-computer-vision-classification | 1.0.3.300 or earlier | ||
ml-computer-vision-object | 1.0.3.300 or earlier | ||
ml-computer-vision-ocr | 1.0.3.300 or earlier | ||
ml-computer-vision | 1.0.3.300 or earlier | ||
ml-computer-vision-cloud | 1.0.3.300 or earlier | ||
ml-computer-vision-ic | 1.0.3.300 or earlier | ||
ml-computer-vision-segmentation | 1.0.3.300 or earlier |