Results 1 to 5 of 5

Thread: How to save the state of my windows phone 7 application

  1. #1
    Join Date
    Oct 2010
    Posts
    66

    How to save the state of my windows phone 7 application

    After the launch of WP7 Microsoft also released CTP (tools) keeping it mind of user’s feedback. Now the WP7 supports pause and resume event. But the problem is I couldn’t understand the entire event. Can I save the event of apps on my own? When I put the application to background without closing it do I obtain pause event or the OS will save my app state automatically? I want to save and load the app state and use it when I need or when I obtain the rehydrated event. How and when I need to do this task?

  2. #2
    Join Date
    Feb 2010
    Posts
    524
    You can get the events from the msdn library by specifying the relevant namespace. When you move the app to background there will be chance that app may get killed by OS. If not you can ignore saving the state. If the OS is killing your background app then saves the state because the OS will not do it automatically. The XNA apps offers event handler which can be used to store state in Isolated Storage so that you can restore it on resume.

  3. #3
    Join Date
    Feb 2010
    Posts
    537
    The major headache on the phones is shortage of battery life. If the applications are keep running on the desktop or screen there will be chance of quick power outage from the battery. In this case user has to start the app process from the beginning. So it is important to save the state of the app where you left it off. You can use System.IO.Isolated namespace to save state. Some application contains this simple feature like textbox for URL, Webbrowser control and navigation button.

  4. #4
    Join Date
    Feb 2010
    Posts
    428
    In order to save the temporary application state you should use the state property of the phone application service. This property will store the state into the Deactivated (OnNavigateForm) event handler and repossess the App state the Activated (OnNavigateTo) event handler. There is no guarantee that the application will be activated after it’s been headstoned.

  5. #5
    Join Date
    Feb 2010
    Posts
    390
    You can do the following things in order to save the state of your most used application.When you will pause the app and send it to the background save the state in isolated storage settings in any file format depending on the application. Next you can delete the state file when app will resume. When you obtain the rehydrated event start the app, check for the state file that you have stored before, load it and restore the app. This is about the XNA app. I don’t have much idea about the silverlight app.

Similar Threads

  1. Replies: 7
    Last Post: 08-12-2011, 10:55 AM
  2. Replies: 5
    Last Post: 27-10-2011, 05:10 PM
  3. Need to save PDF files in windows phone 7
    By MACALL in forum Portable Devices
    Replies: 8
    Last Post: 02-09-2011, 10:09 PM
  4. Save or load game state in Crysis 2
    By HKrish in forum Video Games
    Replies: 5
    Last Post: 25-03-2011, 10:12 AM
  5. Replies: 3
    Last Post: 19-12-2010, 04:01 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,016,021.14037 seconds with 17 queries