android-broadcast

Do I need to acquire wake lock when invoking a BroadcastReceiver

こ雲淡風輕ζ 提交于 2019-12-02 12:52:04
In the book Pro Android 4 By Satya Komatineni , Dave MacLean I've found: Android acquires a partial wake lock when invoking a broadcast service and releases it when it returns from the service in the main thread Does it mean that the Android OS ensures that the device will wake up for the time of going through onReceive of BroadcastReceiver ? In my case the BroadcastReceiver should get an intent from Google Play Services (GoogleLocationServices and to be precise Geofences api ). Where is it documented? EDIT: I've also found it here : because it is guaranteed that the BroadcastReceiver

Create an automatic launch-able Broadcast Receiver in Android

妖精的绣舞 提交于 2019-12-02 12:39:14
Problem: I am willing to create an application that simply starts as a background process and whenever a new message comes into the device it should log it into a file or simply display a toast message. I have read a lot of blogs and tried to follow the steps as mentioned. But, I keep on sending messages on my device and nothing displayed not even in device log. I want to run it on devices from Froyo to Lollipop. So, I am not willing to use new Telephony API which supports API 19 and later versions. Manifest File <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com

How to make my SMS App is highest Priority to receive Broadcast Receiver

旧时模样 提交于 2019-12-02 12:05:19
At First, I am sorry for my English is not good enough ! My problem is i am writting a Block SMS Application and i want to receive sms with my app and then i abort broadcast to make default sms app can't receive SMS, so i set my app have a highest priority (1000), but my app still receive broadcast after default sms app of android. I print all of my Android Phone SMS's broadcast received signal in order when my phone receive a SMS and i recognize that The System SMS App alway receive SMS Broadcast first and it also have Highest priority. So how can i make my sms app could receive SMS Broadcast

How to pass data from BroadcastReceiver to Activity without in onCreate()

我与影子孤独终老i 提交于 2019-12-01 23:12:33
问题 I have a serious issue about passing data from BroadcastReceiver to an Activity . Let see my issue carefully. I have a class PhoneStateReceiver extends BroadcastReceiver that used to received an incoming phone. public class PhoneStateReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { try { System.out.println("Receiver start"); String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE); String incomingNumber = intent.getStringExtra

How to create BroadcastReceiver without Activity/Service?

瘦欲@ 提交于 2019-12-01 18:53:35
I'm trying to create BroadcastReceiver without activity/service. While I've no problem registering and executing the code when an activity is present in the code when I remove the activity it fails. I do register the BroadcastReceiver using the manifest(!) But it is not being called when the activity is removed from the project. <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <receiver android:name="com.ge.test.InstallsListener" > <intent-filter> <data android:scheme="package" /> <action android

Notification action button does not fire pending intent

谁说我不能喝 提交于 2019-12-01 17:53:48
I try to send intent to BroadcastReceiver from notification action button my problem is that when I click the button the intent in not fired or not getting to the BroadcastReceiver. Here is my code: The notification: Intent accept = new Intent(this, ChallengesActionReceiver.class); accept.setAction("com.soinfit.utilities.CHALLENGE_CLICK"); accept.putExtra("reqId", extras.getString("reqId")); accept.putExtra("answer", "1"); PendingIntent acceptIntent = PendingIntent.getActivity(this, 1, accept, PendingIntent.FLAG_CANCEL_CURRENT); NotificationCompat.Builder mBuilder = new NotificationCompat

Trigger BroadcastReceiver when I click Button

怎甘沉沦 提交于 2019-12-01 12:09:08
I am trying to recive BroadcastReceiver when i click button on main.xml **mainfest.xml** <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <receiver android:name=".boardCast"> <intent-filter> <action android:name="borad.cast"/> <category android:name="android.intent.category.DEFAULT" /> <

Trigger BroadcastReceiver when I click Button

爱⌒轻易说出口 提交于 2019-12-01 10:46:19
问题 I am trying to recive BroadcastReceiver when i click button on main.xml **mainfest.xml** <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <receiver android:name=".boardCast"> <intent

How to determine when a bluetooth file is received?

大城市里の小女人 提交于 2019-12-01 09:50:52
问题 In my app, I need to edit an bluetooth-transferred file just after it is received. Exactly what Intent do I have to listen to with my BroadcastReceiver, in order to find out when a file has been received via Bluetooth? Also, please tell me if there are other solutions. 回答1: If the user gets a file via android OS, it's via the download manager. in that case u should register DownloadManager.ACTION_DOWNLOAD_COMPLETE private void registerBroadcastReceiver() { broadCastReceiver = new

Widget issue: BroadcastQueue: Background execution not allowed: receiving Intent

爷,独闯天下 提交于 2019-12-01 06:04:45
My app widget stops working after upgrading to targetSDk to 28. It is flawlessly working on old targetsdk devices. I am getting the following error: W/BroadcastQueue: Background execution not allowed: receiving Intent { act=ch.corten.aha.worldclock.WIDGET_DATA_CHANGED flg=0x10 } to ch.corten.aha.worldclock/.WorldClockWidgetProvider W/BroadcastQueue: Background execution not allowed: receiving Intent { act=ch.corten.aha.worldclock.WIDGET_DATA_CHANGED flg=0x10 } to ch.corten.aha.worldclock/.WeatherWidgetProvider androidmanifest.xml file contents are given below- <!-- clock widget --> <receiver