How To Use Reflection In Android For Sending Sms From Second Sim Slot?
Solution 1:
You don't mention which cookie you're targeting, but in Lollipop MR1 you can send with the second SIM card by fetching the SmsManager based on subscription:
Every SIM card gets assigned a subscription ID when they are inserted. These IDs and information about the SIM are stored in the siminfo table in the TelephonyProvider. The IDs start from 1. To get information about what subscription IDs you currently have active, you use the SubscriptionManager: http://developer.android.com/reference/android/telephony/SubscriptionManager.html
The method getActiveSubscriptionInfoForSimSlotIndex
takes a SIM slot index (normally either 0 or 1) and returns subscription info about that SIM, including the subscription ID which you can use to fetch the right SmsManager.
If you're targeting platforms prior to Lollipop then the DS support is not officially supported by Google and it's most likely added by the platform vendor (Qualcomm, Mediatek etc.) so the API is undocumented. You can query the SmsManager for its methods by calling SmsManager.class.getDeclaredMethods()
, but the DS API might be in a completely different and undocumented class.
Post a Comment for "How To Use Reflection In Android For Sending Sms From Second Sim Slot?"