telephony
Disable Proximity Sensor during call
After trying a whole bunch of fixes including: Phone app’s menu option (my phone did not have a option to disable) Proximity Screen Off Lite (did not work) Xposed Framework with sensor disabler (works till phone is rebooted or app updates) Macrodroid macro (Macrodroid does not run on my phone for some reason) put some … Read more
Get Signal Strength in Android
Define Variables: TelephonyManager mTelephonyManager; MyPhoneStateListener mPhoneStatelistener; int mSignalStrength = 0; Then add this class to your code: class MyPhoneStateListener extends PhoneStateListener { @Override public void onSignalStrengthsChanged(SignalStrength signalStrength) { super.onSignalStrengthsChanged(signalStrength); mSignalStrength = signalStrength.getGsmSignalStrength(); mSignalStrength = (2 * mSignalStrength) – 113; // -> dBm } } and in your onCreate method use: mPhoneStatelistener = new MyPhoneStateListener(); mTelephonyManager … Read more
How to grant MODIFY_PHONE_STATE permission for apps ran on Gingerbread
The problem you’re having was introduced in Android 2.3 (Gingerbread). Any code you have that requires MODIFY_PHONE_STATE will work all the way up to (and including) Android 2.2, but will break for Android 2.3+. A change was checked in by David Brown that limits the use of the MODIFY_PHONE_STATE permission to system apps. System apps … Read more
How to hang up outgoing call in Android?
Capturing the outgoing call in a BroadcastReceiver has been mentioned and is definitely the best way to do it if you want to end the call before dialing. Once dialing or in-call, however, that technique no longer works. The only way to hang up that I’ve encountered so far, is to do so through Java … Read more
How to programmatically answer/end a call in Android 4.1?
This works from Android 2.2 to 4.0 and now after adding the try catch to the last line it works for 4.1.2 and 4.2 Frankly speaking dont know how it works but it works for me. Log.d(tag, “InSecond Method Ans Call”); // froyo and beyond trigger on buttonUp instead of buttonDown Intent buttonUp = new … Read more
Detect if an outgoing call has been answered
I don’t think there’s such API and also there’s no API for sending DTMFs due to the same reason that you can’t tell when the call is being connected.
Make a phone call programmatically
To go back to original app you can use telprompt:// instead of tel:// – The tell prompt will prompt the user first, but when the call is finished it will go back to your app: NSString *phoneNumber = [@”telprompt://” stringByAppendingString:mymobileNO.titleLabel.text]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
What regular expression will match valid international phone numbers?
\+(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d| 2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]| 4[987654310]|3[9643210]|2[70]|7|1)\d{1,14}$ Is the correct format for matching a generic international phone number. I replaced the US land line centric international access code 011 with the standard international access code identifier of ‘+’, making it mandatory. I also changed the minimum for the national number to at least one digit. Note that if you … Read more