Quick Start
Environment Preparation
- Enable the Face Recognition service: Log in to the Face Recognition management console, select a sub-service, and click Enable Service on the right.
You only need to enable the service once.
- Obtain the endpoints of Face Recognition. For details, see Regions and Endpoints.
- For details about Face Recognition APIs, see the Face Recognition API Reference.
- Obtain the AK/SK of your HUAWEI CLOUD account.
If no AK/SK has been generated, log in to , enter the My Credentials page, and choose to obtain the access keys.
- Install the JDK. The Java SDK can run on JDK 1.8 or later.
- SDKs provided by Face Recognition do not support access retries. If the access is abnormal, the SDK directly returns the request results. Therefore, the client needs to establish a retry mechanism.
- When an Android system uses this Java SDK, the main thread is not supported. You are advised to use the sub-thread.
- When using the demo in the Java SDK, you are advised to use JDK 1.9+ because readAllBytes() is a method in JDK 1.9+.
SDK Acquisition and Installation
Take Eclipse as an example. After creating a Java project, perform the following steps to import the JAR file to the new project:
- Download the SDK JAR file.
- Copy the downloaded JAR file to the project folder.
- Open the project in Eclipse, right-click the project, and choose Properties.
- In the displayed dialog box, click Java Build Path. On the Libraries tab, click Add JARs to add the downloaded JAR file.
- Click OK.
Services involved in this document use the same JAR file.
Last Article: Java SDK
Next Article: SDK API Example
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.