In one of my previous blog post, I explained the use of the MapDownloaderTask in Windows Phone. In this blog post, I will explain how the developers can use the MapUpdaterTask in Windows Phone to update the Maps.
The Windows Phone SDK provides the Launcher “MapUpdaterTask” that enables the users to update the map that was downloaded earlier.
How to update the downloaded Maps using MapUpdaterTask in Windows Phone?
Updating the downloaded Maps in Windows Phone is easier. Just create an instance of the MapUpdaterTask and call the show method of the MapUpdaterTask.
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Navigation; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using PhoneApp2.Resources; using Microsoft.Phone.Tasks; namespace PhoneApp2 { public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { InitializeComponent(); UpdateMap(); } // SK - To update the map private void UpdateMap() { try { MapUpdaterTask mapUpdate = new MapUpdaterTask(); mapUpdate.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } }
MapUpdaterTask’s show method will launch the Maps settings app. This will search for the updates for the Maps that were installed previously for offline use and displays if there are any updates available for those maps.
The user can simply select the map from the Updates Screen and tap the “install” button to install the updates