Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting latitude and longitude without a GPS (Windows Mobile)

I wondering if there is a method to obtain latitude and longitude of my position without using a GPS.

I developing a Windows Form application for Windows Mobile 5.0 and above, C# and .NET Compact Framework. I use GPS and Bing Maps to show the user position on a map but sometimes it'd imposible to determinate user position using GPS. I saw that Google maps (for example) can determinate the area of user could be.

How can I do that on my application?

Thank you!

like image 527
VansFannel Avatar asked Dec 17 '22 04:12

VansFannel


2 Answers

Cell ID can be used to give a very rough geographical area; there is an open source effort to get this info, and various companies sell the info, and if you dig hard enough you might find the unpublished APIs that Google maps uses.

http://www.codeproject.com/KB/mobile/DeepCast.aspx, as linked in another post, demonstrates how to get the cell ID and send it to Google's unpublished API for resolution.

like image 138
Will Avatar answered Jan 02 '23 01:01

Will


Seems like you can subscribe to GPS location change events:

private Gps _gps = new Gps();
private GpsPosition _currentPosition;

public void Start()
{
    _gps.LocationChanged += new 
      Microsoft.Location.LocationChangedEventHandler(_gps_LocationChanged);

    if (!_gps.Opened)
    {
        _gps.Open();
    }
}

private void _gps_LocationChanged(object sender, 
        Microsoft.Location.LocationChangedEventArgs args)
{
    _currentPosition = args.Position;
}

See this article for further details, and also details of how to get your location using cell towers:

Finding your location on a Windows Mobile device

like image 36
John Sibly Avatar answered Jan 02 '23 02:01

John Sibly