tags:

views:

377

answers:

4

I am new to mobile applications. Basically I want to get the user's GPS coordinates indoors. I have no problem detecting the mobile device outdoors, only when indoors it is giving me problems. I have tried setting the accuracy, but no avail.

Is there a solution to it?

Here is my code:

new Thread()
{

    public void run()
    {
        try
        {
            Criteria cr= new Criteria();
            cr.setHorizontalAccuracy(1000);
            LocationProvider lp= LocationProvider.getInstance(cr);

            Location l = lp.getLocation(60);
            Coordinates c = l.getQualifiedCoordinates();

            if(c != null )
            {
                lat = c.getLatitude();
                lon = c.getLongitude();
            }
        }
        catch(Exception e)
        {
            System.out.println("Error");
        }
    }
}.start();
+6  A: 

Unfortunately GPS was never intended to work indoors. In fact, most consumer GPS sensors are not capable of acquiring a valid GPS fix unless they have a clear view of the sky. Even high-rise buildings and dense trees may cause significant problems.

Daniel Vassallo
Hi,thanks for the quick reply. But for example, those in-build application in the mobile device such as E71 maps or google map for mobile. How does those application able to detect your location even when i am indoor??
Nivek
Most mobile devices will do the following when they cannot get a valid GPS fix: 1. Use cell-tower triangulation http://en.wikipedia.org/wiki/Mobile_phone_tracking#Network_Based; 2. Use the last acquired GPS location.
Daniel Vassallo
+1  A: 

There are databases of WiFi access points out there, so you can get a pretty good idea from what access points are in range: http://gadgets.boingboing.net/2008/10/22/google-gears-adds-wi.html http://www.skyhookwireless.com/

Andrew McGregor
+1  A: 

I thought that JSR 179 supported network based positioning out of the box, since Google Maps is a Java app which has this functionality. But according to the Sony Ericsson developer forum and some posts on the Nokia developer forums, it looks like your best bet is to look up the cell id yourself via system properties, and use a lookup service like opencellid.org.

On Nokias it seems to be possible to make network based positioning work directly via JSR 179 though, although it involves altering phone settings.

Set

Menu ->Settings->Phone sett. -> General->Positioning->Positioning server

to supl.nokia.com (pasted from nokia dev forums). This will enable Network based positioning. For the available location methods, see Location Methods in S60.

disown
+7  A: 

GPS is based on range estimates from emitting satellites to your receiver. Your GPS receiver needs (in general) signal from at least 4 satellites to be able to compute its location. Signal levels for the L1 band in open sky conditions approximately reach -130dBm. Commercial receivers, such as those integrated in mobile phones, are able to track satellites down to -160dBm. Under this threshold, the receiver is not able to use the signal. This 30dB margin allows for some attenuation from obstacles such as foliage, glass windows, even light walls, but several building storeys completely mask signals from almost all directions, making GPS completely unavailable. And even if the attenuation allows the receiver to use the signals to compute its positions, the accuracy achieved probably won't be sufficient for your target application (the accuracy is degraded by signal attenuation).

On the other hand, Wi-Fi location systems such as Skyhook's (implemented on many mobile platforms) are often able to compute a location inside of buildings, but this method faces two main drawbacks:

  • The database coverage does not include indoor sites (AFAIK), so the returned location is very approximate and unusable for any application.
  • The Wi-Fi location algorithms, based on range-estimation to hotspots using signal levels, is affected very much by indoor obstacles (people, furniture, etc.). This decreases the positioning accuracy.

There is a third option : integrate the acceleration from the MEMS chpset in the mobile phone, from the last known GPS position. This might work under certain conditions...

In conclusion, there is no off-the-shelf solution for indoor location in mobile phones, but some are working on the subject (e.g. http://www.polestar.eu/en/node/111/y)

Edit : I forgot to mention cell-tower based positioning, which is available as long as the phone has an active data correction to the cellular network. This method is only accurate enough to give the city where the mobile phone is located.

Stéphane
+1 Good summary
Daniel Vassallo