The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
[UWP]Continious location Tracking in Universal Windows apps RRS feed

  • Question

  • hello,

    I have developed a application, that tracks location in real time. but that works on Silverlight 8.1 platform. Want to port same application on the Universal Windows platform so that it can work on windows mobile 8.1 and 10 as well. Some how I am not able to achieve the basic functionality of having the background process, that update our server when Application is running in background, or phone is locked.

    Any help in this regard will be appriciated.

    Regards


    Kishor

    Monday, July 27, 2015 7:10 AM

All replies

  • How did you implement the background task in the WUA? What is your problem in detail?

    Do you know this Background Task Documentation?


    Robin Sedlaczek (https://twitter.com/RobinSedlaczek, http://robinsedlaczek.wordpress.com) @ Microsoft Forums (Wave Developments / The Berlin Microsoft Connection - https://www.facebook.com/TheBerlinMicrosoftConnection)

    Monday, July 27, 2015 10:10 AM
  • hi,

    Thanks for your interest. As per the sample provided by microsoft and reference I have implemented solution using Geofence.

    http://www.c-sharpcorner.com/UploadFile/890595/geofencing-in-windows-phone-8-1-winrt/

    I am creating fence and triggering the In and Out movement. some how it works on foreground and not on background. Basic problem is wanted to achieve the smooth location in background.

    Regards


    Kishor

    Wednesday, July 29, 2015 10:20 AM
  • In my experience, there is no good support in Windows Phone 8.1, in Windows 10, looks like Extended Execution feature is the key point:

    http://www.sharpgis.net/post/2015/03/29/Using-Windows-10s-Extended-Execution

    private ExtendedExecutionSession session;
     
    private async void StartLocationExtensionSession()
    {
       session = new ExtendedExecutionSession();
       session.Description = "Location Tracker";
       session.Reason = ExtendedExecutionReason.LocationTracking;
       session.Revoked += ExtendedExecutionSession_Revoked;
       var result = await session.RequestExtensionAsync();
       if (result == ExtendedExecutionResult.Denied)
       {
           //TODO: handle denied
       }
    }


    Best Regards,
    Please remember to mark the replies as answers if they help

    • Proposed as answer by IssueKiller Thursday, July 30, 2015 12:18 PM
    Thursday, July 30, 2015 12:18 PM
  • hi,

    Thanks for your reply. I will need to check on the solution you have provided. There is constraint, that I need to stick to 8.1. My solution when deployed on the phone, works randomly. some times 2 events in one minute and not a single event in 6-7 hours. that is strange.

    Regards


    Kishor

    Friday, July 31, 2015 8:51 AM