Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
275 views
in Technique[技术] by (71.8m points)

java me - How to use GPS indoors on a mobile device?

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();
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...