In android system service ,there are TELEPHONY_SERVICE1 ="phone1" and TELEPHONY_SERVICE="phone" in android framework.
I don't have a source, but, I really believe it is used to retrieve TelephonyManager in Dual-Sim phones for the other card.
Except it being kinda obvious from the name, google also drops a lot of chinese results - coincidentally, Dual Sim phones are very popular in china.
I hope someone can back it up with a credible source or test it on a Dual Sim phone.
Related
Not directly a code related question, though I think this is the right place to ask.
Does anyone know, if so how and which requirements are needed, if it's possible to pre-load an IOS application and/or Android application on a Sim card. After which a user sticks it in their phone and loads them onto the device.
I know it used to be possible with old Nokia phones where the telecom provider loaded an app on the sim card, though not sure how this would work security wise for the current iOS and Android.
If someone could push me in the right direction, it would be well appreciated.
If it's not possible, does anyone know of an alternative solution?
There is no way to access data from the sim card using the iOS SDK apparently, so this would not be possible even if you could fit an app or url to the apps webpage on the sim card.
https://stackoverflow.com/a/15380308/1219956
as for android you can access some info from the sim card, but probably not arbitrary data written to it (which im not even sure how you would get onto the sim in the first place)
How to read Sim raw data on Android?
It's possible, as some network carriers trigger automatic installation of certain apps such as for subscription management. I noticed this when an app from my carrier appeared on my unbranded Android phone, shortly after I inserted my carrier's SIM card.
Most SIM cards support the Java Card platform for this purpose. How exactly a phone OS would interface with this to trigger app installations, I'm not sure, and might be vendor-dependent.
You can find some more information in a DEFCON talk slideset, "The Secret Life of SIM Cards". You should also look up the page on UICC Carrier Privileges in Android documentation.
Has anyone had experience with programming the selection of the SIM card, when the phone uses a dual SIM adapter?
Thanks,
STeN
Added later:
I have found the MultiSim application on the Android Market, which has in its description written that "...Analog dual-sim-adapter users can switch their sim cards...", so is there some API in the Android SDK, which allows the SIM card switch/selection?
The current Android platform does not have support for multiple SIMs. A device with such support has been customized for this, so you will need to get information from that device's manufacturer for any facilities they have to interact with it.
Since nobody mentioned it yet, Android finally has added official multisim support on Android 5.1.
But unless your app is only targeting that API (which is currently less than 0.5% of the market) you are on your own with the more obscure solutions mentioned in the other answers.
Please refer to this Dual Sim Android article. If you follow this direction, I think you can make it, even if current android api doesn't support dual sim card mobile devices.
For SMS:
Assuming that you are developing the app for your own phone, and you are willing to go through the trouble of finding out the IDs (sim_id) assigned to each of your SIM cards (probably via checking the phone's log outputs, searching for sim_id, which was what I did), you can use the following code to set the default SIM for SMS sending:
int simId = <place desired SIM ID here>;
Intent simIntent = new Intent("android.intent.action.SMS_DEFAULT_SIM");
simIntent.putExtra("simid", simId);
sendBroadcast(simIntent);
Combined with some other UI prompt stuff (for actually 'picking' the preferred SIM), this should do the trick.
I'm not at all sure if this approach would work for you (although the code appears manufacturer-independent); I figured it out with trial and error on my Mlais MX28 (with a customized ROM). But it's still worth a shot, I suppose. :)
UPDATE:
Strangely, the solution stopped working unexpectedly after a few updates to the app I was working on. But I came across another way (which seems to be more promising). (I believe this can be extended for other SIM selection scenarios as well, as the settings cache contains entries with names gprs_connection_sim_setting, voice_call_sim_setting, video_call_sim_setting and the like.)
ContentValues val = new ContentValues();
val.put("value", "here goes the preferred SIM ID");
getContentResolver().update(Uri.parse("content://settings/system"), val, "name='sms_sim_setting'", null);
(Unfortunately, this requires the android.permission.WRITE_SETTINGS permission.)
I do not have a real android device. I completely depend on emulator. So, for the sim contacts, changing sim cards and other purposes regarding sim, i want a simulator for SIM. I didn't find any thing regarding this in our default emulator. Can anyone please help me with any idea on this and any links to third party SIM simulators for android emulator. Thank you in advance..
May this help you:
Buddy in Document it is said that Emulators are supported with simulated SimCard..
"A GSM modem, including a simulated SIM Card" More Information
And There are some patches available which allows sim card support in emulator using standard USB PCSC reader...
Here are some links which may guide you through..
http://simhacks.github.io/android-emulator/
http://blog.codepainters.com/2010/11/20/android-emulator-patch-for-configurable-imei-imsi-and-sim-card-serial-number/
I had a similar problem in which I needed to obtain contacts from my SIM to test with my application. Furthermore to my understanding the only solution I resulted in was buying an android mobile and performed tests using that as I could not find such a SIM emulator.
Has anyone had experience with programming the selection of the SIM card, when the phone uses a dual SIM adapter?
Thanks,
STeN
Added later:
I have found the MultiSim application on the Android Market, which has in its description written that "...Analog dual-sim-adapter users can switch their sim cards...", so is there some API in the Android SDK, which allows the SIM card switch/selection?
The current Android platform does not have support for multiple SIMs. A device with such support has been customized for this, so you will need to get information from that device's manufacturer for any facilities they have to interact with it.
Since nobody mentioned it yet, Android finally has added official multisim support on Android 5.1.
But unless your app is only targeting that API (which is currently less than 0.5% of the market) you are on your own with the more obscure solutions mentioned in the other answers.
Please refer to this Dual Sim Android article. If you follow this direction, I think you can make it, even if current android api doesn't support dual sim card mobile devices.
For SMS:
Assuming that you are developing the app for your own phone, and you are willing to go through the trouble of finding out the IDs (sim_id) assigned to each of your SIM cards (probably via checking the phone's log outputs, searching for sim_id, which was what I did), you can use the following code to set the default SIM for SMS sending:
int simId = <place desired SIM ID here>;
Intent simIntent = new Intent("android.intent.action.SMS_DEFAULT_SIM");
simIntent.putExtra("simid", simId);
sendBroadcast(simIntent);
Combined with some other UI prompt stuff (for actually 'picking' the preferred SIM), this should do the trick.
I'm not at all sure if this approach would work for you (although the code appears manufacturer-independent); I figured it out with trial and error on my Mlais MX28 (with a customized ROM). But it's still worth a shot, I suppose. :)
UPDATE:
Strangely, the solution stopped working unexpectedly after a few updates to the app I was working on. But I came across another way (which seems to be more promising). (I believe this can be extended for other SIM selection scenarios as well, as the settings cache contains entries with names gprs_connection_sim_setting, voice_call_sim_setting, video_call_sim_setting and the like.)
ContentValues val = new ContentValues();
val.put("value", "here goes the preferred SIM ID");
getContentResolver().update(Uri.parse("content://settings/system"), val, "name='sms_sim_setting'", null);
(Unfortunately, this requires the android.permission.WRITE_SETTINGS permission.)
I'm trying to test an application on an actual Android device (the main reason is to test the Bluetooth functionality, which the emulator cannot help with :( ). To help with my endeavor, I'm thinking about buying an Unlocked HTC G1 from eBay. My question is will I be able to use the unlocked phone without any SIM card at all? Ideally, I'd like to be able to use wi-fi and other native apps, but my main focus would be to test my application, without having a SIM card.
If there are any better phones, or alternative strategies that I should employ, I'd be grateful to hear about them.
Thanks in advance!
I develop Android games and have Google's ADP 1 (G1) and Nexus One, both SIM unlocked and regularly used without SIM, not problems at all. Also the former is rooted, while the N1 is not.
I have a G2 without a SIM card that I use for testing, works perfectly, the difference is you wont see some apps in the market. You can either buy an unlocked phone or get a lock one and unlock it for under 10$ on ebay.
you won't have any problems no android phone that I know of requires service to use. I test with my G1 all the time with no sim in it.