BroadcastReceiver dilemma

by Klaus Kartou » Fri, 23 Apr 2010 15:26:18 GMT


Sponsored Links
 Hi,

I recently added functionality to my app that does a simple state check on a
boolean when the connectivity state changes.
In order to do this i register a broadcast receiver that is invoked as soon
as the phones connectivity state changes.
This is all fine and works just as intended. However, a side effect of this
is that the application context is launched every time there is a change in
the connection. As a developer I know that this is ok, because the system
can just kill the context whenever it wants. But users that use any kind of
app-killer sees that the app is regularly reoccurring on the list of running
app, and therefore thinks that the app does unnecessary background work and
takes up resources.
So how do i 'solve' this 'issue'. I cant expect the users to understand the
underlying functionality of the OS...and people are uninstalling the app
because they dont like that it is reoccuring on the app-killer list...

Any thoughts? :)

Cheers

--



BroadcastReceiver dilemma

by Kumar Bibek » Fri, 23 Apr 2010 15:35:42 GMT


 Well, it's a difficult and funny situation. I will provide a funny
solution as well.

When your receiver is waking up, hunt down for the App-Killer app and
kill it. :) There's always a compromise that has to be made in such
cases. You cannot really do anything. Maybe, your receiver needs to
wake up less frequently to get away from the Killer program.

Thanks and Regards,
Kumar Bibek

But, yes, this is kind of irritating.



>


Sponsored Links


Other Threads

1. [WTA] Kamera Depan Incredible S

Mohon info apakah kamera depan dari Incredible S dapat berfungsi video call ?


make simple thing ! don't be afraid 

-- 
===============

2. java.net.UnknownHostException: android.clients.google.com

Why do I keep seeing this error

E/CheckinTask(  243): Checkin failed:
https://android.clients.google.com/checkin (request #0)
E/CheckinTask(  243): java.net.UnknownHostException: android.clients.google.com
E/CheckinTask(  243):   at
java.net.InetAddress.lookupHostByName(InetAddress.java:506)
E/CheckinTask(  243):   at
java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
E/CheckinTask(  243):   at
java.net.InetAddress.getAllByName(InetAddress.java:256)
E/CheckinTask(  243):   at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
E/CheckinTask(  243):   at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
E/CheckinTask(  243):   at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
E/CheckinTask(  243):   at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
E/CheckinTask(  243):   at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
E/CheckinTask(  243):   at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
E/CheckinTask(  243):   at
android.net.http.AndroidHttpClient.execute(AndroidHttpClient.java:248)
E/CheckinTask(  243):   at
com.google.android.common.http.GoogleHttpClient.executeWithoutRewriting(GoogleHttpClient.java:203)
E/CheckinTask(  243):   at
com.google.android.common.http.GoogleHttpClient.execute(GoogleHttpClient.java:245)
E/CheckinTask(  243):   at
com.google.android.common.http.GoogleHttpClient.execute(GoogleHttpClient.java:313)
E/CheckinTask(  243):   at
com.google.android.gsf.checkin.CheckinTask.sendRequest(CheckinTask.java:254)
E/CheckinTask(  243):   at
com.google.android.gsf.checkin.CheckinTask.doInBackground(CheckinTask.java:150)
E/CheckinTask(  243):   at
com.google.android.gsf.checkin.CheckinService$1.doInBackground(CheckinService.java:221)
E/CheckinTask(  243):   at
com.google.android.gsf.checkin.CheckinService$1.doInBackground(CheckinService.java:214)
E/CheckinTask(  243):   at android.os.AsyncTask$2.call(AsyncTask.java:185)
E/CheckinTask(  243):   at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
E/CheckinTask(  243):   at
java.util.concurrent.FutureTask.run(FutureTask.java:138)
E/CheckinTask(  243):   at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
E/CheckinTask(  243):   at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
E/CheckinTask(  243):   at java.lang.Thread.run(Thread.java:1019)

How can I fix it?

Youtube won't work.
Markey won't work.
gmail won't work.

Then suddenly they work.

I don't get it.  It's just too dodgy.



Shawn

NexusOne
2.3.3
using wifi

-- 

3. display image from net

4. get stuck in /init/main.c

5. Augmented Reality and Spherical 360潞 Views

6. performance issue of an android application

7. Developing app to connect with websites