telephony

Sending USSD code programmatically dials Skype instead of normal phone call

浪尽此生 提交于 2019-12-06 15:34:06
When running this String ussdCode = "*" + "100" + Uri.encode("#"); startActivity(new Intent("android.intent.action.CALL", Uri.parse("tel:" + ussdCode))); I expect a normal phone call to be done, but instead of that Skype go to front and make the call for *100# USSD code. I logged out from Skype and it sill brings Skype to front!. How to force it to use the normal phone call instead of Skype? Thats because you have Skype as the default application for calls. This is a device configuration. You can change it, but note that if you does, it will actualy change that configation, so skype wont be

Android : NeighboringCellInfo

跟風遠走 提交于 2019-12-06 15:13:33
问题 NeighboringCellInfo() on Android API, I want to know this function return all neighbor cell? And one of result is current cell which our device connected? Thanks so much. 回答1: Yes, it should. But I never found a device where it did. Please report back here if you find any GSM device with any Android OS Version that does report at least one neighboring cell. Thank you! You should be able to use the following code to get them: TelephonyManager tm = (TelephonyManager) this.getSystemService

Incoming number during a call in android?

北战南征 提交于 2019-12-06 10:09:04
问题 I am running following code, its compiling but I am not getting any result or toast displayed please help... CustomBroadcastReceiver.java this class will receive the action phone state change and will instantiate the customephonestatelistener public class CustomBroadcastReceiver extends BroadcastReceiver { TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); CustomPhoneStateListener customPhoneListener = new CustomPhoneStateListener(context);

Android - Navigating through USSD menu using pre-determined inputs sent via requests

佐手、 提交于 2019-12-06 07:45:56
I am planning to create an Android App that will automate sending a users response to a USSD Menu. At a click of a button, the app will send the initial code, followed by the rest of the menu inputs. For example, the initial number is *143#, followed by 1, 1, 1, and a user PIN. I'd like to be able to automate that sequence of inputs so that the user won't have to input it on their own. I know that in Android Oreo, they implemented a USSD Callback using the TelephonyManager, where the Android App can send a USSD Request, and then read the response given. I am currently exploring that option and

Asterisk AGI: How to get or set the value of a global variable?

不羁的心 提交于 2019-12-06 06:16:01
I'm using Asterisk 1.8 with PHP for AGI scripting. EDIT: I'm struggling with setting and obtaining the values of global variables from within an AGI PHP script. I can set channel variables but not global variables. Using PHPAGI lib. Tried: Set({$varname}={$value},g) Set({$varname}=\"{$value}\",g) Set(GLOBAL({$varname})={$value}) That does not seem to work at all, when getting the value from within the dial plan, it is empty. Does anyone have a working example of setting and getting global variables in an AGI script? I found a workaround to make it work. First, the global variable must not be

ending call in android using telephonyserivce.endcall()

好久不见. 提交于 2019-12-06 02:27:16
I am working on app where i want to end outgoing call. this is the main class import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; public class phonecalls extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); call(); } private void call() { try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri

Android Receive SMS Intent: Get Message Id or Thread Id

喜夏-厌秋 提交于 2019-12-06 01:57:21
问题 I have register a Broadcast listener to receive the android.provider.Telephony.SMS_DELIVER Intent action. I seem to be able to get the body, and sender phone number of this new message. However I am not able to get the Message Id or Thread Id of this new message. The only way I have found is to search the message and conversation tables for matching content. But this seems a little messy and I feel like there should be a neater way. Side note: Is there some SMS documentation that I have

End Call in Android

心不动则不痛 提交于 2019-12-05 22:26:51
I'm trying to end a new outgoing call after few seconds. Here is my code: public class phonecalls extends Activity { ComponentName cn; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); call(); } private void call() { try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:123456789")); startActivity(callIntent); cn = new ComponentName(getApplicationContext(), Receiver.class); } catch (ActivityNotFoundException activityException) {

Fake caller ID on text messages using Twilio (or any other provider)

允我心安 提交于 2019-12-05 21:48:37
Simple question: How can I send a text message using Twilio, or any other provider, with fake caller ID? I'm using Twilio REST API (C#) . EDIT: I found this company which provides this future, but they are far too pricey: http://www.smsmessagesender.com/SmsApi Does anyone knows a better alternative? For the most part, it's a carrier thing. In the US, generally speaking, any SMS traffic has to be from a number you 'own'. For APIs, that would be one or more virtual numbers you purchase. Outside the US - again, generally speaking - there's more freedom in what you can use. However, different APIs

Mobile Number verification for dual SIM devices in Android

走远了吗. 提交于 2019-12-05 18:16:28
I have done the sim/mobile number verification (same like Whats APP) part in my app. something like: Send Message Part: SmsManager sm = SmsManager.getDefault(); sm.sendTextMessage(mobileNumber, null, "Welcome", null, null); Check the message received by the same/current device through BroadcastReceiver: private class SMSReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { if(intent.getAction() != null && intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")){ Bundle extras = intent.getExtras(); if (extras == null){ _submit.setText