Hello friends in my app i want to show user to their sim phone number but with in dual sim mobile is not give any type number i much googling but not get exact.please help meto get phone number from dual sim.
Note following is not working on dual sim to get number:
String phonenumber = telephonymanager.getLine1Number();
telephonymanager.getLine1Number() does not guarantee to return the Sim number, as the phone number is not physically stored on all Sim cards.
A better alternative is to ask the user for the phone number once, and confirm the same by sending a message to that number.
Here is a better explanation for the same.
Related
I want to send sms using Dual Sim Mobile, make sim selection option, while sending sms.
I have vefiried this link fully:
Android : Check whether the phone is dual SIM
this question is based on this question only. thats why could not type the same program now.
Note: I have detected dual sim with its state also successfully using the above mentioned link program.
My Question: i have two sim,first sim airtel( having data connection), second sim is newly(Jio 4g) bought sim( waiting for Customer Care Activation)
when i detect sim state, both showing true only.then, i want to send sms using both sims.
Here Problem is : Sim State is showing both true. But, My Second sim tower is not showing.because of waiting for activation.
How to detect the two Sims having tower/Network having or not? This is my Problem
I have just tried with getNetworkType() method. But, Exactly, I dont know, How to check using this code in this dual sim options..
Please anyone help me to solve this issue
Thanks Advance
The dual SIM phones have two IMEI numbers. When I use the getDeviceId(), it can gets the one of the IMEI numbers. While we can get the all IMEI numbers using the *#06# code. are there a way to get the all the IMEI numbers in the a dual SIM phones in android?
After a long time i researched for retrieving the signal strength of dual Sim. I want to know the phone is dual Sim or not. If it is dual Sim phone i need to know each and every Sim signal strength.
Please give me a proper solution
There is no API in android to detect dual sim functionality. You can use Java reflection to detect dual sim. Please follow below link for more details
Android : Check whether the phone is dual SIM
I have a dual sim Android phone. Using this solution I retrieve IMEI numbers of both sims.
Given the IMEI number, how can I find out the phone number of each sim?
There are methods getDeviceIdGemini(int slotId) and getSimStateGemini(int slotId) it is possible to find out the IMEI number and the state of each sims.
I'm looking for a similar method for reading the phone number of the sim.
You can't. Phone number it's not stored on sim card, it's stored on operator's servers. Look for TelephonyManager.getSubscriberId(), this will give the unique id for each SIM.
Programmatically obtain the phone number of the Android phone
Basic answer- there is no way to get your current phone number. There's things that sometimes work, but not always and not on all carriers.
No,
Android doesn't support dual sim devices.
See: Detect the status of two SIM cards in a dual-SIM Android phone
as Android does not support multiple SIMs, at least from the SDK.
You can contact your device manufacturer and see if they have an SDK add-on or something that allows you to access the second SIM.May be an API which can help youto get your desired result.
Although you can find out the status of the device whether it is Dual sim or not by using this link Android : Check whether the phone is dual SIM
Using reflection, I looked at the methods of TelephonyManager and found this method: int getLine1NumberGemini(int).
I tried to invoke it (getLine1NumberGemini(0) for first sim and getLine1NumberGemini(1) for the second). In both cases I received an empty string.
But the reason for this seems to be the inability of the phone to get the phone number of my sims:
TelephonyManager.getLine1Number() returns empty string as well.
When I open "Sim management" in the settings of the phone, no phone numbers are displayed.
I am building an android app that will be licensed on the user's SIM card. There are 2 possible values that I can check against:
SIM SERIAL NUMBER: TelephonyManager.getSimSerialNumber();
IMSI: TelephonyManager.getSubscriberId();
As I do not want to use both, I guess that there is no actually difference to rely to the one or to the other. Am I right or is there something that I am missing here?
Thanks!
It depends on what you want.
If the license works by checking that the serial number matches your database as an example.
If the user installs your app and the sim card serial is stored in your DB, if the user removes the sim card and inserts a new sim card, the license will fail as your DB doesn't store the serial for the new sim card.
If you get based on the IMSI number then the license will be with the device, so even if user replaces the SIM the license will still pass as your using the device ID.
Note though I don't know whether the SIM serial will work or how it will handle devices that do not have SIM such as CDMA devices in the US.
ICCID (SIM Serial) is the serial number of the SIM. It is unique per SIM.
IMSI is a SubsID. It is actually a network ID.
More reference: https://m.blog.naver.com/framkang/220363349346