【问题标题】:Create Geofence while storing the location to the sqlite database [duplicate]在将位置存储到sqlite数据库时创建地理围栏[重复]
【发布时间】:2016-03-31 20:05:27
【问题描述】:

我正在开发 Windows 移动应用程序。我想在将位置存储到 sqlite 数据库时创建地理围栏,以便在进入地理围栏时生成 SMS 警报。我正在通过地图将位置加载到文本框中。

这是目前的代码

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();
    }
}

【问题讨论】:

  • 您希望我们为您编写代码吗?你遇到了什么问题?
  • 我是新手 :( 。我认为这种事情以前有人做过。任何类似的例子都会有所帮助。提前感谢您的时间。

标签: c# sqlite windows-phone-8 windows-phone-8.1 geofencing


【解决方案1】:

Jan 编写了一个算法来检查纬度/经度是否在栅栏内(纬度/经度列表)请参阅 here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多