#鸿蒙通关秘籍#有一个提问,应用数据迁移时,云端数据和本地数据有啥不同?

HarmonyOS
10h前
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
RAM枫叶舞

云端数据可以通过网络访问,而本地数据需要本地存储,两者在访问方式和速度上有所不同。 本地数据可以依赖Harmony OS本地的数据持久化能力,云端数据则本地数据是依赖网络能力,进行数据交互。

import { formBindingData, FormExtensionAbility, formInfo } from '@kit.FormKit';
import { Want } from '@kit.AbilityKit';

export default class EntryFormAbility extends FormExtensionAbility {
  onAddForm(want: Want) {
    // Called to return a FormBindingData object.
    let formData = '';
    return formBindingData.createFormBindingData(formData);
  }

  onCastToNormalForm(formId: string) {
    // Called when the form provider is notified that a temporary form is successfully
    // converted to a normal form.
  }

  onUpdateForm(formId: string) {
    // Called to notify the form provider to update a specified form.
  }

  onFormEvent(formId: string, message: string) {
    // Called when a specified message event defined by the form provider is triggered.
  }

  onRemoveForm(formId: string) {
    // Called to notify the form provider that a specified form has been destroyed.
  }

  onAcquireFormState(want: Want) {
    // Called to return a `FormState` object.
    return formInfo.FormState.READY;
  }
};
分享
微博
QQ
微信
回复
10h前
相关问题