All Products
Search
Document Center

Add UC SDK

Last Updated: Mar 24, 2021

Connecting the UC SDK to Android apps helps resolve the compatibility issue between browsers provided by different vendors. This reduces the crash rate and improves performance of the browsers as compared with the system browser. The UC SDK provides security support to mitigate security threats.

Before you begin

  • If you connect to mPaaS based on native AAR, perform the prerequisite steps and subsequent steps. For more information, see Add mPaaS to your project.
  • If you connect to mPaaS based on mPaaS Inside, complete the access procedure first. For more information, see Access procedure under Connect to mPaaS mPaaS based on mPaaS Inside.
  • If you connect to mPaaS based on components, complete the access procedure first. For more information, see Access procedure under Connect to mPaaS mPaaS based on components.

Add the UC SDK

Native AAR mode

In your project, install the UC kernel component on the Component Management (AAR) page. For more information, see Manage component dependencies in the native AAR mode.

mPaaS Inside mode

In your project, install the UC kernel component on the Component Management page.
For more information, see Manage component dependencies in the mPaaS Inside mode.

Component mode

In your Portal and Bundle projects, install the UC kernel component on the Component Management page.
For more information, see Manage component dependencies in Access procedure.

Apply for a UC kernel

Use the tool for generating UC key signatures

Android Studio mPaaS plug-in V2.20062211 and later provide the tool for generating UC key signatures. This tool helps you apply for a UC SDK key. If the version of your mPaaS plug-in is V2.20062211 or later, you can use this tool to apply for a UC kernel. For more information, see Use the mPaaS plug-in.

Use the CLI

Apply for a key of the UC SDK as follows:

Note:
  • Make sure that the dependencies of the UC kernel are added to the project.
  • Make sure that the application ID of the app is provided.

Procedure

  1. Based on the development environment, execute the command to obtain the SHA1 value of the fingerprint on the application’s signature certificate.
    • Windows
           
      1. Absolute path of keytool -v -list -keystore keystore
    • macOS
           
      1. Absolute path of keytool -list -v -keystore keystore
  2. Log on to the Support and Services console and go to the New Ticket page.
    1. In the Select Issue-related Product step, enter mPaaS in the search box in the upper-right corner.
      select-mpaas
    2. In the Select Issue Category step, choose Development Framework > Development Framework > Connect to Android Development Framework.
    3. In the Recommend Solutions step, select New Ticket.
    4. On the New Ticket page, enter the following information to obtain a key of the UC SDK.
      • Priority level: Required. Select Urgent or Normal.
      • Case Content: Required. Enter the following information:
        • Overview: You can enter the content you enter to “Apply for a key of the UC SDK.”
        • Package Name: Required.
        • SHA1 value: Required.
      • Phone number: Required.
      • Email: Required.
  3. Click Submit. Wait for a while. The specialist will send the results of the application to a key of the UC SDK.
    11

  4. Enter the obtained key in the AndroidManifest.xml file in the project:

       
    1. <meta-data android:name="UCSDKAppKey" android:value="Obtained key"/>
    Note: The authorization information of the UC SDK is bound to the package name and signature of the APK. Therefore, if UCWebView does not take effect, check whether the signature and package name are consistent with those you enter to apply for a key.

Check whether the UC core takes effect

After you generate a debugging package and install the debugging package, check whether the UC kernel takes effect.

Open an HTML5 page. In the log in Logcat, select webview version.

The following figures show the sample logs.

  • If the version starts with 2 or 3, the UC kernel takes effect.
    UC
  • If the version starts with Chrome, the system kernel takes effect.
    system