We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

Introduction to SmartFill

SmartFill offers scenario-specific input suggestions to realize one-tap filling of complex forms for users. It helps you with system development for your app or atomic service to unleash peak input efficiency within the HarmonyOS ecosystem. This function can be started using just a single line of code after you integrate ArkUI native input components (including TextInput and TextArea).

Constraints

SmartFill supports phones, tablets, and (since 5.1.0(18)) PCs/2-in-1 devices.

Applying to Integrate SmartFill

Precautions About Using SmartFill

Integrating SmartFill

To integrate SmartFill, you need to send an application and wait for approval. The application process is as follows:

  1. Create an app ID for your HarmonyOS app or atomic service by referring to Creating a HarmonyOS App or Atomic Service.

  2. Sign in to AppGallery Connect and click Development and services.

  3. Select your app, find SmartFill on the Manage open capabilities tab page, and click the apply button on the right.

  4. In the New request dialog box, enter your application reason, upload the required attachment, and submit.

    • Request reason: Describe your scenario for using SmartFill. (For example: App XXX is XXX (app introduction) and needs SmartFill to support XXX fields in the scenario XXX to improve the form filling efficiency for users.) For details about the supported fields, please refer to ContentType Scenarios.
    • Attachment: Upload screenshots or videos that demonstrate how your app uses SmartFill.
    NOTE

    Apply only for necessary fields to be supported by SmartFill based on your service needs and use them properly. If your app uses SmartFill improperly, we will withdraw the service authorization.

  5. Go to the interaction center and check your request.

  6. Go back to the Manage open capabilities tab page. The switch of SmartFill is dimmed, and the apply button text changes, indicating that the capability is being requested.

  7. Wait for approval. Once your application is approved, you will receive a notification at the interaction center. Then your app has integrated SmartFill successfully.

    NOTE

    The capability will take effect in about 30 minutes after approval.

Prerequisites

  • SmartFill has been enabled on the target device. To enable the function, a user can go to Settings > Privacy and security > SmartFill on their device. On the page, the user can check the Statement About SmartFill and Privacy and Permissions Notice.

  • The SmartFill function can be triggered in scenarios specified in the ContentType attribute of the input component for your app or atomic service.

  • The device is connected to the Internet.

Intelligent Form Filling

Suggestions for Form Filling

In the form, when a user taps any input component with the ContentType attribute set, input suggestions will be displayed below. For details about the data sources, please refer to Data Sources and Logic of Suggestions.

  • When a user taps an input component whose ContentType is PERSON_FULL_NAME, or one of the input components whose ContentType is PERSON_LAST_NAME and PERSON_FIRST_NAME in a form, data of other ContentType settings in the form is also suggested. This is called the multi-box input scenario.

  • When a user taps an input component whose ContentType is not PERSON_FULL_NAME, PERSON_LAST_NAME, or PERSON_FIRST_NAME, the data of only the specified scenario setting is suggested. For example, if a user taps the input component whose ContentType is NICKNAME, only nickname data is suggested. This is called the single-box input scenario.

  • In the scenario where a form contains an input component whose ContentType is PERSON_FULL_NAME or contains two input components whose ContentType is PERSON_LAST_NAME and PERSON_FIRST_NAME respectively, and the corresponding information has been filled, if a user taps another input component with ContentType set to another value, input suggestions associated with the filled name information are displayed. For example, if the name Zhang San is filled, when a user taps the input component used for mobile number input, information associated with Sam Smith will be obtained from the data source for suggestions.

  • In the scenario where a form contains an input component whose ContentType is PERSON_FULL_NAME or contains two input components whose ContentType is PERSON_LAST_NAME and PERSON_FIRST_NAME respectively, and there is also an address input component, if any of the above mentioned components is tapped and address information associated with the specific HUAWEI ID exists, the number of associated addresses could be greater than the maxim that can be displayed. In this case, a user can tap Other addresses to show more.

Nickname Suggestion

If a form requires nickname input, related suggestions can be obtained from Account Kit.

Calendar Event Suggestion

If a form contains a text input component with ContentType set to FORMAT_ADDRESS (detailed address), data will be obtained from events information generated in recent 2 hours for suggestions.

NOTE

Currently, only Chinese addresses are supported for suggestions based on calendar events data.

Contact Information Suggestion

When a user taps an input component whose ContentType is PHONE_NUMBER, if the form contains an input component whose ContentType is PERSON_FULL_NAME or contains two input components whose ContentType is PERSON_LAST_NAME and PERSON_FIRST_NAME respectively that have been filled, contacts information will be recommended based on the input name information.

License Plate Information Suggestion

SmartFill supports license plate number filling suggestions since version 5.1.0(18).

If a form requires license plate number input, related suggestions can be obtained from the license plate information of the device owner stored in recent forms.

Passport Information Suggestion

SmartFill supports passport information filling suggestions since version 5.1.0(18).

In the scenario where a form contains an input component whose ContentType is COUNTRY_ADDRESS (nationality), PASSPORT_NUMBER (passport number), VALIDITY (expiration date), or ISSUE_AT (issuance place), if a component requires name input is tapped, passport information can be obtained from recent forms to offer suggestions.

Invoice Title Suggestion

SmartFill supports invoice title information filling suggestions since version 5.1.0(18).

In the scenario where a form contains an input component whose ContentType is ORGANIZATION (organization name) and also an input component whose ContentType is TAX_ID, suggestions can be made. If the former component (ORGANIZATION) is tapped, suggestions can be made either based on the data obtained from Account Kit or based on the user input. Then suggestions for the component with ContentType set to TAX_ID will be provided based on the organization name input. If only one of the components exists, suggestions will not be available.

Recent Forms

Previously filled form information can be saved in your app or atomic service for later filling suggestions.

Saving Recent Forms

When a user fills a form, input components with the ContentType attribute set will trigger recent form saving, asking the user whether to save the input. If the user confirms, they will be then asked whether to enable SmartFill, so that forms can be filled in with a single tap later.

NOTE
  • When a user switches or exits a page in a form for which SmartFill is enabled, the requestAutoSave API is called to show the saving page, asking the user whether to save the input in a pop-up. You can also actively call this API to save recent forms.

  • After the user taps the button to confirm saving of recent forms on the displayed page, if the SmartFill function has not been enabled, the user will be further prompted to enable this function. Only by enabling the function will recent forms be saved.

  • If the user ignores saving of recent forms, the same app will not ask the user again within 24 hours. If saving of recent forms is ignored for five times on the same device, the user will be prompted to choose whether they don't want to be asked again.

Updating Recent Forms

In the scenario where a form contains an input component whose ContentType is PERSON_FULL_NAME as well as another input component with the ContentType attribute set, if a user enters a name that already exists but other input information is different from recent form information saved for the name, the user will be asked whether to update the saved input or save the current input as a new record.

Adding or Modifying Recent Forms Manually

A user can manage recent forms under Smart fill or Personal info. They can either add new records or modify or delete existing records. If a lock screen password is set for the device, the user needs to enter the password to check recent forms.

Data Synchronization with Cloud Space Service

Data is synchronized across multiple devices under the same HUAWEI ID through the cloud space service.

Data Synchronization Across Multiple Devices with Cloud Space Service

After a user signs in to their HUAWEI ID, SmartFill is enabled under Cloud, and recent form data can be synchronized between multiple devices.

Search in Guides
Enter a keyword.