broadcastreceiver

Android app update broadcast

不问归期 提交于 2019-11-28 00:55:23
问题 So, im working on something that requires me to know when another application on the device is being updated. So my question is quite simple, does lets say YouTube or Spotify send a broadcast when the application is updating, and if so, what do i need to catch with my broadcastReceiver. 回答1: Your intent filter should be like: <intent-filter> <action android:name="android.intent.action.PACKAGE_REPLACED" /> <data android:scheme="package" /> </intent-filter> And onReceive method from your

Fatal Exception: android.app.RemoteServiceException: can't deliver broadcast at android.os.Handler.dispatchMessage

佐手、 提交于 2019-11-28 00:43:01
I am using broadcast messages on my android application (From io.socket I am sending broadcast messages to my Activity page). On some devices Samsung SM-G950F and SM-A520F I got an error " Fatal Exception: android.app.RemoteServiceException: can't deliver broadcast ". I got this error on Fabric crashlytics also I was not able to reproduce this issue. Here is the log I got from Fabric, Fatal Exception: android.app.RemoteServiceException: can't deliver broadcast at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1813) at android.os.Handler.dispatchMessage(Handler.java:102) at

Priority in a broadcast receiver to receive calls

那年仲夏 提交于 2019-11-28 00:13:36
My intention is to make a Broadcast receiver that performs actions when receiving a call. Is it possible that had more priority than the automatic call reception SO?. I've tried assigning a priority of 2147483647 which I think is the best, but still jumps me to try the call before the end of my receiver. <!-- Receiver de llamadas --> <receiver android:name=".PhoneCall"> <intent-filter android:priority="2147483647"> <action android:name="android.intent.action.PHONE_STATE"/> </intent-filter> </receiver> itaravika This link answer me: http://developer.android.com/reference/android/content

Unable to instantiate receiver java.lang.ClassNotFoundException

和自甴很熟 提交于 2019-11-28 00:07:33
问题 I got an error in my android application when it tries to instantiate a receiver that i use to start a service on boot up. The error is obvious, it can not find the class file of my receiver. But everything is ok with my manifest file, the packages and all and i have no clue what is happening. Here is my code: package dti.obd.reader; import dti.obd.reader.service.MainService; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public class

SMS receive with no notification

ぃ、小莉子 提交于 2019-11-27 23:49:05
I want to receive a sms in my app, but I don't want my Android to show a notification about that event. Algorithm: Receive sms (it's ok) If this is a sms with special content-format (for my app) - process it with my app and don't display a notification. If this is a simple message - I don't want to process it, so a notification must be displayed. I tried to use an ordered broadcast, but it doesn't help. Somewhere I read that SMS_RECEIVE's broadcast is not ordered, but I saw some apps, which can receive SMS without notify. Does anyone can help me or show me the right way to solve this problem?

BroadcastReceiver not working when I kill my application

ぃ、小莉子 提交于 2019-11-27 23:11:26
I have noticed than whenever I manually kill my application by longpressing the back button of my cellphone my broadcast receiver stops working. The receiver is in charge of displaying a notification every time the user hangs up a phone call and the same is registered in the manifest.xml. Is this the normal/expected behaviour? I thought the receiver should continue to work even if the user decides to kill my application... Is there a way to prevent this? Thanks. Edit Here's the manifest entry for the receiver: <receiver android:name=".BroadcastReceivers.CallReceiver" android:enabled="true">

Android - Trying to test a service on boot (java.lang.SecurityException: Permission Denial)

风流意气都作罢 提交于 2019-11-27 22:56:06
I've been trying to test a service when a device boots up on android, but I cannot get it to work. I'm trying to start it with this command from CMD: (in ..\AppData\Local\Android\sdk\platform-tools) adb shell am broadcast -a android.intent.action.BOOT_COMPLETED or adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -c android.intent.category.HOME -n net.fstab.checkit_android/.MyReceiver AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.tabache.sciopero"> <uses-permission android:name=

Android: detect when app is installed

≡放荡痞女 提交于 2019-11-27 22:50:17
问题 I am trying to download an Android app from a server using the DownloadManager class, install it and then detect when the installation is completed. I am using two receivers: one to detect the download process and the other to detect the install process. The first receiver works properly, but the second doesn't. What I am doing wrong? DownloadManager dm = (DownloadManager) DownloadApplicationActivity.this.getSystemService(Context.DOWNLOAD_SERVICE); DownloadManager.Request req = new

Android: Presenting a notification during a call?

☆樱花仙子☆ 提交于 2019-11-27 22:34:58
I have a broadcast receiver that listens to incoming calls. And I want to tweak the incoming call screen. Right now I can present toasts and add notifications to the notification bar (BTW the user can't pull it down because the screen is locked, before accepting the call, which kinda sucks). I tried to show an alert but it crashed - is it not allowed? Is there a way for the code in the broadcast receiver to do other things, like change the avatar of the caller or give it a name (even if it doesn't exist in the contacts). Let's just say my broadcast receiver intercepts a call - can it add the

Boot BroadcastReceiver does not work on Xiaomi devices

守給你的承諾、 提交于 2019-11-27 22:28:50
I have a following BroadcastReceiver which should run after boot completion. I have tested it on my Xiaomi device (Redmi 1s) , it's not running, while on other devices like Samsung it's running as expected. public class DeviceBootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { Toast.makeText(context, "I am Running", Toast.LENGTH_SHORT).show(); } } } I have set permission in Manifest. <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> And