I want to detect whether two SIM cards are there in my dual-SIM android phone programmatically. I found one API (TelephonyManager.getSIMState()
), but it is for normal single-SIM phones. Are there any APIs to detect whether or not two SIMs are inserted in my dual-SIM phone?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Android does not support multiple SIMs, at least from the SDK. Device manufacturers who have created multi-SIM devices are doing so on their own. You are welcome to contact your device manufacturer and see if they have an SDK add-on or something that allows you to access the second SIM.
Edit: (15th July, 2015)
Since API 22, you can check for multiple SIMs using
SubscriptionManager
's methodgetActiveSubscriptionInfoList()
. More details on Android Docs.From now, if the phone is MTK powered one, you can use TelephonyManagerEx class from MediaTek SDK.
Take a look at the docs.
Well, this is not fool proof. But if you have two SIMs which are on two different network operators you can try something like this:
Ideally you'll get SIM service state changed event for both the SIMs and then you can check for network operator name or something like that to check if you have two SIM cards. But you need to have two SIM cards running on two different networks.