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 outgoing call and call hangup event in android

You should create a BroadcastReceiver: public class CallReciever extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals( TelephonyManager.EXTRA_STATE_RINGING)) { // Phone number String incomingNumber = intent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER); // Ringing state // This code will execute when the phone has an incoming call } else if (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals( TelephonyManager.EXTRA_STATE_IDLE) || intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals( TelephonyManager.EXTRA_STATE_OFFHOOK)) { // … Read more

Making a phone call in an iOS application

Yup. You need to take those out yourself. Or you can use the snippet below… NSString *cleanedString = [[phoneNumber componentsSeparatedByCharactersInSet:[[NSCharacterSet characterSetWithCharactersInString:@”0123456789-+()”] invertedSet]] componentsJoinedByString:@””]; NSURL *telURL = [NSURL URLWithString:[NSString stringWithFormat:@”tel:%@”, cleanedString]]; Note: you may be tempted to use -stringByTrimmingCharactersInSet:, but that one only removes characters at the start and the end of the string, not if … 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