Android :: Registered Broadcast Receivers After Application Is Killed?

Mar 25, 2010

Currently my application is configured to always receive the CONNECTIVITY_CHANGED action to force an update if the previous update failed because there was no connectivity. What I don't like about this is that the broadcast receiver gets to be called too many times although it is not needed. I was thinking to register my broadcast receiver only if an update failed using the Context.registerReceiver(BroadcastReceiver receiver, IntentFilter filter) method. But I'm not so sure if this is a good idea. I'm concerned that if my application is evicted from memory the broadcast receiver will be unregistered or lost and my application will not be notified about the future CONNECTIVITY_CHANGED actions. The update is done in a short lived service. So if the update fails, the service will register the broadcast receiver just before it ends its execution time. Can somebody explain what happens to my broadcast receiver after the application is evicted from memory?

Android :: Registered broadcast receivers after application is killed?


Android :: Finding Which Broadcast Receivers Are Registered?

Jul 2, 2010

I have a program that monitors incoming SMS's, and I want it to monitor them full-time, so I registerReceiver with a Broadcast receiver that I've created. The problem is, if I want to unregister that receiver, I can't unless I know the original Broadcast Receiver class I registered. This is not a problem if I set it to stop when the program stops, but I want the receiver to keep running, only stopping when the user specifies. EDIT: Or is there a way of "Storing" the Broadcast Receiver class that I've created, such that when onDestroy is called it can be saved and when create is called again it can be pulled out.Is there any way of doing this?

View 1 Replies View Related

Android :: Extending Application Class And Broadcast Receivers

Nov 1, 2010

In a book I read, the author suggests to extend the application class in order to have a place to be used as a singleton. In this way, it is easy to make some initialization stuff in it onCreate().Now my question: if my application has also some broadcast receivers declared in the manifest, and the application was not started explicitly, or it was but then the os reclaimed it resources back, what will be happening if the broadcast receiver is triggered? Will the onCreate of the application class be called first?

View 7 Replies View Related

Android :: Run Multiple Broadcast Receivers For Same Intent In Same Application?

Oct 25, 2010

I'm working on a project where I need to run the BroadcastReceiver for a third party library for a specific Intent. I also want to run some of my own code when the Intent is broadcast. If I supply my own BroadcastReceiver for the same Intent, it seems that only, one or the other runs, but not both, depending on which appears first in the AndroidManifest.xml file. Is it possible to register multiple BroadcastReceivers for the same Intent in the same application and have them all run? AndroidManifest.xml snippet

View 4 Replies View Related

Android :: Does Not Return Receivers Registered By Registe RReceiver()?

Oct 4, 2010

I would like to check which receivers are there for a specific Intent yet queryBroadcastReceivers() ignores receivers that were registered in code using registerReceiver() call. It returns only receivers declared in the AndroidManifest.xml file. Is this behavior by design ? Any other way I can get information on *all* receivers capable of handling an Intent even if they where registered in code ?

View 4 Replies View Related

Android :: Using Broadcast Receivers

Sep 9, 2009

I had one question: Is it feasible to use a BroadcastReceiver as a glue layer between the user interface and the underlying business logic ? Example use case: Suppose i am maintaining the state of a call, and providing callbacks to the UI by invoking sendBroadcast with the relevant intent. Similarly, my underlying business logic can send broadcasts to the activity that has registered for receiving it on certain events ( like call connected, connecting, timed out etc).

View 4 Replies View Related

Android :: How To Use Broadcast Receivers?

Dec 30, 2009

Is it possible to use just a broadcast receiver without any activities? I just want to run some sample code only when the phone receives a call and nothing more. I use Log.d to write out but I don't see anything in the log. Am I missing something here? I also have permissions set in the androidmanifest.xml to allow for these type of intents.

View 3 Replies View Related

Android :: Dns Failing In Broadcast Receivers?

Mar 16, 2010

something weird just started happening. my app has a broadcast receiver which may access the network when invoked. the code has been solid for ages, but in the last few days it has started getting DNS errors on perfectly fine hosts. these are hosts which can be reached without problems in the main app or from other apps.interestingly i've seen another app get DNS errors too another app with a broadcast receiver.seems to affect all OS versions -- we have 1.5, 1.6, and 2.01 here. i don't have a Nexus to test 2.1, though. are there caveats to doing network inside broadcast receivers? i didn't think so, as ours worked fine until the time change [fx: twilight zone theme]

