It is possible to list all connected nodes in my android application(machines connected to a LAN using wifi)?.
How to list all connected nodes in android application (using WIFI)?
545 Views Asked by Ram At
2
There are 2 best solutions below
2
Vickyexpert
On
Try This One...
This will help you
to get all kind of net connections...
public boolean checkNet()
{
ConnectivityManager cm = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netWifi = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
if (netWifi != null && netWifi.isConnected()) {
return true;
}
NetworkInfo netMob = cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
if (netMob != null && netMob.isConnected()) {
return true;
}
NetworkInfo netActive = cm.getActiveNetworkInfo();
if (netActive != null && netActive.isConnected()) {
return true;
}
return false;
}
Related Questions in ANDROID
- Delay in loading Html Page(WebView) from assets folder in real android device
- MPAndroidChart method setWordWrapEnabled() not found
- Designing a 'new post' android activity
- Android :EditText inside ListView always update first item in the listview
- Android: Transferring Data via ContentIntent
- Wrong xml being inflated android
- AsyncTask Class
- Unable to receive extras in Android Intent
- Website zoomed out on Android default browser
- Square FloatingActionButton with Android Design Library
- Google Maps API Re-size
- Push toolbar content below statusbar
- Android FragmentPagerAdapter Circular listview
- Layout not shifting up when keyboard is open
- auDIO_OUTPUT_FLAG_FAST denied by client can't connect to localhost
Related Questions in NETWORKING
- kernel module does not print packet info
- Packet drops in multicast when multiple instance of listner are running
- Timing packets on a traffic server
- How to use Espresso Idling Resource for network calls
- Dummynet does not match on flows
- Sending a notification from OS X to iOS
- Swift ios viewDidLoad or viewDidAppear
- Update player list on all clients on new connection
- Issues regarding multiplayer networking: input
- nmap does not show all open ports
- Getting and Sending Data between a Server and Client
- Read file from local PC from network deployed app to InputStream
- Does iOS block a URL if we couldn't connect to the URL for 'n' times?
- Is Socket.Available guaranteed to throw a SocketException on disconnect?
- android out of cell service
Related Questions in ANDROID-WIFI
- issues with one to many mobile device file transfer in android using wifi direct
- Sending and recieving data over wifi connection in android programatically
- HTTPS connection on wi-fi enabled Android Wear without phone tethering
- Connect multiple devices in GoPro network
- WiFi direct Ip address
- Get security type from configured network?
- Uniquely identify a particular wifi source using Android devices
- wifi scan is not performed when calling wifi.startScan() outside the MainActivity
- Where are methods responsible for showing WiFi networks' options?
- QR Code Wi-Fi Static IP
- NetworkInfo state for WIFI returns disconnected when no internet connection available android 5.0
- Sending traffic in android app via particular connection
- Android app to receive data sent by ESP-01 8266
- Android Wifi Receiver broadcast late response
- send text from one android device to another through wifi
Related Questions in WIRELESS
- Capture RRC Messages using Libpcap on android
- RRC state of an android
- Cyclostationary Feature Detector: Performance doesn't vary with Change in SNR
- how to implement particular message format in NS-2
- Changing network interface at runtime
- Iphone wireless distribution installation loop
- How to gain control over LMP messages in BT stack?
- microcontroller wireless communication for GPS tracking
- where does iwconfig get data on bitrate in linux
- Multiple wireless block in wpa_supplicant.conf
- Using TelnetLib with a Cisco Wireless Controller
- Simulate video dissemination with different bitrate on the network
- NativeWifi and Windows XP SP2/SP3
- iPhone/iPad Get State of Wireless keyboard
- code for print from i-pad and which all print does it support
Related Questions in ANDROID-WIRELESS
- issues with one to many mobile device file transfer in android using wifi direct
- Is it possible to switch APN programatically in android?
- "no route to host" on device on getOutputStream() - connected wirelessly
- How to list all connected nodes in android application (using WIFI)?
- Access one android device to another android device
- App crashes when wifi is out of range
- Android Wireless Adaptor Support in Emulator
- Are there means to read wireless related low level data in android?
- How to use scrcpy to run mutiple emulated phyicall devices wirelessly?
- How to get wifi hotspot state
- How to connect to a wireless network in android?
- send data from phone to PC via WIFI
- Is it possible to scan for all the WiFi enabled android devices, not just hotspots?
- Google Pixel 7 losing debugging connection in wireless debugging, also "Allow USB debugging" keeps on popping up cable connection
- Location request times out when alarm wakes device; do I need to reconnect wireless networks manually?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can achieve it by following code,
this code is useful in java so not sure but it will work for android also.
public void getAllNodes(String subnet)
{
int pingTime=1000;
String nodeName = "";
for (int i=1;i<254;i++)
{
String host=subnet + "." + i;
if (InetAddress.getByName(host).isReachable(pingTime))
{
nodeName += host;
}
}
}
Just call this method like getAllNodes("192.168.0");