telephonymanager

Answer phone call

可紊 提交于 2019-12-04 17:47:41
I need to accept automatically phone calls (depending on source phone number). At this time, I can end incoming calls, but can't accept'em. I've found several examples and this is what I have at this moment. Add to AndroidManifest: <permission android:name="android.permission.MODIFY_PHONE_STATE" /> <uses-permission android:name="android.permission.MODIFY_PHONE_STATE" /> <uses-permission android:name="android.permission.CALL_PHONE" /> ... <receiver android:name=".panic.IncomingCallReceiver"> <intent-filter android:priority="100"> <action android:name="android.intent.action.PHONE_STATE" />

Check if a sim card Network service is available or not

心已入冬 提交于 2019-12-04 17:21:07
Hi I am developing an application that changes a button according to the SIM STATE I am using 1 for NO SIM and 5 for SIM READY In few case I have no service for example, if the SIM card is an international card , It doesn't work in other places. What is the SIM State for this type of condition. Please suggest how to check when there is a SIM card but no service. Thanks! Bhavesh Vadalia Hi Please can you try this code... ref link : https://stackoverflow.com/a/3982768/900338 TelephonyManager telMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); int simState = telMgr

How to get phone number or sim card information use android studio?

我与影子孤独终老i 提交于 2019-12-04 17:02:35
How to get phone number or sim card information use android studio? (simcard 1 or 2) I have used this code: TelephonyManager tMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); phone_number.setText(tMgr.getLine1Number()); And I've also added permissions in AndroidManifest: <uses-permission android:name="android.permission.READ_PHONE_STATE"/> But all the gadgets that I apply fail to get phone number or always generate a null value. And this is the build.gradle I use: dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //noinspection GradleCompatible

How to know callee is answered the call (What is the phone state when he lift the call)

一世执手 提交于 2019-12-04 16:45:28
问题 I am trying to know how to alert when the callee lifts the call. I have used PhoneStateListener along with BroadcastReceiver . Generally it has three states CALL_STATE_IDLE , CALL_STATE_OFFHOOK, CALL_STATE_RINGING . CALL_STATE_OFFHOOK state was calling when call is connecting, No state of the above three states was called after callee answered call. Here is my BroadcastReceiver. public class PhoneStateBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context

get both simcard operator name in dual SIM mobile

感情迁移 提交于 2019-12-04 14:21:58
I want to know Both sim card's operator name when mobile is dual sim.In single SIM I got operator name programmatically But For duel SIM I can't although after so many search and try. If I run My app in dual sim phone than I can get both sim card operator name in my app For example : Idea,Vodafone. EDIT: Is anyone know How to get sim operator name of IMEI no then I have IMEI no. Code: public class MainActivity extends Activity { Button btnOne, btnTwo; TextView tvInfo; Context context; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Is there any API support to make conference calls programmatically in Android?

断了今生、忘了曾经 提交于 2019-12-04 11:17:27
I would like to make a conference call by selecting some contacts from my app, is it possible? also is there any limit on the number of devices in conference call? Is there any Android SDk support,any version is fine for me? Plz give some inputs.. Thanks In Advance. Kevin Junghans You cannot manage a conference with a smart phone. You need an intermediate service that can do this for you. You can program a conference manager using CCXML . Voxeo has a good hosted platform for CCXML implementations and you can look at their documentation on how to setup conferencing. There are examples in

How to provide customized vibration on specific incoming calls

六月ゝ 毕业季﹏ 提交于 2019-12-04 08:56:12
问题 The program functions like this: the user has a list of phone numbers, for which the cellphone could vibrate upon an incoming call only when no other system-wide application would provide vibration (such as in mute mode). I know that this is somehow against the rules, for that an application should respect the users' settings, but the application is limited to some certain users with this need. I have tried two ways but neither of them are satisfying: Listen to the telephony state and

Android-Telephony application that keeps focus on incoming calls

筅森魡賤 提交于 2019-12-04 07:38:10
I am developing a custom telephony application that is able to receive calls. Using this code for handling the incoming call https://code.google.com/p/auto-answer/source/browse/trunk/src/com/everysoft/autoanswer/AutoAnswerIntentService.java Unfortunately my app loses focus on the incoming call. THIS was a partial solution for outgoing calls Android- Telephone app that keeps focus on outgoing & incoming phoneCall What about incoming calls? How do I keep focus in my custom app? I am guessing this might involve downloading and modifying the source code as simply accessing the SDK gives little

setRingerMode during incoming call - RINGING

独自空忆成欢 提交于 2019-12-03 21:27:36
I have a task - change the ringer volume immediately when phone ringing. For example: After detecting, that there is incoming call I need to set ringer volume to 0 (mute) and vibrator also should be disabled (if it not disabled already). Then there is delay when I need to perform another code (startComputing();). After that ringer volume should be changed to certain value (f.e.7) and vibrator should be activated. Here is my code: public class IncomingCallReceiver extends BroadcastReceiver { private AudioManager amanager; public void onReceive(Context context, Intent intent) { if(intent

how to disconnect the call in android 4.1.2 nexus programmatically

房东的猫 提交于 2019-12-03 14:57:18
i am able to disconnect the call programmatically for incoming unknown number call in android 2.2. But in android 4.1, its not working. Working Code to disconnect the call in android 2.2: private Class c; private Method m; private com.android.internal.telephony.ITelephony telephonyService; public void onReceive(Context context, Intent intent) { Bundle b = intent.getExtras(); String state = b.getString(TelephonyManager.EXTRA_STATE); if(state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_RINGING)) { TelephonyManager tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); c =