View 6 Replies View Related

Android :: Broadcast Receivers - Trigger Their Associates?

Apr 21, 2010

Can anyone give a hint if you know why there are some ACTIONS that do not trigger their associated receivers when they are registered in the manifest while they are received when they are register through registerReceiver() ? For instance, when I declare: <receiver android:name=".MyReceiver"> <intent-filter> <action android:name= "android.intent .action .NEW_ OUTGOING_CALL" /></intent-filter> </receiver> if the application is NOT running My Receiver is never invoked. But now, if I register the intent from inside a service, MyReceiver is invoked properly

View 2 Replies View Related

Android :: Difference Between Services And Broadcast Receivers

Jul 17, 2010

im trying to understand what the difference between a service and a broadcast receiver is,as i see it they can do the same thing.For example i have an application : App1 That provide a service called ToastHelloWorld which just creates a Toast and stopSelf(). expose it to other applications using an intent filter with the action name: "com.test.HelloToast"Now i have another application : App2 i want to implicit use a service with the action "com. test. Hello Toast" so i call startService( new Intent ("com. test.HelloToast"));and it works.Why would i use broadcast receivers when i can do everything with services and dont have the restriction of a 5sec execution limit?.I know most "system events" is exposed via broadcasts' but couldnt they just aswell be published as Service Intents?

View 1 Replies View Related

Android :: Bug Using Broadcast Receivers In App Widget Framework?

May 4, 2009

I started to implement my own App Widget using the example provided in the ApiDemos. In order to update the Widget efficiently I chose the Broadcast Receiver mechanism. In the ApiDemos there is this ExampleBroadcastReceiver which would (or should) react to changes related to TimeZone and Time as specified in the Android Manifest of the ApiDemos. I have debugged this Example using Eclipse and the Logcat output (provoking changes in TimeZone through the settings) and come to the conclusion that there must be some bug in the app widget framework. The only Broadcast Receiver that seems to work is the AppWidgetProvider itself. For instance I would expect something like: D/ExampleBroadcastReceiver intent=XY in the logcat's output after I have provoked the event XY. I have even tried without the 'enabled' option in the receiver's specification in the Android Manifest.

View 5 Replies View Related

Android :: App Widget Provider / Broadcast Receivers

Jun 28, 2010

The online android documentation says: Everything you can do with AppWidgetProvider, you can do with a regular Broadcast Receiver.So, what i want to do is to register via registerReceiver() another event other than ACTION_APPWIDGET_* on my Widget. For example ACTION_BATTERY_OKAY, is there any way to do this? Obviously i cant register the event from the onUpdate() code but i should do it using a service or something else. The problem is that im not able to find any reference to the Provider (AppWidgetManager only returns AppWidgetProviderInfo objects).

View 1 Replies View Related

Android :: How To Set Priorities For Multiple Broadcast Receivers?

Jul 22, 2010

How to set a priority for multiple Broadcast Receivers when dealing with ordered intent broadcast?

View 7 Replies View Related

Android :: RegisterReceiver For Broadcast Only If It's Not Already Registered?

Jan 26, 2010

I have a snippet of code that I'm calling from a service:

CODE:........

What I would like is a way to check and make sure that the registerReceiver isnt already listening before it calls it again. Is this possible?

For example if my snippet of code is in a method, and I call the method 10 times, right now the onReceive method appears to run 10 times.

View 1 Replies View Related

Android :: Design Approach - Web Service And Broadcast Receivers

Sep 23, 2010

I am developing an app for android mobiles that communicates with a json/rest web service. I need to make certain kinds of calls periodically to the server to check for some information. Within that context I might need also to query the GPS for the current position. I'm quite undecided to use a Local Service, since I don't know very well how to deal with them, in fact I need to retrieve those data periodically and refresh a MapView accordingly. I heard that I can use PendingIntents,in the service, associate this data as a payload and send them to a broadcast receiver which unpack the data and refresh the UI, I heard also that this is a bad design approach because of what broadcast receiver are intended to be used for.

