Stream audio to a phone call Android

Writing to the phone call stream IS possible, but not from the app level on a stock (non rooted) phone. When a phone call is initiated the mic is “typically” (really depends on the specific phone) routed directly to the baseband, ie skipping the main processor altogether. For outgoing audio: mic->codec->baseband For incoming audio: baseband->codec->speaker … 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

URL Scheme for Phone Call

The official standard for providing a telephone number as a URI is here: http://www.ietf.org/rfc/rfc3966.txt It basically says use tel: as the prefix, and start the number with +[international dialling code] before the number itself. You can put non-numeric characters as separators (e.g. -) but they must be ignored. So a London (UK) number might be: … Read more

How to import com.android.internal.telephony.ITelephony to the Android application

The ITelephony interface is internal, so you cannot get a standard reference to it. You could use reflection all the way, i.e. TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); Method m1 = tm.getClass().getDeclaredMethod(“getITelephony”); m1.setAccessible(true); Object iTelephony = m1.invoke(tm); Method m2 = iTelephony.getClass().getDeclaredMethod(“silenceRinger”); Method m3 = iTelephony.getClass().getDeclaredMethod(“endCall”); m2.invoke(iTelephony); m3.invoke(iTelephony); But either way those methods need the MODIFY_PHONE_STATE permission, … Read more

How to block a mobile number call and message receiving in android application development?

create PhoneCallReceiver .java import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; import android.util.Log; import android.widget.Toast; public class PhoneCallReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { TelephonyManager telephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); PhoneCallStateListener customPhoneListener = new PhoneCallStateListener(context); telephony.listen(customPhoneListener, PhoneStateListener.LISTEN_CALL_STATE); }} now create PhoneCallStateListener .java import java.lang.reflect.Method; import android.content.Context; import android.content.Intent; import … 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