broadcastreceiver

Why do I get “Generic Failure” error while sending SMS?

不羁的心 提交于 2020-01-01 06:57:11
问题 I am working on android project where I need to send SMS . My app collects required information by consuming a web service and this information is very short and pure text. This information is then sent in the form of SMS. I have used broadcast receiver that will keep track of whether SMS is sent successfully or not and simply add a log entry. I have used SmsManager to send SMS . My device is having very good WiFi strength and good GPRS network. While sending SMS, I have found that broadcast

Why do I get “Generic Failure” error while sending SMS?

最后都变了- 提交于 2020-01-01 06:57:09
问题 I am working on android project where I need to send SMS . My app collects required information by consuming a web service and this information is very short and pure text. This information is then sent in the form of SMS. I have used broadcast receiver that will keep track of whether SMS is sent successfully or not and simply add a log entry. I have used SmsManager to send SMS . My device is having very good WiFi strength and good GPRS network. While sending SMS, I have found that broadcast

How to disconnect incoming call in android by programatically

走远了吗. 提交于 2020-01-01 06:26:22
问题 I want to disconnect incoming call for a particular time. How can i do this is it impossible ? I searched and i find it is impossible. please help me. public class Telephony3 extends Service { Context context; public IBinder onBind(Intent intent) { return null; } public void onCreate() { super.onCreate(); try { StateListener phoneStateListener = new StateListener(); TelephonyManager telephonymanager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); telephonymanager.listen

Android usb enumeration

混江龙づ霸主 提交于 2020-01-01 05:37:06
问题 I am writing an android USB host application for which I am trying to enumerate the devices connected with tablet. I follow the code in the android USB host documentation in the developer site. My code is as follows AndroidUSBActivity public class AndroidUSBActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); USBClass usb = new USBClass();

Android: Querying Call Log After it has Been Updated Once a Call Ends

北慕城南 提交于 2020-01-01 04:59:09
问题 When a call ends, how can I be sure that I am querying the Call Log after the call information has been written to the database? I am looking for the end of a call by using a BroadcastReceiver with an intent-filter on android.intent.action.PHONE_STATE , looking for the phone to go idle . Any help on this would be appreciated. Thanks 回答1: Here is the very very good answer. See below link Click Here When you see above example you will learn how to get call's end-state and you will also keep in

BroadcastReceiver onReceive timeout

六眼飞鱼酱① 提交于 2020-01-01 02:50:07
问题 I extend BroadcastReceiver , and in onReceive() I do whatever I need to do. onReceive() has a timeout, from the documentation: there is a timeout of 10 seconds that the system allows before considering the receiver to be blocked and a candidate to be killed This creates a problem when I am in debug mode. I need more than 10 seconds (sometimes). If I don't do all my debugging in 10 seconds my connection is closed and debugging is stopped. Can I increase the timeout or disable it for debugging

Android - Correct way to detect disconnecting from a particular wifi ssid?

爷,独闯天下 提交于 2020-01-01 00:22:30
问题 I've seen a couple of BroadcastReciever examples to detect wifi disconnects but none of them seem to work correctly (triggering twice for each disconnect for example) and none mention checking against an ssid, is this even possible? So just to clarify, I want to detect disconnection from a particular ssid. An actual disconnect and not wifi being disabled on the device. Thanks EDIT: Re-opening as nothing works on both the devices we have to test. 回答1: NETWORK_STATE_CHANGED_ACTION was the

TaskStackBuilder#startActivities() NullPointerException

让人想犯罪 __ 提交于 2019-12-31 22:22:07
问题 I have a crash that keeps occurring on 4.4.2 and 4.4.3 devices (although I'm not sure this is an API issue), where in some ParsePushBroadcastReceiver the following code causes a NullPointerException somewhere deep inside the startActivities call. Intent intent = new Intent(context, SomeActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); TaskStackBuilder.create(context) .addParentStack(SomeActivity.class) .addNextIntent(intent) .startActivities(); I have tried testing to see

How to Keep the CPU of android phone always awake?

隐身守侯 提交于 2019-12-31 02:43:10
问题 I have been stuck on it for days. I need to execute a function every minute. This function is making a POST call from the App to the Server and is transferring the location of the user per minute. The location coordinates are transferred for few hours, however, after few hours the transfer of location coordinates to the Server stops on its own. I am making use of WakefulBroadcastReceiver and IntentService to make sure that the CPU stays awake. I am also making use of Alarm to make sure that

Broadcastreceiver to obtain ServiceState information

放肆的年华 提交于 2019-12-30 22:55:21
问题 Does anyone know of a way to obtain the phone service state (IN_SERVICE, OUT_OF_SERVICE, EMERGENCY_ONLY, POWER_OFF) in android. I was hoping there would be a broadcastreciever to identify the changes, but I can't find anything. I know there's a listener but I'm not sure how I would use that from my app as it runs as a service using a WakefulIntentService (by thecommonsguy). With something like battery level (ie BATTERY_LOW, BATTERY_OKAY) it's quite easy, but I just can't work out a similar