It provides runtime state, app options, user choices, resource content (for instance the dictionary descriptions in a dictionary application), along with other settings. App data is different from consumer facts, facts your individual brings about and handles whenever using an app. Individual data contains document or mass media data, mail or telecommunications transcripts, or database data holding content produced by the consumer. Individual data is of good use or significant to more than one software. Often, this really is facts that consumer desires to change or transfer as an entity in addition to the app itself, such as for instance a document.
Crucial mention about software data: The time of the app information is tied to the duration of the application. If software is removed, all the application facts is forgotten for that reason. Don’t use app information to save consumer facts or something that people might see as important and irreplaceable. We recommend that the user’s libraries and Microsoft OneDrive be used to store this kind of details. Application data is ideal for storing app-specific consumer choice, setup, and preferences.
Types of software facts
There are two forms of application facts: configurations and data files.
Configurations
Usage setup to store consumer choices and program condition information. The software facts API enables you to effortlessly make and recover options (we are going to demonstrate a few examples afterwards in this essay).
Listed below are data types you are able to for software configurations:
- UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Single, Dual
- Boolean
- Char16, String
- DateTime, TimeSpan
- For C#/.NET, need: System.DateTimeOffset, System.TimeSpan
- GUID, Aim, Proportions, Rect
- ApplicationDataCompositeValue: some associated application setup that really must be serialized and deserialized atomically. Use composite settings to conveniently handle atomic posts of interdependent options. The computer ensures the ethics of composite configurations during concurrent accessibility and roaming. Composite settings become enhanced for small quantities of information, and performance can be bad if you use all of them for big information units.
Data Files
Need data to save digital information or perhaps to let a, tailored serialized sort.
Keeping software information in the application information stores
Whenever an app was installed, the computer gives it a unique per-user information shops for configurations and data files. You should not discover in which or exactly how this information is out there, because the experience accountable for controlling the real storage, making certain the info is actually kept separated off their apps as well as other people. The device in addition preserves the belongings in these facts stores once the individual installs an update to your app and eliminates the belongings in these facts sites completely and cleanly once software is uninstalled.
Within its application information shop, each application features system-defined underlying websites: one for regional records, one for wandering records, plus one for temporary files. Your application could add new files and newer bins every single of these root directories.
Local app data
Neighborhood app data should-be useful for any suggestions that should be protected between app sessions and is also perhaps not suitable for roaming app data. Information which is not relevant on some other products must certanly be retained here nicely. There’s absolutely no basic dimensions regulation on neighborhood information put. Make use of the local application data put for facts so it cannot add up to roam and also for large information sets.
Access your local application information store
Before you can see or create regional application facts, you need to retrieve the regional app data store. To recover the regional application facts store, utilize the ApplicationData.LocalSettings belongings to get the application’s neighborhood options as an ApplicationDataContainer object. Utilize the ApplicationData.LocalFolder land to have the records in a StorageFolder item. Utilize the ApplicationData.LocalCacheFolder residential property to have the folder when you look at the local application information save where you can save data that aren’t incorporated into back-up and improve.
Create and retrieve an easy neighborhood style
To create or create a setting, use the ApplicationDataContainer.Values home to view the configurations during the localSettings bin we had gotten in the earlier action. This instance produces a setting known as exampleSetting .
To retrieve the setting, you utilize similar ApplicationDataContainer.Values property that you accustomed produce the environment. This sample reveals just how to access the environment we simply developed.
Make and retrieve a local composite importance
Generate or create a composite appreciate, develop an ApplicationDataCompositeValue object. This sample creates a composite setting named exampleCompositeSetting and brings it into localSettings container.