I‘m developing a UWP running app, and I want to record user's location in real time.I've read many threads throw google, and got some solutions as: ExtendedExecutionSession , app service. But these two solutions have a same problem: cannot record the location when app is suspended. I know the background task in uwp, it seems need a trigger(e. g. SystemTrigger) to launch. Is it possible to launch (do not use trigger but call directly) a custom background task when app is suspended to track/record location?
Linked Questions
- Can't find System.Windows.Input.Mouse in C# windows form application
- FB apps GDPR testing
- Requesting SQL assistance?
- How to change CPU ID
- C# Calendar Object on top
- How can i make the text in the label move like in (marquee) if the label width not fit the text width in C# windows form application?
- System.MissingMethodException: 'Method not found for XmlRpcProxyGen.Create
- Small context errors
- Not able to loop through a generic Iterate function
- C# Process issue
- How to use Sikulisharp in Visual Studio 2017
- How to create an array of geofences with GMAPS.NET
- C# Math.Round ambiguous issue
- C# expanding panel
- How can I execute dynamic SQL in c#?
Popular Questions
- Partially applied generic function "cannot be cast to Nothing"
- Agar.io style ripple effect for canvas arcs
- What is the difference between [ValidateModel] and a check of valid state in ASP.NET?
- Passing shared_ptr to std::function (member function)
- UWP location tracking even when the app was suspended
- Dynamic partition in hive
- Woocommerce Different Products Different Currency
- High and low bytes in VBA
- Rails render js file but can't execute it
- My rotated TextView is cut off. What i have to do?
1 Answers
Related Questions
- Export Datagrid to an xml
- Fonction rejouer en c#
- Noop for Func<Task>?
- How to open Thumbscache.db
- C# How do I extract the value of a property in a PropertyCollection?
- C# - Korean Encoding
- Inconsistent accessibility CS053
- C# Memory.Span Unexpectedly Slow
- How to fix 'web client upload data' method with the url while sending the files to sharepoint?
- Want to list all Image Files in a folder using C#
- How to sort 2D array (row-wise) in Visual Studio C#?
- C# Deferred Property Setting
- C#, problem with my reverse string method not working in main method
- Need to traverse through .cs files in a solution and determine if a function is used
- Get data of multiple datagridew c#
First I would like to answer your question:
Yes, you can do this with the ApplicationTrigger class. See https://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.background.applicationtrigger (It's still a trigger, since the API needs it, but it basically calls the backgroundtask directly from the app)
But here are some samples for doing location tracking and these kind of things: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/Geolocation
I think what you are looking for is the LocationTrigger (see: https://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.background.locationtrigger) It is used in the Geofence sample (Scenario5_GeofenceBackgroundTask.xaml.cs)
Basically you register it like this: (it’s from the sample code)