I am looking for a way to transmit data when two phones are close by. This needs to be cross platform so I cannot use NFC or iBeacon. I plan on using allJoyn to send information. I would only like to send data to others that are within a few feet of me.
Is there any way that I could get an accurate reading of distance on other phones? Or can I get an accurate distance on a master device that could be placed in the room?
Shot in the dark answer:
If both devices are on the same wireless WiFi network (same subnet), then any devices on same network are "close enough".
When on the celluar network (or when only one device is on Wifi), use the Location APIs of the platform to get GPS coordinates. Send your coordinates up to a web server that keeps track of the Latitude/Longitude coordinates of each device. The web service also allows the devices to poll for nearby devices (where the distance equation can be computed on the server).
So the best way that I found to do this is to use the accelerometer to tell when two devices bump then I get the bluetooth signal strength of the nearest device, if that falls into a certain value then they are touching.
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.
I have a project where I have to track the baskets of a supermarket, I would like to know if it possible to track those baskets using Bluetooth Technology. and show them in a map in real time using an android app.
Range of bluetooth is very small. So if the distance is big bluetooth will not be an appropriate solution.
What you can do is find and program some hardware, device which have location sensor (like gps) and wifi connectivity in it, to transmit its location to the server using wifi or on lan hosted server. Then you can generate the realtime map.
Hardware for Indoor Positioning
https://www.infsoft.com/technology/hardware
I'm not sure if this is the right place to ask my question but since I am not receiving the answer anywhere someone on this Q&A site might have had similar issues as mine and found a good solution.
My Android app needs to be notified if the user of the app is very close to certain places. I can calculate this information from GPS data but for detailed calculations, the GPS data is not enough. For example, the app needs to know if the user has left one room and entered another room.
Is there any solution available for my situation? I believe some sort of device might exist in the market that can notify any nearby Android device listening of its proximity to it.
Based on the example you give, no. Location, proximity and geo-fencing are all very different things. Location is "where am I now" - proximity includes "how far am I from object X" and geo-fencing is "am I within the bounds of a specified area"
Most location data is obtained either through GPS (geo-positioning) or based on facts like "the device is using the signal of a tower with a known location." So "proximity" data is usually based on the device using services that have known locations, not actual proximity based on distances to those devices such as signal strength.
Carriers have data regarding proximity to some extent, for keeping the device connected to the network, but I don't believe they share it. Even if they did, you need to integrate with carrier back-end systems and that's not "an app." Carriers can run traces to get locations, but they don't it regularly.
You could map known tower locations and get signal strength data, but then you need to triangulate to other known signal sources. In others words, knowing how far you are from a bluetooth device does not tell you which direction, so you would need at least 2 signal strength sources (and their relative locations and signal strength map) to determine location. GPS relies on signal strength to several satellites to triangulate device location.
There are not any "radar" devices that I am aware of, nor should you expect them soon. Usually "proximity to a known location" is good enough even for geo-fencing purposes (the device is "within a city" or "near a store"). This is very coarse geo-fencing and essentially doesn't help with the "device left one room and entered another" problem.
But that isn't to say that you couldn't create some kind of signal data for a specialized app in a controlled environment. For example, you may be able to setup devices so that you know the signal strength will be "very strong" for room specific signal sources when the device moves from one room to another. Or setting up bluetooth devices that measure their own signal strength compared to the device you are monitoring and then normalizing that data in some way to determine device proximity and triangulating device location.
A complicated problem that sounds simple... maybe one day it will be.
In general there is no API for that, however, if you could for example make your own "Finger print" of the location you might get it rather reliable. For example could for example scan wifi networks available in the excat spot with their signal strenght, and make your own logic for determining when the "fingerprint" is close enough to actual spot to raise the proximity alert.
You of course should first the have the GPS proximity to alert you when you are close enough to start the fingerprinting..
I am making an app to alarm the users if their phone is being stolen. I will use an Android phone and an arduino Bluetooth device to be the point of reference ..
My problem is.. is it possible that to set a specific range to the android Bluetooth to trigger the alarm of the phone??
Because my plan is if distance between the arduino and the Android phone reaches 3 meters both the device will alarm..
Pls. I need your help..
One of the most obvious ways you can do this keep the socket connection open until it disconnects. Bluetooth range is approximately 32feet (10m) for most devices upon which the device will be disconnected. Upon disconnection the user can be notified (on the connection being lost/ bike stolen?).
Android's low energy bluetooth might be a solution if you want to conserve battery life, otherwise the normal version is fine.
If you want to get really fancy you can use geocoding(using longitude and latitude of both where your phone is and where the bike is) if the distance exceeds a certain distance( more realistically a couple of 100 meters) a notification can be sent to the phone about a possible bike theft situation.
you can use BLE GATT server and send heart bit to client when heart bit not deliver client is not in Bluetooth range . you cant find distance between two Bluetooth device
I'd just like to ask for some clarifications regarding the GPS functionalities of android phones. When an application activates the GPS of a phone, will the phone need to be on a data plan or should activate the data traffic ( Settings > Wireless & Network settings > Mobile Networks > Data Traffic) for the GPS to get the phone's coordinates?
From Wikipdeia
The Global Positioning System (GPS) is a space-based satellite
navigation system that provides location and time information in all
weather, anywhere on or near the Earth, where there is an unobstructed
line of sight to four or more GPS satellites. It is maintained by the
United States government and is freely accessible to anyone with a GPS
receiver.
If you talk specifically about GPS then it's nothing to do with the data plan or even with your service provider. GPS is totally independent of it. Think of a stand alone GPS receiver device e.g. Garmin GPS 10. It just connects to your laptop through Bluetooth (some with USB cable) and start sending GPS data to it. These devices normally output GPS data in NMEA format. Modern phones includes same sort GPS receiver circuit integrated in them. The thing different here is that these phones consumes GPS data for internally available rather than directly outputting in raw form. That's how you get GPS location information in iPhone and Android smart phones. On the other hand think of GPS navigation devices we use in our cars e.g. Garmin nuvi. It shows the location of car on the integrated maps. There is no sim card in it. Same is with GPS fitness watches.
A good question here is How GPS calculates the location? Best explanation I found is on HowStuffWorks. It's very easy and very well explained. Apart form GPS there are other positioning systems in the world, though GPS is oldest and most widely used. After GPS from US, there is GLONASS from Russia. Some phones support GLONASS too e.g. iPhone 4S and Samsung Galaxy S III. Well there is nothing to worry for developers though. These phones internally use GPS and GLONASS to have high positional accuracy and gives the location in same way.
Other positioning systems includes Compass from China and Galileo. These are under development at the moment. For complete list check this Wikipedia article.
Edit: Location can be also be determined by mobile networks and wifi networks. For example Google Latitude tells your approximate location if you are connected with wifi and even you don't have GPS device connected. In case of location determination by mobile networks, the service provider may charge for location. Normally locations determined by mobile and wifi networks are not very accurate but location can be determined indoors which is a very big problem of GPS location calculation.
Hopefully it will help how things are working.
Cheers! :)
Atleast in India I can access use the GPS whenever I can see the sky, no data plan is required for me.
I haven't tried it on Android but it should be possible to get GPS co-ordinates without a data plan. My iPhone gets GPS locations even when out of reception, I can't see why android would be any different.