私はWindows 10が新しく、現在位置情報ベースのアプリケーションで作業しています。私の要件は、特定の時間間隔のユーザーの場所を追跡し、10分ごとにサーバーにデータを送信することです。誰かがこれがWindows 10で可能かどうかを提案できますか?私はこれを知らない。アプリがWindows 10のバックグラウンドにあるときの位置のトラッキング?
更新
私も、私は唯一の場所の詳細を取得するには、アプリがalso.Iは、コードの下にこれらの中
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
if (e.NavigationMode == NavigationMode.New)
{
var extendedSession = new ExtendedExecutionSession();
extendedSession.Reason = ExtendedExecutionReason.LocationTracking;
extendedSession.Description = "Location tracking";
ExtendedExecutionResult result = await extendedSession.RequestExtensionAsync();
if (result == ExtendedExecutionResult.Allowed)
{
Debug.WriteLine("Background execution approved");
}
else
{
Debug.WriteLine("Background execution denied");
}
Geolocator locator = new Geolocator();
locator.DesiredAccuracyInMeters = 0;
locator.MovementThreshold = 500;
locator.DesiredAccuracy = PositionAccuracy.High;
locator.PositionChanged += Locator_PositionChanged;
}
}
private void Locator_PositionChanged(Geolocator sender, PositionChangedEventArgs args)
{
Debug.WriteLine(args.Position.Coordinate.Latitude.ToString("0.00000000") + " " + args.Position.Coordinate.Longitude.ToString("0.00000000"));
if (MCSManager.Instance.userDetails != null && MCSManager.Instance.userDetails.LOC_TRACK_ENABLED.Equals("1") && userSettings.Values.ContainsKey(Constants.USER_ID))
{
DatabaseManager dbManager = new DatabaseManager();
Location_Tracking location_tracking = WebserviceED.StoreLocationData(args.Position.Coordinate.Latitude.ToString(),
args.Position.Coordinate.Longitude.ToString(), WebserviceED.getTimestamp(), args.Position.Coordinate.Accuracy.ToString());
var insertSuccessfull = dbManager.insertSingleRecord(location_tracking);
}
}
をしようとした背景にあるときに上記をしたいときアプリフォアグラウンドまたは最小化されています。私はアプリを殺すと、それは私に場所の詳細を与えることはありません。また、バックグラウンドタスクでこれを使用する方法と、ユーザーがアプリを強制終了してもサーバーにデータを送信する時間トリガーを起動する方法を教えてください。
また、複数のバックグラウンドタスクを使用できますか?私はTimeTriggerを使ってサーバーにデータを送信し、もう1つはプッシュ通知の目的で使用したいと考えています。
https://msdn.microsoft.com/library/windows/apps/ windows.devices.geolocation.aspx –
同様のケースがあります。[リアルタイムGPS UWP](http://stackoverflow.com/questions/36196993/real-time-gps-uwp)を参照してください。 –
こんにちは、このページの他の人からアドバイスを受けてください。ジオロケーションとバックグラウンドタスクの基本を理解する必要があります。私は恐怖を感じています。 – peterincumbria