On Tue, Jul 7, 2009 at 4:34 AM, Peli <peli0...@googlemail.com> wrote:

> There are no limits on a background service once it is running.


However...  even in a service, never ever do long work on the main thread
(where the Service class callbacks happen) -- there could well be some other
thing that gets scheduled for your app (starting an activity, delivering a
broadcast) that will get blocked by what you are doing and cause an
ANR/death.

5 seconds for a service to start is actually well out of bounds of what you
should be doing.  That is enough to cause an ANR if the user tries to do
anything with your app while the service is starting.

Another thing to watch out for is initialization time of your process --
when your process isn't already running and it needs to launch an activity,
service, or receiver.  The timeouts are based on the time from when the
system decide to run one of these thing to when it completed, so if your
process initialization time is slow then it can cause these timeouts to
expire.  The main things to look for is any work done in creating your
Application object or any of the content providers running in your process,
all of which must be initialized before the first activity, service, or
receiver can be run.

Re:

1. Why is Cupcake so slow?


1.5 is not significantly slower than 1.1, and in some cases faster.

Do you know if this document has been updated
> with the changes made in Cupcake?
>

There were no changes in 1.5 that would have an impact on that doc.

Also note that you should NOT be basing any of this on behavior on the
emulator, since the speed of the emulator varies greatly depending on the
computer it is running on.  On a modern fast computer, it can run
significantly faster than a real device.  This is why you must always always
test on a device.  You just can't predict how well your app will really run
until you do so.

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to