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)?
548 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
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in NETWORKING
- How to avoid duplicates with the pull-based subscribe model?
- How to simulate CSMA/CD protocol in ns3?
- Network System - Cisco Packet Tracer
- Adhoc / mesh network not working (with and without batman-adv)
- Algorithm for finding a subset of nodes in a weighted connected graph such that the distance between any pair nodes are under a postive number?
- Python Client-Server Communication with Protocol
- I registered a service in eureka which is resolving through java code. But it is not able to resolve its name when hitting through chrome or postman
- Share files from the server without data or internet usage
- Player names not synchronizing in unity Mirror Networking
- My phone can not visit the server on macos in the same local network
- Unable to ping remote websites from an ipV6 only ubuntu ec2 Instance
- Linux Networking - Routing packets from one network interface to another
- wrong output from Supernetting algorithm
- Mapping localhost port on host to docker container
- Microsoft Message Analyzer disable resolving IP address to their domain names a.k.a turn off AutoIP feature
Related Questions in ANDROID-WIFI
- Android Passpoint
- How Android phones get connected WIFI passwords through ADB
- Android Studio - Android 12 wifi icon hided by mobile data when no internet via wifi
- Android 13 version Wifi Network disconnect not working
- Connecting wifi through url
- How to enable/disable auto connect flag in android wifi saved network
- WifiManager.ACTION_PICK_WIFI_NETWORK not working on Android 13
- Android: connection to Wi-Fi seems not to have access to internet
- RTT ranging between WiFi Aware peers not working
- Android: When scanning for Wi-Fi networks using 'wifiManager.scanResults', I am not always able to get a complete list of devices sometimes
- An alternative for WifiManager's startScan() deprecated method on Android 11 and above?
- Is there a way I can restrict my phone to connect to network I set only?
- Android: When scanning for Wi-Fi networks using 'wifiManager.scanResults', I am not always able to obtain a complete list of devices
- How to connect to Wifi network programatically on Android 10 and above?
- Android 13- Unable to connect with WiFi netork after few attempts
Related Questions in WIRELESS
- Sending Struct Package over LoRa - When Sensor Value Changes, Transmit Stops
- Error using surf, Z must be a matrix, not a scalar or vector to surf(deltaT,deltaR,abs(Err))
- Why are my wirelessly sent data getting corrupted?
- Can not connect my iPhone via USB to XCode if it was previously connected wirelessly
- How do I connect my Android smartphone using virtual USB to my computer
- Decoding a time series for reconstruction
- Unstable adb wireless debugging
- Simulation of Wired Network in OMNET++ using INET framework - UDP
- Transmitting sine wave wave through ESP-NOW
- How to implement the sphere decoding algorithm for MIMO systems?
- how to get the constraint area values from .ini file
- How can I rotate an antenna pattern in MATLAB?
- Best approach for implementing wireless video transmission using ESP32 microcontrollers and HDMI
- Xsens Device API function 'startRecording' fails
- Wireless controllers don't pick up input using the old input system
Related Questions in ANDROID-WIRELESS
- arduino ide - ESP32 devkit v1 OTA via internet (HTTPS) looping back and load .bin file every 5 second from website
- Uncaught exception thrown by finalizer for Bluetooth Reconnection in Android - java.io.IOException: socket not created
- How to use scrcpy to run mutiple emulated phyicall devices wirelessly?
- Carrier Identification Android - New carrier
- Wireless Debugging not working in Android Studio on MAC
- ioctl() invocation with 'SIOCGIWNAME' returns EOPNOTSUPP for wireless interface
- Android: connection to Wi-Fi seems not to have access to internet
- HC-05 Bluetooth module help, can not recieive data
- Google Pixel 7 losing debugging connection in wireless debugging, also "Allow USB debugging" keeps on popping up cable connection
- detect wireless debugging option active or not in developer mode in android programmatically
- Wireless Android Debugging Not Showing Available Devices or Connecting
- Is there any way to rename physical devices paired using wi-fi in Android Studio
- Jetpack Compose and Wireless Direct
- Appium ADB Error: Error getting device platform version , when device is connected via tcpip on port 5555
- How to fix the error "E: Unable to locate package wireless-tools" in termux
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 # Hahtags
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");