diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..93ddebe4fa3c6312a58b8589dbde6f48947a110f --- /dev/null +++ b/README.en.md @@ -0,0 +1,31 @@ +# Preferences + +### Introduction + +Learn to access and operate local application data based on preferences. The display effect is as follows: + +![image](screenshots/device/preference.en.gif) + +### Concepts + +- Preferences: a module that provides APIs for processing data in the form of key-value (KV) pairs, including querying, modifying, and persisting KV pairs. The key is a string, and the value can be a number, a string, a Boolean value, or an array of them. +- TextInput: a component that provides single-line text input. +- Button: a component used to quickly create buttons of different styles. + +### Permissions + +N/A + +### How to Use + +1. In the Fruit and Number text boxes, enter the corresponding fruit name and quantity, and tap the **Write DB** button to save the entered data to the preferences. +2. Exit the app and open it again. The data saved last time is displayed in the Fruit and Number text boxes. +3. Tap the **Read DB** button. The data saved last time is displayed in the Fruit and Number text boxes. +4. Tap the **Delete DB File** button. The data in the Fruit and Number text boxes is cleared, and the data in the preferences and the corresponding database file is deleted. + +### Constraints + +1. The sample app is supported only on Huawei phones running the standard system. +2. HarmonyOS: HarmonyOS NEXT Developer Beta 1 or later +3. DevEco Studio: DevEco Studio NEXT Developer Beta 1 or later +4. HarmonyOS SDK: HarmonyOS NEXT Developer Beta 1 SDK or later diff --git a/screenshots/device/preference.en.gif b/screenshots/device/preference.en.gif new file mode 100644 index 0000000000000000000000000000000000000000..60ee46e0296c0b4ebb9ea2fc4cf2dde8e4e93609 Binary files /dev/null and b/screenshots/device/preference.en.gif differ