Reputation: 1530
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.
Any kind of help is appreciated
Upvotes: 16
Views: 11429
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
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