telephonymanager

Android- Telephone app that keeps focus on outgoing & incoming phoneCall

倾然丶 夕夏残阳落幕 提交于 2019-12-10 19:04:50
问题 Using this simple example to create a PhoneCall application that dials out a hard coded # and monitors phone state. http://www.mkyong.com/android/how-to-make-a-phone-call-in-android/ Unfortunately, on making the phone call, we always switch to the actual built -in phone application. I want to avoid this, or at the very least hide the dialer pad button. The user SHOULD NOT have the option to enter a phone#. Does anyone know of a way to achieve this? i.e. keep the actual built-in phone

Unable to get phone number from device inspite of declaring required permissions in android manifest

放肆的年华 提交于 2019-12-10 12:22:39
问题 I am trying to get phone number from my device programmatically. I am trying with the following code: TelephonyManager tMgr = (TelephonyManager) getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); mPhoneNumber = tMgr.getLine1Number(); I have declared the below permissions in manifest file: <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission

ending call in android using telephonyserivce.endcall()

眉间皱痕 提交于 2019-12-10 10:07:38
问题 I am working on app where i want to end outgoing call. this is the main class import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; public class phonecalls extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); call(); }

Android signal strength

拟墨画扇 提交于 2019-12-09 23:41:23
问题 Is there any method to get signal strength on both sim cards. I search a lot but I couldn't find any solution. Maybe is there any method to register receiver on second sim card ? I'm working on Android 5.0 and I know that on this version Android officially does not support dual sim solutions. I found only this which nearly fits to me: Check whether the phone is dual SIM Android dual SIM signal strength Second link presents some way but I cannot use it because method TelephonyManager

Android-Telephony application that keeps focus on incoming calls

眉间皱痕 提交于 2019-12-09 18:27:33
问题 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

how to disconnect the call in android 4.1.2 nexus programmatically

删除回忆录丶 提交于 2019-12-09 13:09:30
问题 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

Voice Call recording in android using MediaRecorder

大兔子大兔子 提交于 2019-12-09 03:21:40
问题 I have a problem in recording a call I have made a service and called a BroadcastReceiver to get the call state. In TelephonyManager.EXTRA_STATE_OFFHOOK when the call is received. I am using following code to record the call recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); recorder.setOutputFile(audiofile.getAbsolutePath()); try { recorder.prepare(); recorder

How to get phone number in xamarin forms?

时光总嘲笑我的痴心妄想 提交于 2019-12-08 17:34:13
问题 I am working on xamarin.forms. I need to get the phone number, if the device is dual sim then I need to get both the numbers. How do I achieve this? There so many questions related to this after referring all I came here. I created one interface in shard project and implemented the interface in an android project. android.permission.READ_PHONE_NUMBERS created interface in shared project public interface IDeviceInfo { string GetMyPhoneNumber(); } Implemented the interface in android project

Android still detects cellular signal strength while no cellular network connected

牧云@^-^@ 提交于 2019-12-08 05:32:08
问题 I wrote a little Android program to detect cellular signal strength. I inserted an expired SIM card into my phone, it displayed zero signal in status bar. However, the following code returns Signal strength equals to 22 . public class WelcomeActivity extends AppCompatActivity { TelephonyManager telephonyManager; CustomPhoneStateListener customPhoneStateListener; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity

No IMEI for Android Developers in Android 10

非 Y 不嫁゛ 提交于 2019-12-08 04:44:55
问题 As Android is serious about security and trying to make new android versions more secure, its becoming tough for developers to keep up-to date with new security features and find old methods alternatives to make their app compatible with old features. This question is about IMEI in New Android 10! The old method was super easy to get IMEI number by using below code String deviceId = ""; if (Build.VERSION.SDK_INT >= 26) { if (telMgr.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA) {