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.
Related
Thank you for review my question.
Now i have problem to send sms from my mobile. i could not access to send sms from both sim card but only primary sim card to use send sms.
Question: How can i use secondary sim card to send sms?
Question: How to get dual sim card information using TelephonyManager in all android version?
I got only one sim card information.
Thank you.
Multiple SIM API is supported only from Lollipop. The phones, which have more than 1 sim, and run on older Android versions have custom ROMs(firmware), edited by their manufacturers to support multi-sim. All they have different API, which is possibly not accessible for third-party apps like yours (only system apps can use it). So if you want something like that to work on all devices, you will have to get the ROMs of all devices, decompile it, and see how the manufacturers modified it. Than you will have to implement different ways to do that for every phone model.
So in other words - it's impossible.
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 carry two phones around with me all the time.
Is there a way I can virtualize my second SIM card to my Android phone?
When I virtualize, my first SIM card is still plugged into my Android phone but my second SIM card is no longer plugged into any phones, but it is virtualized on my Android phone.
When I get call or messages from my second SIM, my Android phone will receive it cause my second SIM card is virtual.
So is there any solution available out there like that?
In, short no. Even if you can clone the card, related functionality is the baseband software (AKA radio firmware, etc.) and proprietary Android drivers, so you can't modify them to use your virtual card. You might be able to find a phone that has two SIM slots, but I haven't heard of one with Android.
The virtualization might require to copy the SIM card which is very hard to do.
And right now this technique is kind of tricky, you can look into this scholar article Virtualisation of a SIM-Card using Trusted Computing
I have a android phone and want to have two sim cards active at a time. But my phone does not support dual sims.
I was wondering whether it is possible to create a program that will copy the sim card on phone memory and simulate to phone as if there is real sim card. In this way we can have virtually any number of sim cards plugged into any phone.
I have following queries before I start programming any of such thing
Is this possible ?
I googled about inner working on SIM card I found out that the communication between antenna and mobile happens using some serial number generated by SIM and this serial is matched with the signal from antenna. Anyone has good links to understand the working on SIM cards?
Where do I start with? I have little understanding of GSM protocol. Do I need to know about GSM?
SIM card cloning is technically possible, yet even if you manage to have your SIM card copied you will not be able to write a program to simulate SIM card, as SIM card is handled in hardware and your app will not have access to that hardware. Also it is not just a matter of having 2nd SIM. Dual phones require different hardware approach, different logic in the system logic and firmware etc, etc. So unfortunately "Look for real dual phone" is the much cheaper approach here.
The SIM card reading and managing is not part of android software stack. This is part of Protocol stack which is run on a separate processor.
So this will not be possible. So even if you root a device to give android the SIM values, the Communication Processor that does protocol handling will not have updated values
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.)