Vikas Gupta
Vikas Gupta

Reputation: 1530

Find all devices connected in a wifi network

I am trying to make an app here, which will detect all the devices connected in that WiFi network. I have done enough google and come up with an App which can detect IP Addresses of the devices connected in the WiFi network of the app.

Now I want few more things.

  1. Can I find device name i.e. phone name or model or system name any information by which we can detect the particular device?
  2. Can we find the device distance like how far is that device from the phone in which we are using our app?
  3. This one is the main task- I want to share data over device connected to same WiFi. So is that possible?

Any kind of help is appreciated

Upvotes: 16

Views: 11429

Answers (2)

1234varun
1234varun

Reputation: 239

to identify device NMAP OS fingerprint can be run.

I want to share data between two device that is connected to same WiFi network. So is that possible?

What you mean by this ? if they are on same LAN they can communicate over socket connection provided client is listening on particular port.

Upvotes: 4

Sagar Maiyad
Sagar Maiyad

Reputation: 12733

Yes, you can get device name or model number using like this...

public String getDeviceName() {
  String manufacturer = Build.MANUFACTURER;
  String model = Build.MODEL;
  if (model.startsWith(manufacturer)) {
    return capitalize(model);
  } else {
    return capitalize(manufacturer) + " " + model;
  }
}


private String capitalize(String s) {
  if (s == null || s.length() == 0) {
    return "";
  }
  char first = s.charAt(0);
  if (Character.isUpperCase(first)) {
    return s;
  } else {
    return Character.toUpperCase(first) + s.substring(1);
  }
} 

Upvotes: 0

Related Questions