获取Java运行环境信息
设备相关信息
获取设备名称
import java.net.InetAddress;
import java.net.UnknownHostException;
try {
InetAddress localHost = InetAddress.getLocalHost();
// 设备名称
String deviceName = localHost.getHostName();
} catch (UnknownHostException e) {
e.printStackTrace();
}