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();
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With