How to update the downloaded Maps using MapUpdaterTask in Windows Phone?

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

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...