-- getDeviceID()
TelephonyManager public String getDeviceId ()
Return null if device ID is not available.
Requires Permission: READ_PHONE_STATE
-- MAC address
permission.
"android.permission.INTERNET"
>
"android.permission.ACCESS_NETWORK_STATE"
>
ConnectivityManager manager =
(ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo ni = manager.getActiveNetworkInfo();
String netname = ni.getTypeName();
if
(netname.equals(
"MOBILE"
)) {
Log.d(TAG,
"Network - > "
+ netname);
}
else
{
Log.d(TAG,
"Network - > "
+ netname);
}
WifiInfo wifiInfo = mWifiMgr.getConnectionInfo();
Log.d(TAG,"MAC:"+wifiInfo.getMacAddress());
댓글 없음:
댓글 쓰기