telephonymanager

How to modify incoming and outgoing call screen view in android

此生再无相见时 提交于 2019-11-28 23:58:00
问题 I want modify below screen according to my option. I don't know how to access this screen. and i need to modify this screen also Please help me to do this. 回答1: You cannot modify default screen but instead of this you can launch your screen for that you need to use BroadCastReceiver for incoming calls here is the link for getting phone state in broadcast receiver http://www.tutorialforandroid.com/2009/01/get-phone-state-when-someone-is-calling_22.html 回答2: You have to write a broad cast

SMS Messages of a particular number not showing up on other devices Android

老子叫甜甜 提交于 2019-11-28 12:58:48
问题 I am using the Telephony.Sms library to load in received and sent sms messages for the app I am working on. When I set the query selection to null (the third item in the query), it will show all the sent and received sms messages on the different types of phones I have been testing on. Cursor c = cr.query(Telephony.Sms.CONTENT_URI, null, null, null, null); But when I set it to a particular number, on the Samsung S9 phone running on API 27 it is not showing any sms messages. On the Nexus

dual sim android phone which sim receive a call

南笙酒味 提交于 2019-11-28 12:51:40
I have an android application that detect the incoming calls, i need to improve this app to work on a duos mobile device. so i create a broadcast receiver registered in manifest for actions: phone state changed and on my onReceive method i need to check which sim receive the call. This is my code Protected void onReceive(Context c, Intent i) { Int whichSim = intent getIntExtra("simSlot",-1); // so this methof return 0 for sim 1 and 1 for sim2 If(whichSim==-1) WhichSim=intent.getIntExtra("com.androie.phone.extra.slot",-1); } I run this app on a device 4.2 2 and its working normally but when i

Checking if call being made is international

∥☆過路亽.° 提交于 2019-11-28 12:27:46
问题 I'd like to check if a call being made is international or not. I have the SIM number which I obtain by using TelephonyManager.getLine1Number() and also the Country code ISO of the SIM Card which I obtain using TelephonyManager.getSimCountryIso(). Is there anyway I can find the country code of the number to which the call is being made? 回答1: I don't think telephonyManager.getSimCountryIso() would help you determine 'to which country the call is being made' as it will return your country's ISO

getLine1Number() Returns blank, not null [duplicate]

倖福魔咒の 提交于 2019-11-28 12:05:29
This question already has an answer here: MSISDN : Is it a SIM Card Data? Why all The Provided Function (from Blackberry and Android) to fetch MSISDN not reliable? 3 answers I want to get Mobile Number of Device. I have used following code reference by Alex Volovoy's This Link TelephonyManager tMgr = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String mPhoneNumber = tMgr.getLine1Number(); Log.d("msg", "Phone : "+mPhoneNumber); OUTPUT in Logcat: Without Simcard Phones Returns: 02-01 17:22:45.472: D/msg(29102): Phone : null With Simcard: 02-01 17:22:45.472: D/msg(29102): Phone

Android : why PhoneCallListener still alive after activity finish?

时光毁灭记忆、已成空白 提交于 2019-11-28 08:57:25
问题 im using a phone call listener in my activity but after finishing my activity , afer user make a call, my phone call listener not dead and brig up activity again !! please help me. phoneListener = new PhoneCallListener(); telephonyManager = (TelephonyManager) TransferActivity.this.getSystemService(Context.TELEPHONY_SERVICE); telephonyManager.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE); PhoneCallListener class : private class PhoneCallListener extends PhoneStateListener {

How to get the country code for CDMA Android devices?

情到浓时终转凉″ 提交于 2019-11-28 01:22:44
Does anyone know how to retrieve the country code information for Android devices under CDMA networks? For all others, you can just use the TelephonyManager for that: String countryCode = null; TelephonyManager telMgr = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); if (telMgr.getPhoneType() != TelephonyManager.PHONE_TYPE_CDMA) countryCode = telMgr.getNetworkCountryIso(); } else { // Now what??? } I searched a bit but did not find any useful information that would lead to an answer. Some ideas some to mind: GPS location: you can get the country from GeoCoder ; and IP

Make call using a specified SIM in a Dual SIM Device

六眼飞鱼酱① 提交于 2019-11-27 13:38:25
I have been searching for this from past few days and I came to know that: "Dual SIM is not supported in Android out of the box. It is a custom modification by manufacturers, and there is no public API to control it." There is a solution provided in the below link but its not working on my phone Samsung Galaxy S4 Mini. Call from second sim I also found this link, which I found very informative. http://www.devlper.com/2010/06/using-android-telephonymanager/ Now I know that using the following code, I might have a chance to get lucky to make it working: Intent callIntent = new Intent(Intent

Android How to get Phone number from the Dual sim phone

左心房为你撑大大i 提交于 2019-11-27 13:21:37
问题 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(); 回答1: 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

Why ITelephony.aidl works?

佐手、 提交于 2019-11-27 10:37:19
I saw some SO posts which discussed about how to end a phone call programmtically, for example, this one . Yep, people focus on the result but no one actually explain the reason why it works? I tried the code, it works well. But I would like to know more details about what is going on underneath? Why by creating the ITelephony.aidl , the android hidden internal ITelephony interface is exposed in our project? How does ourself created ITelephony.aidl & the automatically generated java (/gen/ITelephony.java) link to android's ITelephony interface? Is it only because of the name matching (package