0

I am developing windows mobile application. I want to create geofence when storing the location to the sqlite database to generate SMS alerts when entering to the geofence. I am loading the location to the text boxes through map.

This is the code so far

private void Load_Location(object sender, RoutedEventArgs e)
{
    LattxtBx.Text = String.Format("{0}", AddLocation.Center.Position.Latitude);
    LongtxtBx.Text = String.Format("{0}", AddLocation.Center.Position.Longitude);
}

private async void AddContact_Click(object sender, RoutedEventArgs e)
{
    DatabaseHelperClass Db_Helper = new DatabaseHelperClass();//Creating object for DatabaseHelperClass.cs from ViewModel/DatabaseHelperClass.cs 
    if (NametxtBx.Text != "" & AgetxtBx.Text != "" & AddresstxtBx.Text != "" & SchooltxtBx.Text != "" & GardienttxtBx.Text != "" & PhonetxtBx.Text != "" & LattxtBx.Text != "" & LongtxtBx.Text != "")
    {
        Db_Helper.Insert(new Contacts(NametxtBx.Text, AgetxtBx.Text, AddresstxtBx.Text, SchooltxtBx.Text, GardienttxtBx.Text, PhonetxtBx.Text, LattxtBx.Text, LongtxtBx.Text));
        Frame.Navigate(typeof(ReadContactList));//after add contact redirect to contact listbox page 
    }
    else
    {
        MessageDialog messageDialog = new MessageDialog("Please fill all fields");//Text should not be empty 
        await messageDialog.ShowAsync();
    }
}
Thilina Akalanka
  • 163
  • 1
  • 14
  • And you expect us to write your code for you? What is the problem you're having? – CL. Dec 26 '15 at 08:28
  • 1
    I am new to this :( . I thought this kind of thing has been done by someone before. Any similar example would be helpful. Thanks in advance for your time. – Thilina Akalanka Dec 26 '15 at 08:48

1 Answers1

0

Jan has written an algorithm to check if a lat/long is inside a fence (a list of lat/longs) See here

Community
  • 1
  • 1
Fidel
  • 7,027
  • 11
  • 57
  • 81