public class NetUtils extends Object
| Constructor and Description |
|---|
NetUtils() |
| Modifier and Type | Method and Description |
|---|---|
String |
getLocalIp()
Gets the local IP address of the current machine.
|
String |
getWanIp()
Gets the WAN IP address of the current network using an AWS service.
|
String |
HttpRequest(String host,
HttpTypes type)
Sends an HTTP request of type
HttpTypes. |
boolean |
pingAddr(String addr)
"Pings" an address to check if it's alive
|
boolean |
pingHost(String host)
"Pings"
host to check if it's alive |
String |
urlShortenGoogle(String url)
Uses Google's URL shortening API to shorten a given url (goo.gl format)
|
public boolean pingHost(String host)
host to check if it's alivehost - The hostname to pingpublic boolean pingAddr(String addr)
addr - The ip address to pingpublic String HttpRequest(String host, HttpTypes type)
HttpTypes.host - The host to requesttype - The type of HTTP request to make (GET, POST, etc.)SimpleHttpRequest,
SimpleHttpRequest.fire()public String getWanIp()
public String getLocalIp()
Copyright © 2017. All rights reserved.