broadcastreceiver

How to send sms message inside broadcast receiver class?

佐手、 提交于 2020-01-06 05:01:05
问题 I have a class that implements a broadcast receiver. I also inside of this class i want to be able to send a text message out automatically. Is this possible. Ive tried a lot of different things and nothing seems to work. Maybe im doing something wrong. But here is my source code that i have so far. public class smsReceiver extends BroadcastReceiver { private MainActivity main; @Override public void onReceive(Context context, Intent intent) { Intent i = new Intent(context, smsReceiver.class);

Kill a phone call programatically in Oreo

妖精的绣舞 提交于 2020-01-05 17:00:18
问题 I am using this method to end a call in android public boolean killCall(Context context) { try { // Get the boring old TelephonyManager TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); // Get the getITelephony() method Class classTelephony = Class.forName(telephonyManager.getClass().getName()); Method methodGetITelephony = classTelephony.getDeclaredMethod("getITelephony"); // Ignore that the method is supposed to be private

Set Broadcast receiver for mobile data state change listener

雨燕双飞 提交于 2020-01-05 13:09:34
问题 I want to set receiver for any type of mobile data enabled/disabled such as 3g etc. I am using this code for on receive... but in some device it can't work properly and many case receiver trigger after some time and some time i will not trigger onReceive() of Broadcastreceiver ? Please help me either I going through wrong code or it need some other trick to resolve? ConnectivityManager conMan = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo =

handsent app suppresses SMS_RECEIVED broadcast

痴心易碎 提交于 2020-01-05 10:30:12
问题 i have an app in the market that handles android.provider.Telephony.SMS_RECEIVED broadcasts. now i realized, that the broadcast is not sent anymore (or at least i don't get it anymore) as soon as handcent sms is installed on the particular device. how is it possible that an app can suppress a broadcast from being sent? is there a way to still get the broadcast? thanks simon 回答1: how is it possible that an app can suppress a broadcast from being sent? SMSes are sent as an ordered broadcast.

Android App Not Responding the SMS Receiver

只愿长相守 提交于 2020-01-05 08:48:24
问题 I have been working on an app to respond to received SMS messages (before you complain, I know this has been asked A LOT, but believe me, I can't get it to work at all, and I've tried searching for hours). I've got my manifest set up like so: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.csbctech.notiscreen" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" /> <uses-permission

How to detect the event of network type change Android?

Deadly 提交于 2020-01-05 04:07:07
问题 I have the following code that works to detect the current network type when is launched, but I would like the app detects when network type changes, for example from 3G to LTE, LTE to 3G, 3G to 2G, etc. I found the class NetworkStateReceiver for BroadcastReceiver here but doesn't show anything when I change network. May someone help me how would be a way to not only shows the network type when app is launched but shows/detect the event of a network type change? I'm trying for Android 6.0.1

ACTION_PHONE_STATE_CHANGED not called on network cell changes

*爱你&永不变心* 提交于 2020-01-05 03:23:20
问题 I am trying to make my broadcast receiver fire when the phone goes in and out of reception areas. The issue is the receiver never gets called when the cell reception changes. The BroadcastReceiver works fine for getting phone call states (call idle, started ect...), and also for getting the airplane mode switched on and off because the broadcast receiver handles both. I added the permissions and intent filter to the receiver in the manifest and they are working fine. Here is what I have for

android - working with broadcastReceiver on android ICS (version 4)

允我心安 提交于 2020-01-04 09:01:46
问题 i'm having a problem on android ICS (version 4) and broadcastReceiver . please help: i'm trying to listen to a simple intent of network connectivity change . i've tried the next tutorial (with the broadcastReceiver defined in the manifest alone - the first part of the website ) : http://www.xinotes.org/notes/note/1526/ on ICS , it doesn't capture any intent , and on any other version it works just fine . can anyone please tell me what's wrong? do i need to add a new intent filter other than

BroadcastReceiver cannot show notification when app closed/killed

断了今生、忘了曾经 提交于 2020-01-04 05:17:15
问题 My task is to set a alarm to trigger receiver to show notification a specific time. And the code works perfectly if app is opened or just in background. At the time app is being killed, receiver can still be triggered when alarm is executed. However, no notification was shown. What can I do? Alarm function: public static void makeAlarm(Context context,Date date) { Log.i("Alarm", "makeAlarm"); AlarmManager alarmMgr; PendingIntent alarmIntent; alarmMgr = (AlarmManager) context.getSystemService

broadcastreceiver not working while phone is booting in Android

隐身守侯 提交于 2020-01-04 04:23:13
问题 I have created a lock screen for ICS and it is placed in the frameworks and we can open applications using this. For the user effects I have started an animation when the lock screen is displayed. This animation is started using SCREEN_ON broadcastereceiver. But when the phone is booting up even though I registered broadcastereceiver it is not reaching to onReceive() and the animation is not starting. While phone bootup is taking place I thought that this broadcast is not having higher