Fwd: [two forty four a.m.] Status updated: Get rid of the continuous notificatio...

0 views
Skip to first unread message

Mark Otway

unread,
Dec 24, 2009, 9:29:10 AM12/24/09
to Newsrob Group

Mario, have you seen this? Will newsrob have to show a constant notification too?

---------- Forwarded message ----------
From: "two forty four a.m." <no-r...@uservoice.com>
Date: 24 Dec 2009 14:05
Subject: [two forty four a.m.] Status updated: Get rid of the continuous notificatio...
To: <ma...@otway.com>

two forty four a.m.

Status updated: Get rid of the continuous notification in Locale 1.0

Carter (admin) responded "Notifications are required for Locale to run reliably in the background on Android 2.0 and later. I know the Android team as well, and there's nothing that can be done. <http://developer.android.com/reference/android/app/Service.html#startForeground(int,%20android.app.Notification)>"

How can we improve this email? Visit our notifications forum

Too much email? Edit your email notifications Unsubscribe

powered by UserVoice

Disconnect

unread,
Dec 24, 2009, 10:44:32 AM12/24/09
to new...@googlegroups.com
That is just locale's way of eating CPU/battery again. You can set alarms instead, which is what reasonable services do. (A notification while syncing may be required to ensure it isn't interrupted unexpectedly, but it shouldn't need one just to schedule syncing and such.)

The only remaining issue is that the Android team still refuses to accept that there are use-cases (esp on memory limited devices like the g1) that aren't covered by their process management algorithm. As a result, there is no way (without root) to -just- stop a running process. Task managers that kill processes result in all alarms, autostarts, etc for that app being cleared as well. (So you can't say "don't hang out in memory right now, I'm doing something else" without also saying "oh, and never start automatically again.") This may be what they are trying to work around.

--

You received this message because you are subscribed to the Google Groups "NewsRob User Group" group.
To post to this group, send email to new...@googlegroups.com.
To unsubscribe from this group, send email to newsrob+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/newsrob?hl=en.

Mariano Kamp

unread,
Dec 25, 2009, 5:09:11 AM12/25/09
to new...@googlegroups.com
During the NewsRob/Locale integration I interacted with Carter a couple of times and got the impression that he is a bright, knowledgeable guy. So my assumption is that he knows what he is doing.

Having said that, from his answer that Mark is quoting I can't deduct why he does it. So the only thing I can do hear is speculating, but that's fine with me ;-)

Some background: I think we discussed the issue already here:


And in there I linked to this discussion I started some time ago:

In the last post in this thread Dianne gives an indication that something like this would happen.

The reason is that in Android processes are killed by the OS when memory is needed. Processes that run in the foreground (that means they have something that can be seen directly or indirectly on the UI) have the highest priority and processes that linger around in the background have the lowest priority. Also the garbage collection in Android is not all that great and as a backup strategy processes are sometimes killed and restarted to compact the memory used, starting with the processed of the lowest priority.

It's is very unfortunate that the processed are killed on the OS level without any callback to the app. So many developers gave their background activity the foreground-flag in order not to be killed by the OS so easily. But of course, when everybody does that it doesn't work anymore and the OS cannot be effective anymore. 

That means that apps that should use the foreground flag, because the user would recognize a killed process, have now to compete with the twitter fetch service or the gps tracker. Or in other words, your audio might be killed.

In Android 1.6 the foreground-flag was deactivated and in 1.6 or 2.0 the method that is quoted by Carter was introduced. That solves the problem following the Android OS developer's philosophy: Make it transparent to the user! As an app developer you can now set the foreground-flag again, but only if you show a notification, so that the user sees what's going on.

This way not everybody will dare to use the foreground flag and also the user can start loudly complaining / uninstalling when they see this. Unfortunately it is not self evident to the user that the notification flag can mean the foreground-flag could be set, but this is likely the closest you can get in making the user aware of the situation.

So what about NewsRob? As not everybody now uses the flag NewsRob should regularly run through with the synchronization without being killed. Btw. you can check that for yourselves if you have logging enabled and even if you don't you will see something like this "The synchronization started at " + lastStarted + " was ended prematurely." at the beginning of the next sync.

The NewsRob synchronization can be restarted without a data loss. It is not efficient to do so, but if this happens rarely I don't see a problem with it. It means that some articles are not fetched/downloaded during this sync and we'll try again during the next sync, which will be triggered by an alarm, so the process doesn't need to run constantly.

I can't say much about Locale, but maybe the activity is not so easily restartable and cannot be triggered by alarms, but need to constantly monitor something (orientation changes or whatever). I really don't know.

For NewsRob I will not use that new feature unless I'll find out we'll have a situation like from before 1.6 again.

Btw. the 2nd generation phones are not so ressource bound anymore and also I hope that the garbage collector will get better, so in the future the pressure to kill services should become less, not more... I hope.

Btw. Mark I told you to wait for 1.6 and that the interrupted syncs would become much better. You were skeptical at that time ;-) How did this work out for you? Are you using 1.6 meanwhile and does it work better in this respect?

Mariano Kamp

unread,
Dec 25, 2009, 5:24:03 AM12/25/09
to new...@googlegroups.com
ps. Merry christmas!
Reply all
Reply to author
Forward
0 new messages