I am creating a geolocation app with Intel XDK (iPhone and Android) and have 2 questions:
How can I display the geolocation settings of the device if the GPS is not active on the phone?
How do I know if the latitude and longitude values returned are from the GPS or from the wifi/data coords? I figured that wifi/data returns a short value (eg: 43.475748) and GPS returns a longer value (eg: 43.47573849384) Am I correct in thinking this?
1.) Most devices will cache the last known geo location. Unfortunately, this behavior is not consistent, and there's not much you can do to change that other than attempt to remember a set of last known locations within your app.
2.) I don't think the HTML5 geo API provides that level of detail, but you could look at the accuracy information that is provided. The designation of "fine" versus "coarse" is somewhat arbritraty, since it means different things on different devices and operating systems (the nature of cross-platform applications). I would use the accuracy feedback as a relative guide.
If you want to play with the geo location feature, checkout the "hello-cordova" sample app in the XDK, it is very easy to use to see how the geo feature works on a variety of devices. You can use it in App Preview or simply build the app and install it on a variety of devices. Note that if you first push the "fine" button then the "watch" button will retrieve "fine" results. If you push the "coarse" button before pushing the "watch" button the watch results will be based on a "coarse" setting.
In general, it is best to first request a "coarse" reading (with a short timeout) to get a general location (or a cached location) and then switch to a "fine" request if you need a more precise location. Battery life will be better if you stick to infrequent "coarse" readings, especially if you only need to know the general location of your user (for example, in which town or neighborhood are they located).
Related
In my application, we want to warn the user when he is at distance from Phone or watch.
We are scanning nearest nodes using APIs of wear OS.
Is there any way I can detect the distance between two such nodes?
Getting geolocation of both & calculate distance using formula is one possible way.
But aren't the APIs on wear OS has something which can detect distance using Bluetooth range or signal strength?
The best that's directly supported by the platform is the Node API's isNearby method, but that essentially just returns true iff the phone-watch connection is over Bluetooth rather than cellular or wifi. It doesn't give you anything resembling a real distance number.
Beyond that, you'd have to roll your own solution using GPS on both devices, as you mention. But that has a lot of downsides: complexity, reliability, and battery use are ones that immediately occur to me. Someday, you'll be able to get this kind of accuracy from the fused location provider using wifi, but probably not for some years.
We have an application which need to locate the device(the user) within 200 meters.
Use case:
Out client team have almost 20+ people, they will work separated but within a certain geographic extent(less than 200m). And all of them will take an android device (without network support)The manager of the team need to know the location and distance relative to himself.
I have though that using the GPS to get the location, but I still have two more problem:
1 The work place maybe inside a build, so I am afraid it is hard to get the GPS signal.
2 Get the location.
Event I get the location through the gps, how can I transform the message from the other device to that of the manager? Since there is no network available.
I hope someone can give me some suggestions.
You can investigate the NFC tags with a system to detect the tags and identify the different android devices with NFC feature
How can I locate other BlueTooth devices that are using my app and show them on map, with range, exact location, like radar map.
The only way you could possibly do this is if your Bluetooth slave devices individually have the ability to track and report their location (e.g. GPS).
Otherwise it's not possible at all. The Bluetooth radio and antenna in your Android device will have no direction finding ability.
Possible design idea :
You want to implement this with the help of a webservice.
Make your app report its being used(may be you want to report at regular intervals and shutdown of app) along with location information (probably you want to use GPS, have a look at this : Obtaining User Location).
Make you radar app to read those information and prepare the map.
Cons :
Availability of GPS will affect your application
Accuracy is limited.
I was wondering was there a way to track if the android device is inside of a building and retreieve what building by using the location manager? without having GPS being turned on.
Even if you had a Lat/Lon location, you would then use GeoCoding to get the address from the location, addresses may be shown as 2 or 3 buildings in a single location, my home address is shown as a range of house numbers including my neighbours. Without accurate GPS, you wont have enough accuracy.
Android device can get device location over the WIFI or from GSM antennas too, but this is not very accurate. Location technology that is "coarse" only knows where you are within several hundred meters. I think you can not get right results.
If you want to try it, you need to add ACCESS_COARSE_LOCATION permission to the AndroidManifest.xml file.
I try to receive latitude & longitude on android phone.
Is location on android receive directly from satellite?
Why it dynamic all the time, while I standing though?
So, anyone know how to make it stable ?
Thanks
The location may come from a variety of places:
The "last-known" location, an OS-level cached location (fast, but may be inaccurate)
The wifi network (Google can often deduce location from the wifi net you're on, but not always)
Mobile network - if the device is on a mobile phone network, that can provide location information
GPS receiver. If the device is outdoors this will provide the most accurate location
Your app will have specific needs, and so you need to decide which locations you want, and what you do when you get them, based on their accuracy, and the source.
With GPS, buildings, tees, the weather, etc will all have an effect on the location, so you'll never get one amazingly accurate location. Many apps just request a location and use it, but if you need accurate, stable location data, you need to collect data from relevant sources, and then use your own algorithm to decide which to use.
You need to read, understand, and use what's in this page:
http://developer.android.com/guide/topics/location/obtaining-user-location.html