Phát hiện eSIM và thẻ SIM
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Các thiết bị chạy Android có thẻ SIM và eSIM sử dụng các mã nhận dạng sau trong API điện thoại, bao gồm cả TelephonyManager
và SubscriptionManager
:
- Mã gói thuê bao: mã nhận dạng duy nhất của một gói thuê bao trên thiết bị di động.
- Mã hoặc chỉ mục vị trí logic: chỉ mục duy nhất tham chiếu đến vị trí SIM logic.
Mã vùng logic bắt đầu từ 0 và tăng lên tuỳ thuộc vào số lượng khe đang hoạt động được hỗ trợ trên thiết bị. Ví dụ: thiết bị hai SIM thường có khe 0 và khe 1. Nếu có nhiều khe thực tế nhưng chỉ hỗ trợ một khe đang hoạt động, thì thiết bị sẽ chỉ có mã vùng logic bằng 0.
- Chỉ mục vị trí thực tế hoặc mã nhận dạng: chỉ mục duy nhất đề cập đến vị trí lắp đặt SIM thực.
Mã vị trí thực bắt đầu từ 0 và tăng lên tuỳ thuộc vào số lượng khe thực tế trên thiết bị. Giá trị này khác với số lượng khe logic mà một thiết bị có, tương ứng với số lượng khe đang hoạt động mà một thiết bị có thể sử dụng. Ví dụ: một thiết bị chuyển đổi giữa chế độ 2 SIM và một SIM có thể luôn có 2 khe cắm vật lý, nhưng ở chế độ một SIM thì thiết bị sẽ chỉ có một khe logic.
- Mã thẻ: mã nhận dạng duy nhất dùng để nhận dạng một thẻ UiccCard.

Trong biểu đồ trước:
- Thiết bị có 2 khe logic.
- Trong vị trí thực 0, có một thẻ UICC thực có hồ sơ đang hoạt động.
- Trong vùng thực 2 là một eUICC có hồ sơ đang hoạt động.
- Vị trí thực tế 1 hiện không được sử dụng.

Trong biểu đồ trước:
- Thiết bị có 3 khe logic.
- Trong vị trí thực 0, có một thẻ UICC thực có hồ sơ đang hoạt động.
- Trong vùng thực 1 là một eUICC có hai cấu hình đã tải xuống, cả hai đều hoạt động bằng MEP (Nhiều cấu hình được bật).
Mở tính năng hỗ trợ trình đọc Open Mobile API (OMAPI)
Trên Android 11 trở lên, Open Mobile API (OMAPI) hỗ trợ việc kiểm tra phần cứng hỗ trợ eSE, SD và UICC trên các thiết bị có các cờ sau:
Sử dụng các giá trị này với getSystemAvailableFeatures()
hoặc hasSystemFeature()
để kiểm tra khả năng hỗ trợ thiết bị.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# Detect eSIMs and SIM cards\n\nAndroid-powered devices with SIM cards and eSIMs use the following IDs in the telephony\nAPIs, including\n[`TelephonyManager`](/reference/android/telephony/TelephonyManager) and\n[`SubscriptionManager`](/reference/android/telephony/SubscriptionManager):\n\n- Subscription ID: unique ID for a mobile subscription.\n- Logical slot index or ID: unique index referring to a logical SIM slot. Logical slot IDs start at 0 and go up depending on the number of supported active slots on a device. For example, a dual-SIM device typically has slot 0 and slot 1. If a device has multiple physical slots but only supports one active slot, it will have only the logical slot ID 0.\n- Physical slot index or ID: unique index referring to a physical SIM slot. Physical slot IDs start at 0 and go up depending on the number of physical slots on the device. This differs from the number of logical slots a device has, which corresponds to the number of active slots a device is capable of using. For example, a device which switches between dual-SIM and single-SIM mode may always have two physical slots, but in single-SIM mode it will have only one logical slot.\n- Card ID: unique ID used to identify a UiccCard.\n\nIn the preceding diagram:\n\n- The device has two logical slots.\n- In physical slot 0 there is a physical UICC card with an active profile.\n- In physical slot 2 is an eUICC with an active profile.\n- Physical slot 1 is not currently in use.\n\nIn the preceding diagram:\n\n- The device has three logical slots.\n- In physical slot 0 there is a physical UICC card with an active profile.\n- In physical slot 1 is an eUICC that has two downloaded profiles, both active using MEP (Multiple Enabled Profiles).\n\nOpen Mobile API (OMAPI) reader support\n--------------------------------------\n\nOn Android 11 and higher, Open Mobile API (OMAPI) supports checking for eSE, SD,\nand UICC support hardware on devices with the following flags:\n\n- [`FEATURE_SE_OMAPI_ESE`](/reference/android/content/pm/PackageManager#FEATURE_SE_OMAPI_ESE)\n- [`FEATURE_SE_OMAPI_SD`](/reference/android/content/pm/PackageManager#FEATURE_SE_OMAPI_SD)\n- [`FEATURE_SE_OMAPI_UICC`](/reference/android/content/pm/PackageManager#FEATURE_SE_OMAPI_UICC)\n\nUse these values with\n[`getSystemAvailableFeatures()`](/reference/android/content/pm/PackageManager#getSystemAvailableFeatures())\nor\n[`hasSystemFeature()`](/reference/android/content/pm/PackageManager#hasSystemFeature(java.lang.String))\nto check for device support."]]