Copy a file when App is closed RRS feed

  • Question

  • I developed a UWP app that uses a SqLite database in AppData/../LocalState. What is missing so far is an automatic backup of the database file to a user-defined storage location.

    I would like to do the backup when the app terminates to avoid excessive copying while the app is being used. I have read a lot about a Suspend handler and a possible BackgroundTask to do this but I am still not sure what the best solution would be. Can someone shed some light on this? Is it possible to have such a background tasks that also would cope with errors like: the storage location is a USB disk but it is not available. I think a background task can issue Toasts to alert the user, but can it really interact with the user?

    Wednesday, April 18, 2018 9:19 AM

All replies