나는 안드로이드에 새로운 오전과 내가있는 내가 이제 다음 코드Android - Dhcp에서 인터넷 속성을 포맷하는 방법
try{
WifiManager wm = (WifiManager) getSystemService(WIFI_SERVICE);
WifiInfo wi = wm.getConnectionInfo();
String ip = Formatter.formatIpAddress(wm.getConnectionInfo().getIpAddress());
TextView ipAddressText = (TextView)findViewById(R.id.productInfo_lanIpAddress);
ipAddressText.setText(ip);
DhcpInfo dInfo = wm.getDhcpInfo();
ip = String.valueOf(dInfo.gateway);
TextView defaultGateway = (TextView)findViewById(R.id.productInfo_defaultGateway);
defaultGateway.setText(ip);
}//*/
catch (Exception ex) {
TextView ipAddressText = (TextView)findViewById(R.id.productInfo_lanIpAddress);
ipAddressText.setText(ex.toString());
}
/*
를 사용하여 IP 주소를 가지고 나는 내가 생각 LAN IP 주소, 서브넷 마스크, 기본 게이트웨이 및 기타 정보를 표시하고 응용 프로그램을 만드는 오전 기본 게이트웨이를 받고 있지만 그것이 제대로 표시되지 않도록 번호가 형식화되어 있습니다 (내가 16885352를 얻고 있습니다) Formatter와 같은 방식으로 IP 주소를 형식화 했습니까? 다른 인터넷 정보에서도 동일한 효과를 얻는 방법에 대한 링크 또는 가이드를 얻고 싶습니다. 감사합니다.