View 1 Replies View Related

Android :: Broadcast Receivers Not Receiving Pending Intents

May 20, 2009

I've had an issue where no matter how I've tried to set it up I'm finding the Broadcast Receivers aren't receiving any Pending Intents. A look through LogCat confirms that the intents are launched, but they're not being executed. I managed to make a simple(ish) repro case. If you take the SimpleWiktionary widget by Jeff Sharkey http://code.google.com/p/wiktionary-android/ and make the following changes plus any required imports. Code...

View 8 Replies View Related

Android :: How To Capture Key Events From Intent's / Broadcast Receivers?

Oct 29, 2010

Is there a way to capture a key event from the Menu button using an Intent or Broadcast Receiver? Basically I want my app's Service to be activated when the Menu key is pressed.

View 1 Replies View Related

Android :: Detect If Broadcast Receiver Is Registered?

Mar 11, 2010

I'm using more than 1 instance of MapActivity in an application that look different from each other. I'm running into an issue sometimes when leaving a MapActivity doesn't unregister it's BroadcastReceiver and going Back to resume the MapActivity page it tries to re-register the receiver again, thus receiving an Exception that Receiver already registered.

Anyone know of a way to tell if a Broadcastreceiver is registered and is listening?

View 2 Replies View Related

Android :: Check If There Are Registered Broadcast Listeners?

Mar 22, 2009

Is there a way to check before sending a broadcast (from a remote service) whether there are registered broadcast listeners? What I'd like to do is to send broadcasts only if there are registered listeners, otherwise make a toast. Does it make any sense?

View 3 Replies View Related

Android :: To Unregister A Broadcast Receiver Register Registered In Manifest File

Mar 19, 2010

I have been able to register and unregister a broadcast receiver from the java code and know that a broadcast receiver is unregistered (even if it is not done explicitly) on its own as the process that registered it is killed. Now I have a broadcast receiver which has been registered through manifest file and not through the java code, and need to unregister the broadcast receiver from the java code. Since this, i think would need a reference to System context that instantiates the broadcast receiver.

View 4 Replies View Related

Android :: Test Application Killed / But It Got Intent

Dec 8, 2009

I created application with name Test, and has a class that extends broadcastreceiver that listen for PACKAGE_RESTARTED. I use Advanced Task Killer, and killed the Test application. But when I kill another application, for example gmail, the Test's broadcastreceiver got the intent (I logged it). Does it means that broadcastreceiver will never died?

View 4 Replies View Related

Android :: Stop An Application If Any Of Activities Were Killed By OS

Sep 10, 2010

I have an application with many forms implemented as separate activities. The form variables are dynamically built based on a database, and there are a ton of variables in the C++ side of the application (accessed via JNI). I don't see how saving out all of this data to persistent storage each time the onPause() or the onSaveInstanceState() of one of these many activities goes into the background is a smart use of processor time. And I don't see how even if I save the local variables for each activity during that time I'd be able to restore a single activity within the context of all the others.

