0
votes

I am developing a windows phone app, which is handling some secured information.

Here my question is

1)Is it possible to get notified got or any event triggered inside our app, when the user reset(make the phone fresh, all data will be lost) the windows phone.

Can anybody have clear idea about this.

Thank you . Noorul

1
Why did you need that? After resets, your app would not be installed anymore.Swift Sharp
If I got few seconds before reset, i can transfer important data by a mail or web-service .So that we wont loose it, that why.Noorul
Even we could get that event, I think that is unsafe to do that operation at that time. If the app has important data, why don't you save it regularly?2power10

1 Answers

0
votes

No. There is a list of supported events and a device reset is none of them. And IMHO: Even if you'd be able to listen for such an event - it would be the wrong way.

If you have important data to backup:

Do it when your app gets suspended! When the suspension is triggered you have around 10 seconds to backup important data.

Application.Current.Suspending += new SuspendingEventHandler(App_Suspending);

async void App_Suspending(
    Object sender, 
    Windows.ApplicationModel.SuspendingEventArgs e)
{
    // TODO: This is the time to save app data in case the process is terminated
}

Just save it to the roaming data storage or folder and you will be able to use it again after a reset.

It's fairly easy and requires only a few lines of code:

https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh700362.aspx