電話の IMEI 番号を取得しようとしています。以下のコードを使用しています。
public static string GetDeviceId(Context context)
{
TelephonyManager telephonyMgr = context.GetSystemService(Context.TelephonyService) as TelephonyManager;
string deviceId = telephonyMgr.DeviceId == null ? "UNAVAILABLE" : telephonyMgr.DeviceId;
return deviceId;
}
コードに問題はありますか?他に何をすべきですか?