views:

2039

answers:

6

Hello!

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!

A: 

Yes even I wonder when GPS is not working (like when I'm inside office or a shopping mall) but Google Maps gives almost accurate position. I suspect it uses information provided by aGPS (Assisted GPS) servers to GPS. GPS systems on most mobile phones are also using this technology.

TheVillageIdiot
+2  A: 

If you have a GSM phone there are a few hacks you can perform using the Radio Interface Layer. One such this one on devex.com.

Matthew Whited
+5  A: 

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

John Sibly
Yes, I 'm doing this now. But, when I start the application and GPS starts to run, there is no location given by the GPS and others situations without GPS signal. Then I need another way to obtain user's location.
VansFannel
A: 

One mechanism could be to triangulate using mobile phone masts. If you can work out how far you are away from two or more known locations then you can calculate your position.

However, (and it's a big however), I don't know how you (as a developer) can:

a) get access to the location of all mobile phone masts in your locale

b) interrogate the masts to see which ones they are to look up in your database.

I believe this is how aGPS (as mentioned by TheVillageIdiot) works - but that's on a phone which will have access to this information.

ChrisF
This information is free if you talk to the phones radio transceiver… assuming it watches for multiple cells and find the best/closest one, such as GSM phones.
Matthew Whited
Some limited support on android, otherwise not available to 3rd parties on all other platforms
Will
+4  A: 

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.

Will
I hear something about using Google Gears with my WinForm app, but I don't know how!
VansFannel
One thing about http://www.codeproject.com/KB/mobile/DeepCast.aspx: I think it's better to use Google Gears instead of this because Google's unpublished API may change, isn't it?
VansFannel
get it working, then think philosophically.
Will
A: 

google maps uses a service called "geolocation" to determine your position. this is done by analyzing the nearest WLAN access points. if this doesn't work or there are no WLAN access points, your ip is used.

further reading: http://apb.directionsmag.com/archives/6094-How-Google-Maps-uses-the-W3C-Geolocation-API-and-Google-Location-Services.html

Markus