Korki Korkig
Korki Korkig

Reputation: 2814

Update database files in Winrt (Metro) applications

I have an app which uses a xml file as database. This file is created in the project as you see: enter image description here

I want to keep this file updated by the following procedure in the splash screen:

procedure

  1. get the last modified dates of the local xml file and the remote xml file(http://www.somewhereontheinternet.com/data.xml)
  2. compare these two dates
  3. if the remote one has the most recent modified date then download it and replace the local one with it

The application will be deployed to the clients via Windows Store.

If you think about the restrictions, limitations, policies and possibilities, can I keep the deployed app's database files updated as described above? If not how can I keep my app's data updated then?

Upvotes: 0

Views: 256

Answers (1)

Sushil
Sushil

Reputation: 5535

Few things:

1) It will be more clean to do this by associating a version to the database. local version can be stored in the application data as local state or setting. remote version can be queried using a web api.

2) do you want user to know about this? can user force update of the database? accordingly, knobs may need to be exposed in the UI.

3) if the size of the file is significant, may have to do the download using background transfer.

steps will look something like this:

  1. check remote version when the app is launched (async).
  2. if the versions differ, schedule background transfer or download while the app is running depending on the size of the file.

Upvotes: 1

Related Questions