Emrah Ozbekar
Emrah Ozbekar

Reputation: 61

Tracking geo-location in background every 5 mins interval with Windows Phone 8

I want to get geo-location every 5 mins interval and it should run in the backgound using Windows Phone 8 SDK.

I've been thinking to use a Periodic Task but it runs in 20 mins interval which is not frequent enough. I can run it more frequently by using

ScheduledActionService.LaunchForTest(periodicTaskName, TimeSpan.FromSeconds(300));

but i think this will not be welcomed when i want to publish this app in the market.

Then I've checked continuously tracking the location but it doesnt stop using gps sensor unless you stop it manually.

I'll appreciate any guidance that will lead me to achieve my goal.

Thanks for any help.

Upvotes: 2

Views: 175

Answers (1)

Luan Seminario
Luan Seminario

Reputation: 101

Using Geolocator:

 geolocator = new Geolocator();
 geolocator.DesiredAccuracy = PositionAccuracy.High;
 geolocator.ReportInterval = 5000; //Here you can set the interval between every location tracked (in milisseconds)

It works fine for me

Upvotes: 2

Related Questions