> I will try your suggestion.
> For second question, when my activity starts there is an involved process
> of
> initializing bunch of items which requires few seconds. Hence I wanted to
> initialize these via a service on BOOT_COMPLETE (working for me already)
> or
> on the package installation (which I am trying to figure out). This way
> when
> the activity is started by the user there wont be any wait.

Just show a ProgressDialog, ProgressBar, title bar progress indicator,
animated ImageView, or something, and do the initialization in the
activity. Or, find ways to initialize the items progressively, such that
you can start some the main functionality after a fraction of the
initialization time. Or, spend more time optimizing the initialization
process.

To put it another way: if you find a way to auto-start your application
without user involvement for the first run, that will probably be
considered a security hole. Android goes out of its way to make sure that
users run the app the first time, even if after that the app can arrange
for scheduled tasks and the like.

I am similarly concerned by your BOOT_COMPLETED strategy. Adding seconds
of time to the boot process is bad for Android, even if you think it may
be good for your app. Bear in mind that BOOT_COMPLETED is a slight
misnomer, and there is a bunch of other stuff going on then (e.g., home
screen launching, radios turning on), that your initialization logic will
be impeding.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


-- 
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