This is a code snippet to get the current IP address of a system.
import java.net.InetAddress; import java.net.UnknownHostException; public class IpAdress { //public static void main(String[] args){ public static InetAddress getIP() { InetAddress ip; try { ip = InetAddress.getLocalHost(); return ip; } catch (UnknownHostException e) { e.printStackTrace(); } return null; } }
- DHT12 Sensor Interfacing with Linkit Smart 7688 Duo using Python/Arduino - April 27, 2020
- Setting up NextCloud on Raspberry Pi - March 31, 2020
- LockDown PC based on availability of Bluetooth Device - March 30, 2020