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

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)