I am a new developer and have a simple question that I have searched all over for, but have not found a clear answer yet...
Simply put, I am developing an application that needs to be able to use GPS. The trick is however that I would like to use GPS to get a phone's location even if they have no carrier service.
With that said I have 2 questions.
Is is possible to get the GPS location of a phone with no carrier service with a wifi connection?
Is is possible to get the GPS location of a phone with no carrier service AND no wifi service?
Thanks in advance
Yes, it is on many handsets. The WiFi network may be mapped which will speed up the AGPS chip, or allow offloading of position calculation to the provider.
Varies by the GPS chip in question. In some cases, it will simply not work (the GPS processor requires network communication). In most cases the GPS will take up to 10 minutes to fix from a cold start, as it must receive the current satellite almanac in order to compute position.
While it it true that AGPS is dependent on some kind of data communication most Android phones have true GPS chipsets which means that they communicate with satellites in space regardless of any data connection. This will provide a more accurate position, but will be slower to acquire. Your best bet is to listen for position updates from both Network and GPS providers so that phones with a data connection will get a fast, rough fix that can be refined by the GPS and phones that don't have a data connection will simply not raise an event until the GPS gets a fix. If you want to be extremely robust then don't block waiting on the fix so the user can at least continue to use your app instead of staring at a spinning icon.
Related
Is it possible to get the coordinates only with the mobile network enabled?
I need to get the coordinates within 30 seconds. Because when the user clicks the button to hide, it can not be too long to get the coordinates.
I can not use NETWORK_PROVIDER to get the coordinates of the Wi-Fi network because the user will be on the street and not connected to a Wi-Fi network, but will have the mobile data network connected.
Is it possible to get coordinates over the mobile data network?
I know GPS_PROVIDER is slower than NETWORK_PROVIDER, so I'd like to know if it's possible as I said above. Thank you!
Is it possible to get the coordinates only with the mobile network enabled?
Yes. For example, navigation apps work while driving in open spaces, far from any WiFi.
I need to get the coordinates within 30 seconds
There is no way to guarantee this. There is no way to guarantee that you can get a GPS fix in any amount of time. There are plenty of places in the world where it is difficult to get GPS signals.
Android is constantly changing. Currently, the Fused Location API is being used for location detection. But in my experience, without a Data connection, the GPS signal is not being found anymore.
How do I use the device's GPS only whenever there is no internet available?
Fused location provider uses a hybrid way to find gps using a variety of sensors, WIFI/data and the actual GPS chipset.
It will find the location COARSE/FINE accuracy is up to your case. It will just take a while longer than with the internet connection. If indoors or in an isolated area, it may very well take over a minute or two. Sometimes if the data signals just don't reach the device, yes it can fail.
It does work without WIFI or DATA in most cases.
I'm using network provider for location updates. Do I need to to have internet on my cell?
Here is my code
LocationMngr = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
LocationMngr.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, inteval, 0, this);
I'm getting confused of seeing other's Answer. Then I searched a lot and get some idea about that. While searching only, I have learnt about new concept of A-GPS. I would like to share those things with you.
There are three location providers.
1. GPS Provider
2. Network Provider (AGPS, CellID, WiFi MACID)
3. Passive Provider.
Note: I refer this from this site. As you asked question related to network provider, I will share regarding to that.
Network provider, name itself says that it needs network connection. Refer this article. It need network or WIFI connection to proceed.
A-GPS
GPS on cell phones is a bit more murky. In general, it won't cost you anything to turn on the GPS in your cell phone, but when you get a location it usually involves the cell phone company in order to get it quickly with little signal, as well as get a location when the satellites aren't visible (since the gov't requires a fix even if the satellites aren't visible for emergency 911 purposes). It uses up some cellular bandwidth. This also means that for phones without a regular GPS receiver, you cannot use the GPS at all if you don't have cell phone service.
For this reason most cell phone companies have the GPS in the phone turned off except for emergency calls and for services they sell you (such as directions).
This particular kind of GPS is called Assisted GPS (AGPS).
Note: Even if phone supports it, and network does not then this does not work
No need for Internet for retrieving location (GPS or Network provider). Using Internet can speed up the process and giving you more accurate locations (when dealing with Network provider).
No, the GPS sensors are independent of connections to the internet, so you don't need to worry about internet connectivity if you just want to get your location via GPS. I have a Nexus 10 which has a GPS sensor, and it works just fine when I'm roaming without internet connectivitiy.
no you don't need internet conection.but in some roms it may be some errors in conection.
in gps module you don't need internet but some ways you can use wifi for more performance in.such as google navigation services.
When moving a big distance, like to another city, with the GPS off, it takes very much time for it, when turned on, to get the first correct point.
So if by example I register to the gps provider, it could take up to 10 min until the first onLocationChanged call.
The network provider will respond faster, but is less accurate.
Is there a way to help the gps provider? To give it an approximate location (the one from the network provider), so it can find my location faster?
I think that google maps made some kind of optimisation, because their app finds my location faster than my basic app, that only register to the gps provider.
Any idea how I could accelerate the process of obtaining my location with decent accuracy ( <30 m) ?
You are right that if you move a long way with the phone switched off, then it can take a long time to get a satellite fix. This is where AGPS helps. The 'A' stands for 'assisted' which is very much carrier and handset dependent in its implementation. In essence it gets an approximate location from cell towers or from public WiFi like coffee shops and then downloads ephemeris and almanac data which tell the phone which satellites are likely to be overhead at that time in that rough location. The phone can then start listening on the frequencies corresponding to the visible satellites first. This should speed up the time to first fix.
Common practice is to use WiFi SSIDs or the location of the cell tower you're registered with to look up your current location via providers like WeFi or Skyhook. Google uses its own service for that (and sees that no one else does).
Another method would be, in case your smartphone has a barometer, to look up the air pressure and try to pin it down to a location. While all these methods can theoretically be used offline, it is easier to fetch the data from the internet.
Also note that inaccurate NTP settings on the phones may lead to longer GPS search times.
Is there a way to help the gps provider?
NickT has answered this, but the android phone has to call the AGPS. In your app you cannot controll that.
I think that google maps made some kind of optimisation, because their
app finds my location faster than my basic app, that only register to
the gps provider.
This should not be the case, probaly you are doing something wrong, or the google app can enable assisted GPS. Try to compare with other android GPS apps (e.g compare with Motion-X-GPS)
it could take up to 10 min until the first onLocationChanged call.
Normally this is far too long, either your phone is known to have a weak GPS quality, or the device did not have free view to open sky. Even without assisted GPS, after 45 seconds, you should have a valid GPS position (asuming free view to open sky).
But this situation can happen, either the first time you use GPS on your device, or when you fly by airplane to a location far away to your last GPS position.
On my iphone i rarly saw such a situation when another GPS app was somehow disturbing, after a reboot of the device the GPS was immedeatly valid.
Again check if it is the fault of your app, by comparing if other apps needs 10 minutes too. (It could be your fault, when you wait to recieve an accuracy <30m while other apps would take the first valid position they get.
If google needs 10 minutes, too, then you could do nothing on that phone, except to expose it to good view to sky.
(Inside an urban canyon it's more difficult to obtain a valid first fix, then on an big place.)
I'm working in android (developing application for mobile and tablets). I am using android version is 2.2.
In my application, I want to capture the longtitude,latitude.
My suprevisor is said to me capture the locations using GPS,AGPS,LBS
I'm new to android .I does not know GPS,AGPS,LBS.
Please send me the details, what are the difference,advantages,disadvantages of these 3?
Don't compare LBS with GPS and AGPS. LBS stands for Location based services . It's a service done with the help of GPS/AGPS . For example 'Requesting the nearest business or service, such as an ATM or restaurant' is a service required by a user. There are many applications available for to provide above service. Those application will use either GPS/AGPS to find the location and service to user based on the location fetched.
So simply any application which use location to serve users are considered as LBS.
Following is the difference between GPS and AGPS
The difference between GPS and A-GPS is actually pretty straightforward. A GPS phone comes with a built-in GPS chip. GPS, short for Global Positioning System, is typically used to determine the location, speed, direction and time of the device. So, for example, in the case of the Mobile, when GPS is activated on the unit, the system would be able to triangulate the position of the receiver when three or more satellites are connected. And since it is able to calculate speed and direction, GPS is also commonly used as a navigation device while driving.
A-GPS (Assisted-GPS), on the other hand, was developed to enhance the performance of GPS. This is especially useful in environments where the GPS chip may have difficulty in getting a satellite signal, such as an urban canyon, or places where there is too much overhead obstruction. What A-GPS does is it leverages on an intermediary called an Assistant Server which provides information on cell ID or other data to help the device identify the right satellites to connect to. This shortens the time needed for a location lock although certain A-GPS solutions require an active connection to a cell phone network.
Pros and Cons of GPS and AGPS:
The realiability and Accuracy is high in the GPS and it is low in AGPS.
The location captured by AGPS is not as accurate as GPS.
The location capturing via GPS is time consuming and power (Battery) consuming, etc.
Hope it helps. For more details on A-GPS
GPS - Global positioning system -> get your location via satellites
AGPS - Assisted GPS -> get your location via satellites and network providers
LBS - Location Based Services -> doesn't have much to do with getting your location.
Basically, in Android you can get your location using following providers:
Network: get your location based on your wifi connection. fairly fast, but not so accurate
GPS: get your location based on GPS receiver. fairly slow, but quite accurate
so you have a trade-off: either to use Network provider and get your results fast, or to use GPS provider and get more accurate data.
Read more here:
http://developer.android.com/guide/topics/location/strategies.html
LBS - Location Based Services
GPS - Global Positioning System
AGPS - Assisted Global Positioning System
LBS
As abbas.aniefa said, We can't say differences of LBS over GPS and AGPS. It is the service which uses GPS/AGPS to find location. Android provides a number of building blocks for location based services.
GPS
GPS, the Global Positioning System run by the United States Military.
This provider determines location using satellites.
Depending on conditions, this provider may take a while to return a location fix.
Advantages
It will give our location accurately,
It will work fine in out-door locations.
Disadvantages
It may be very very slow in in-door locations,
It will quickly drain battery.
It will be slower than network provider.
A-GPS
A-GPS - Assited GPS. Normal GPS can take a long time to get a position fix. For this reason most cell phone companies have the GPS in the phone turned off except for emergency calls and for services they sell you (such as directions).
A-GPS will come under network location provider category because it uses GPS chip on device, as well as assistance from the network (cellular network) to provide a fast initial fix.
Advantages
It will give our location very accurately in-door location itself,
Drainage of battery will be saved,
It will be faster than GPS Provider.
Disadvantage
We can not use it with GPS alone. It will depend on network connection.
Over all Differences of GPS and A-GPS
GPS
Uses GPS chip on the device,
Line of sight to the satellites,
Need about 7 to get a fix,
Takes a long time to get a fix,
Doesn’t work around tall buildings.
A-GPS
Uses GPS chip on device, as well as assistance from the network (cellular network) to provide a fast initial fix,
Very low power consumption,
Very accurate,
Works without any line of sight to the sky,
Depends on carrier and phone supporting this (even if phone supports it, and network does not then this does not work).
I think GPS is done/processed via satellite communication without any network service provider.
The AGPS is done/processed via the network (which is provided by service provider such as Airtel,Vodafone,etc).We should pay for service provider for usage of network.
The LBS is processed through the AGPS.
I dont know whether my points are correct or not.Im heard from others and put it.
All are welcome to give their suggestions,ideas,etc.