Reputation: 1391
I need to measure Wi-Fi Direct signal(RSSI signal) between two Android mobile phones. How i can do that?
Upvotes: 13
Views: 4608
Reputation: 635
Create a Broadcast Receiver class inside your activity class that performs some action (display some message/ store in a variable) when RSSI's strength changes. This can be done as follows :
public class myReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
String myAction = intent.getAction();
if (myAction.equals(WifiManager.RSSI_CHANGED_ACTION))
{
manageNewRssi(intent.getIntExtra(WifiManager.EXTRA_NEW_RSSI,0));
}
}
}
manageNewRssi is a method that you have to define which does the required task.
Upvotes: 0