Does call logs register the sim serial number from which the calls where made from?
-
25-05-2021 - |
Question
I am creating an application on call logs and I stumbled onto this idea. Now calls made from phone dialler and those made from voip software installed on the device also comes up as call logs and am guessing because the Voip software calls the phone dialler when ever the call button is push on the Voip. Now I am thinking of a solution to eliminate the voip calls and I came up with this idea but I dont know if it is feasible.
Now is it possible to get the Sim card serial number from which a specific call was made from or with?
Here is the code line I am using.
Telly=(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
simSerialNumber=Telly.getSimSerialNumber();
Cursor Logs_query=managedQuery(CallLog.Calls.CONTENT_URI, null, null, null, null);
int number=Logs_query.getColumnIndex(CallLog.Calls.NUMBER);
I would appreciate some help in suggestions and codes.
Solution
Now is it possible to get the Sim card serial number from which a specific call was made from or with?
No, you cannot differentiate the logs are from which dialler.
The call log content provider does not save the information of the dialler that insert the log.
OTHER TIPS
Do you have any results now or exceptions if you run that code?
And have you set the permission READ_PHONE_STATE
? This is needed to use the getSimSerialNumber()
method.
You have to use Telephony Manager;If at all you not found the contact no. of user; You can get Sim Serial Number of Sim Card and Imei No. of Android Device by using the same Telephony Manager Class...
Add permission:
Import:
import android.telephony.TelephonyManager;
Use the below code:
TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
// get IMEI
imei = tm.getDeviceId();
// get SimSerialNumber
simSerialNumber = tm.getSimSerialNumber();