Getting Location In Android Without Location Service - android

Is it possible to get location in android without enabling location service of android device ? I need to get location from nearest mobile tower, so is it possible ?

You could use getLastKnownLocation() of FusedLocationAPI. This doesnot involve enabling location services.
As per docs:
Using the Google Play services location APIs, your app can request the
last known location of the user's device. In most cases, you are
interested in the user's current location, which is usually equivalent
to the last known location of the device
.

Related

location with OFF internet connection

I am trying to get current exact user's location coordinates, and update the location when the user moving without internet connection in android.
which says "Common sources of location information include Global Positioning System (GPS) using GPS-PROVIDER
and location inferred from network signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs using 'NETWORK-PROVIDER'.
It is well known that the GPS doesn't need internet connection to get the location.
So the question is what about the network provider??
Can I use network provider when internet connection is OFF ? if not ? why !!
I think it can work without internet because it Depends on GSM/CDMA cells so it will get the location by the Signals connect with cell tower, I hope I'm thinking right.
By the way I have not used the google location Apis (client & server) because I read more than once that it needs an Internet connection,
that's why I'm using now Android APIs locationManager().
As far as I know, google's location API's makes the most out of the network connection when it comes to location.
Either way, from Android developers: "The Google Play services location APIs are preferred over the Android framework location APIs (android.location) as a way of adding location awareness to your app. If you are currently using the Android framework location APIs, you are strongly encouraged to switch to the Google Play services location APIs as soon as possible."
Follow this link for more info:
https://developer.android.com/training/location/index.html

can i use gps to track my location when i an offline

I want to make an app for android phones which will gives some notification when it reaches certain point . Is it possible to do it using GPS ? And is it possible to make user download maps and then use that map to track location using GPS system , i mean can i track device location without internet using GPS and gives notification when phone is offline .if it is possible then please give me some guidance how can I do it
you can get location with no cell tower by satellite. it is free and called fine location. cell towers are less accurate form of location. The map used to display the location must have a connection to the internet however and you get maps via google This is free to develop apps but when you sell the app google takes a cut.
yeah we can get our current location in offline by using FUSED LOCATION
refer here

Cellular network location service draining too much battery?(android)

we are developing an application in android which uses cellular(GSM) network location service (NOT GPS).Drains battery very fast when we use this location service in our application...
I dont know what causes this draining .. any pitfalls, suggestions?
thanks for help
Instead of requiring the location every time you have to request the Last Known Location.
Get the Last Known Location
check:
Fused Location Provider
use the fused location provider to retrieve the device's last known
location. The fused location provider is one of the location APIs in
Google Play services. It manages the underlying location technology
and provides a simple API so that you can specify requirements at a
high level, like high accuracy or low power. It also optimizes the
device's use of battery power.
Read more:
Adjusting the model to save battery and data exchange

Getting location null with fused location provider getLastLocation

I am using googleApiClient with LocationServices api to get the location.
I am able to get last location if In phone settings wifi & mobile network location is checked.
But If I unchecked the wifi & mobile network location. It does not provide any location. while GPS Settings in checked in both cases.
My question :- Google's new api can get location from gps or not. ?
Google's new api can get location from gps or not. ?
may be yes.
But as per Google
The Google API Client provides a common entry point to all the Google Play services and manages the network connection between the user's device and each Google service.
We must have to provide the network access either wifi or mobile-data for getting the actual location's co-ordinate.

How I can get the location of the device if the GPS is off?

I would like to get the latitude and longitude of a device, if the GPS is off, well hopefully can be a precise location
You should use the new LocationClient that is part of Google Play Services Location API. It uses a fused provider that automatically determines what is the best provider available at that moment. It also uses other sensors to get a more accurate location.
you can get your location from three techniques and each one called Provider and each one has some pros and drawback and uses you don't care about it Google play services will making it for you but you need to have good understand of that , the three ways is
from GPS , Network , SIM(mobile device with sim)
and here some implementations of the techniques
http://developer.android.com/guide/topics/location/strategies.html

Categories

Resources