「.NET for AndroidでデバイスのSIMスロット数を取得する」の版間の差分

ページの作成:「== 必要な権限 == * android.permission.READ_PHONE_STATE == 大雑把なコード == <source lang=csharp> var telephonyManager = GetSystemService(TelephonyService) as TelephonyManager; if (telephonyManager == null) throw new NotSupportedException(); // API レベルに応じて SIM スロット数を取得 int simSlotCount = 0; if (Android.OS.BuildVersionCodes.R <= Android.OS.Build.VERSION.SdkInt) {// API Level 30 (Android 11) 以上 simSlotCount = tel…」
 
1行目: 1行目:
== 必要な権限 ==
== 必要な権限 ==
* android.permission.READ_PHONE_STATE
* android.permission.READ_PHONE_STATE
TelephonyManagerを使うには権限が必要です。


== 大雑把なコード ==
== 大雑把なコード ==