If you are using an outdated version of the app SDK, you must upgrade it to the latest version.
Overview
The latest version of the app SDK from IoT Platform is API Level 10. The differences between the app SDK versions are described below. For more information, see API Level version overview.
Category | API Level 7 and earlier SDKs | API Level 8 SDK | API Level 9 SDK | API Level 10 SDK |
Initialization | Each SDK is initialized separately. | Unified initialization | Unified initialization | Unified initialization |
Security images | Four images (for the former Alibaba Cloud China Website (www.aliyun.com) and Alibaba Cloud International Website (www.alibabacloud.com), and for the former beta and official versions) | 2 (one for Alibaba Cloud's former China website and one for its former international website) | 1 (Global) | No security images required |
Operation when switching the app between the Chinese mainland and other regions | Switch the security image and restart the app. | Switch the security image and restart the app. | No operation required | No operation required |
Multiple upgrade plans are available. Choose the one that best suits your requirements.
Current SDK integration status | Upgrade plan |
No SDK version is integrated | You can directly use and initialize the latest SDK version. This scenario does not involve an SDK upgrade. For more information, see Download and integrate the SDK and SDK initialization. |
API Level 9 SDK is integrated | To replace the security image or create a new app, upgrade the SDK using the API Level 9 upgrade plan and securely store the key generated by the platform. |
API Level 8 SDK is integrated | Upgrade the SDK using the API Level 8 upgrade plan and take note of the following for future project management. For more information about the potential impacts of the upgrade, see Global Activation Center update announcement.
|
API Level 7 or earlier SDK is integrated | Two upgrade plans are available.
|
API Level 9 upgrade plan
Go to the SDK and plugins page for your OEM app, select the latest API Level 10, and download the new SDK package. For detailed instructions, see Download and integrate the SDK.
The downloaded file is a compressed package. After you decompress the package, you can find the dependency.gradle file.
Use the unified initialization API to initialize the SDK. For more information, see SDK initialization.
(Optional) Add custom logic from the original SDK, such as a custom UI for user accounts.
API Level 8 upgrade plan
Go to the SDK and plugins page for your OEM app, select the latest API Level 9, and download the new SDK package. For detailed instructions, see Download and integrate the SDK.
The downloaded file is a compressed package. After you decompress the package, you can find the security image and the dependency.gradle file.
Note To download Android security images, you must first upload an APK signature file. If you do not upload a signature file, the security images are not included in the compressed package. For more information, see Integrate security images.Use the unified initialization API to initialize the SDK. For more information, see SDK initialization.
(Optional) Add custom logic from the original SDK, such as a custom UI for user accounts.
(Optional) Set the security image file extension.
To manage apps in two projects at the same time, follow these steps to set the file extension of the security image.
Copy and rename the security image. For example, you can name it
yw_1222_xxxyyy.jpg.Add the business logic to invoke and switch security images.
IoTSmart.setAuthCode(String authCode); // authCode is the file extension of the renamed security image. In the example, this is xxxyyy. // If authCode is not set or is empty, the app loads the security image named yw_1222_china_production.jpg by default.You must implement the timing and logic for switching the security image. The app must be restarted for the change to take effect.
API Level 7 upgrade plan with unified initialization (Recommended)
Go to the SDK and plugins page for your OEM app, select the latest API Level 9, and download the new SDK package. For detailed instructions, see Download and integrate the SDK.
The downloaded file is a compressed package. After you decompress the package, you can find the security image and the dependency.gradle file.
Note To download Android security images, you must first upload an APK signature file. If you do not upload a signature file, the security images are not included in the compressed package. For more information, see Integrate security images.Delete the initialization-related code from your current app project, such as `APIGatewaySDKDelegate`, `OpenAccountSDKDelegate`, and `DeviceCenterSDKDelegate`.
Use the unified initialization API to initialize the SDK. For more information, see SDK initialization.
(Optional) Add custom logic from the original SDK, such as a custom UI for user accounts.
API Level 7 upgrade plan without unified initialization (Not recommended)
This upgrade plan does not support global unified activation. Therefore, choose this plan with caution.
Go to the SDK and plugins page for your OEM app, select the latest API Level 9, and download the new SDK package. For detailed instructions, see Download and integrate the SDK.
The downloaded file is a compressed package. After you decompress the package, you can find the security image and the dependency.gradle file.
Note To download Android security images, you must first upload an APK signature file. If you do not upload a signature file, the security images are not included in the compressed package. For more information, see Integrate security images.Copy the file to the same directory as the build.gradle file in your app project and replace the original file of the same name.
Add the following code to the build.gradle file.
apply from: "dependencies.gradle"