I am developing windows phone 8.1 app to school service drivers to send SMS notifications when it enters to the geofence of students' home. Currently I save student profile details in sQlite database with the location (long, lat). How can I dynamically create geofence while I am saving the student profile. Sample code or previous example would be very helpful.
-
Possible duplicate of [Create Geofence while storing the location to the sqlite database](http://stackoverflow.com/questions/34468690/create-geofence-while-storing-the-location-to-the-sqlite-database) – Depechie Dec 29 '15 at 09:49
1 Answers
Not sure what you would like to do with the geofences... but the general approach is explained here : http://www.jayway.com/2014/04/22/windows-phone-8-1-for-developers-geolocation-and-geofencing/ and here : http://blog.rajenki.com/2014/04/trigger-background-task-using-geofence-windows-phone-8-1/
Big take away from this is:
You create one Geofence object for each location you want to be notified about. All properties are set in the constructor and the required ones are the unique Id and a Geoshape to describe the area that triggers the notification. Geocircle is the only supported Geoshape at the moment, and it is basically a Geopoint with a radius.
In other words, for each stored student profile lat / long you create a geopoint and add the radius for the geofence.
But if this would change dynamically in any way, here is another blog post describing how you 'could' change the geofence while travelling. DO NOTE this is not working very well - see post for notes : http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2014/04/25/windows-phone-8-1-and-the-rolling-geofence.aspx

- 6,102
- 24
- 46