Hello I was wondering if anyone could tell me is it possible to read the wifi rssi from another android phone. I am trying to build a simple app that reads the wifi rssi and then uses this to calculate into a distance, I have looked up the WifiManager, TelephonyManager class and the NeighbouringCellInfo, I have even tried to implement a couple of tutorials to no joy. If anyone could point me in the right direction it would be much appreciated.
IMO this will be possible only with Wi-Fi hotspot enable, since this is the only way another phone can see another via Wi-Fi.
If you want to try it out see this thread that helps enabling Wi-Fi hotspot.
Android turn On/Off WiFi HotSpot programmatically
Another thing you might consider is bluetooth RSSI.
Activating bluetooth is more straightforward and can give more precise accuracy (but covers less space).
Related
What signal (that is turned on permanently or most of the time) of our phones can another phone detect?
For example, if we turn on BLE then another phone is able to detect it using their BLE. However, people do not tend to leave their phone's BLE on all the time.
So, what else can I use?
Besides Bluetooth, your only other options are WiFi and NFC. However, similar to Bluetooth, WiFi and NFC can be turned of for long periods of time to save power (e.g. airplane mode). Moreover, not all phones support NFC or expose API to use it.
I would say your best bet is WiFi due to its more frequent use (relative to Bluetooth and NFC). It still has restrictions though and I would say Bluetooth is more suitable for your purpose. Below you can find a list of links that might be useful for your research:-
iOS API to scan WiFi networks
iOS - How to programmatically connect to a WiFi network given the SSID and password
Android WiFiManager
Android connecting to devices wirelessly
I hope this helps.
I have a question concerning WiFi scanning and AccessPoint mode on Android.
The first thing I noticed when playing around with setting up an access point is that WiFi "turns off" (clearly, WiFi must be turned on in some way, but I guess "off" refers to the fact that we cannot connect to another access point).
My question is: why can't I scan for access points on Android while in access point mode? Apparently, it has nothing to do with the WiFi standard because it works on my Ubuntu laptop - when I activate hotspot mode and create a hotspot with another device after that, I can still scan and see the new access point.
To be more specific: If WifiManager.isWifiEnabled() is true, WifiManager.startScan() returns true and will deliver scan results. However, if my phone acts as an access point, isWifiEnabled() returns false and so does startScan(). I would love to see available access points while in hotspot mode.
I don't see why it shouldn't be possible for a WiFi chipset to scan for access points while acting as an access point and I would be grateful for some clarification.
Thank you very much,
Micha.
Have you tried doing a WifiManager.startScan(), and does it return false? It's not clear that you have.
As far as your question is concerned, I don't know the answer. But I do know that not every WiFi chipset supports both scanning while also being an access point for other devices. Maybe it's easier to just disable the functionality in software rather than have to know if the chipset supports it (this is assuming that the functionality really is not there, I guess we'll find out when you try it!)
I know there are a lot of threads about GPS in Android, but I did not find an answer for this. Is it possible to track the position of another android device, and send some information between this two devices only with GPS (with no Internet connection)?
GPS is a one-way information channel from satellites to devices which want to know their own position. There is absolutely no way you can send information via GPS.
If you are looking for direct communication between android devices, your best options are Bluetooth and Wi-Fi Direct.
Sorry, it's simply impossible. No internet connection = no communication.
I have problem (challenge) with my app. I want to be connected to the "best" GSM or CDMA cell - the closest, with the best signal, etc... As I turned off the cell-phone functions and turned it on back. That is the thing I want to do in my app, because I need to have the most recent informations of location without using GPS or any data.
Can I find the way, how to force Android to refind the GSM/CDMA cell?
Lot of thanks for all!
For GSM, the cell you are connected to is decided by the network. The network tells the device which cell to use and also when to perform an handover,.i.e. change the cell. I would assume that this functionality is deeply buried in the hardware/firmware of your device with no chance to change it
so I'm trying my hand at android developing this summer. I was trying to make a sort of alarm app when a pair of connected devices go out of range of each other.
From looking around on the internet / stack overflow, it seems that looking at the RSSI value will help me achieve this.
However, it seems that the RSSI value can only be read at the time of connection with the device, that is it doesn't update itself (or there is no method to do so).
Is the RSSI value the only way to achieve my goal?
Would it be possible to use RemoteDevice and RemoteDeviceHelper? Has anyone tried this?
Any other suggestions and hints would be much appreciated
You could establish a connection with the device and exchange heartbeat information with the device , you can use the reception of valid heartbeat information to detect device being in range and or going out of range..
Your algorithm can use this information in conjunction with the connection loss to detect device being out of range and set off the alarm.
RSSI in Android available via public APIs is only during the discovery process, the other non public means of reading the RSSI (like in RemoteDeviceHelper) should also be possible , but RSSI by itself is not a good indication of distance.