I have set up a service that auto saves the files when I detect that the app has gone into the background. (I set a time stamp when onPause() is called in any activity and then clear the time stamp when onResume() is called on any other activity. If the time elapsed is more than a few seconds, I know I'm not the top activity any longer and the service saves the files).

What I'd like to do is continue on as normal unless the OS kills one of my activities. Since we don't always get notified of this, I thought it would be nice if there were a way to tell the OS that I'd rather you kill the whole app than just one activity.

View 1 Replies View Related

Android :: Froyo - Killed Application Detection?

Jul 29, 2010

On Froyo, we found that some new "Task Manager" apps are now using the ActivityManager.killBackgroundProcesses() to kill apps. When this happens, Intent.ACTION_PACKAGE_RESTARTED is no longer fired. How can I find out that my application has been killed? I tried to start a service, and I do see this message printed in logcat:

W/ActivityManager( 2426): Scheduling restart of crashed service com.example.android.apis/.app.RemoteService in 20000ms

However, the service is never restarted as advertised, if the app is killed using the killBackgroundProcesses API. (If I go into adb shell and kill the service process, the service will indeed be restarted ...) This looks like a bug anyway, because the notification created by the app is no longer removed like in eclair (the StatusBarService, and a bunch of other system services, depend on the Intent.ACTION_PACKAGE_RESTARTED broadcast).

View 14 Replies View Related

Android :: GPS Application Gets Killed On Screen Timeout

Apr 9, 2009

I can see on OMAP zoom2 platform, the moment screen timeout happens my application is getting terminated. I have a Google map based LBS application which is running on Zoom. I have implemented the interfaces given in gps.h to libhardware_legacy/gps.cpp .

GPS application talks to android framework and Framework talks to libhardware to get the GPS info. Now I can see that the moment screen timeout happens and the display goes off, my application killed. Actually from the framework the stop interface (hgps_stop() ) gets called on screen timeout.

I am wondring why this is happening, as I am not sending any stop request form my GPS application to the libhardware.

Is it something related to Android power manager, that android Power manager does not know about my application is running?

View 2 Replies View Related

Android :: Application Gets Killed - Because Provider Is In Dying Process

Apr 9, 2009

After long running the Media|Player (audio mode) the app I'm developing often crashes w/ the following error: > Process android.process.media (pid 14795) has died. > Killing <my app> because provider com.android.providers.media.MediaProvider is in dying process android.process.media

View 3 Replies View Related

Android :: Alarm Manager Broadcasts Canceled When Application Killed?

May 15, 2010

I have two BroadcastReceiver registered. When the app is closed they both fire at the appropriate times and do the appropriate things. If the app is closed then killed (say with an AppKiller), the receivers never receive their broadcasts, and nothing happens. Presumably the same thing happens if the parent app is killed due to low memory, so how do I ensure those broadcasts are fired/received. The API states that even if the app is killed it should fire, does anyone else have experience with this situation? If it helps my manifest is:

<!-- receivers for AlarmManager -->
<receiver android:exported="true" android:label="Shift roster updating calendar."
android:name="com.skooter.shiftroster.backend.service.UpdateCalendar" >
</receiver> <receiver android:exported="true" android:label="Shift roster checking alarm."
android:name="com.skooter.shiftroster.backend.service.SetWakeup" >
</receiver>
and nothing esoteric is going on in the AlarmManager/BroadcastReceivers

View 1 Replies View Related

Android :: Any Other Application As Broadcast Receiver?

Jul 29, 2009

I am broadcasting an Intent from an activity. Can we make another application as a receiver. So that it will get invoked when that specific intent is broadcasted.

View 2 Replies View Related

Android :: Broadcast Data To Other Application?

May 15, 2009

I create an application where i get the various data from net (say for example i am getting the temperature information of particular city and another data is the information of stock value of a particular company) now i want to broadcast that various data to all application. I create a registration process for diff application for diff data (EX app A is registrar for temp of city). so application is registrar for particular data will get that data.

How can i broadcast the information to all application which are registrar .

View 2 Replies View Related

Android :: Android - Massage Viberator - Application Does Not Stop Vibrating Even After The Process Is Killed

Oct 18, 2010

I will try to be as brief as possible... I have published a very simple android application it's name is "Vib-e-rator PRO". It's purpose is obvious, it can be used as a masssage vibrator or as an erotic stimulator...

My Problem is don't have an Android Phone to test my app in real time.

I have been recieving mixed comments from people. A few users say its working fine. But majority of them complained that the Phone would n quit vibrating even after the closing application.

Later i speculated that when ever the user switched off the vibrator and quit the app it would work as expected. If any user (most of em) directly closed the application ( either through the close option provided in the app itself or by pressing the END button in the phone ) without switching off the vibrator then it would not stop vibrating.

So i added myvib.Cancel() (myvib is the context for Phone Vibrator) in the exit block the close option provided in my app. For the other scenario, when it is closed by pressing the END button in phone, i have no idea how to solve it... So friends please advice me what is necessary to do... The comments i have been receiving from many users of my app is really embarassing....

View 3 Replies View Related

Android :: Registering Broadcast Receiver To Run When Application Launched?

Aug 13, 2010

I want to run some code when an app is launched, so my broadcast receiver has to be notified when user open any app.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved