Call forwarding

I explored on the net and got the answer to my question that how one can forward a call programmatically. Add these lines of code and one will be able to achieve it. String callForwardString = “**21*1234567890#”; Intent intentCallForward = new Intent(Intent.ACTION_DIAL); // ACTION_CALL Uri uri2 = Uri.fromParts(“tel”, callForwardString, “#”); intentCallForward.setData(uri2); startActivity(intentCallForward); Here 1234567890 represents … Read more

Detecting whether or not device support phone calls?

The iPhone supports the tel:// URI scheme. So you could use: [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@”tel://”]]; canOpenURL: explicitly checks whether there’s an application capable of opening that URL scheme, not that the URL is correct. So it doesn’t matter that no phone number is specified. The method returns a BOOL, so check that for YES or … Read more

Call from second sim

This seems to work on a large range of dual sim devices as Motorola, Micromax, HTC, Samsung intent.putExtra(“com.android.phone.extra.slot”, 0); //For sim 1 OR intent.putExtra(“com.android.phone.extra.slot”, 1); //For sim 2 and if doesn’t work try this, In Samsung S duos this works just fine. intent.putExtra(“simSlot”, 0); //For sim 1 OR intent.putExtra(“simSlot”, 1); //For sim 2 unfortunately for … Read more

How to trigger a phone call when clicking a link in a web page on mobile phone

Most modern devices support the tel: scheme. So use <a href=”tel:555-555-5555″>555-555-5555</a> and you should be good to go. If you want to use it for an image, the <a> tag can handle the <img/> placed in it just like other normal situations with : <a href=”tel:555-555-5555″><img src=”path/to/phone/icon.jpg” alt=”Call 555-555-5555″ /></a>

Add PhoneStateListener

You have to create a receiver to catch phone calls. To do this, add this in your in manifest.xml: <uses-permission android:name=”android.permission.READ_PHONE_STATE” /> <receiver android:name=”.ServiceReceiver”> <intent-filter> <action android:name=”android.intent.action.PHONE_STATE” /> </intent-filter> </receiver> and create these classes: import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; import android.util.Log; import android.webkit.WebView; public class MyPhoneStateListener extends PhoneStateListener { public static Boolean phoneRinging = false; public … Read more

How to make a phone call programmatically?

You forgot to call startActivity. It should look like this: Intent intent = new Intent(Intent.ACTION_CALL); intent.setData(Uri.parse(“tel:” + bundle.getString(“mobilePhone”))); context.startActivity(intent); An intent by itself is simply an object that describes something. It doesn’t do anything. Don’t forget to add the relevant permission to your manifest: <uses-permission android:name=”android.permission.CALL_PHONE” />