On Tue, Mar 5, 2013 at 11:43 AM, Latimerius <l4t1m3r...@gmail.com> wrote:

> Unfortunately, onDestroy() is really too late for the requirements I have.
>  I shouldn't keep threads running until onDestroy() as that could eat quite
> a lot of battery power over time.
>

Threads you can start and stop with onPause / onResume. Assuming it's that
simple in your case (I'm going to guess it's not =P )


> Also, audio has to be stopped as soon as user leaves the app.
>

This can also be stopped / resumed with onPause / onResume. I assume - I
haven't needed custom audio in my app.


>  The same goes for analytics session, it should to be closed right when
> the user leaves otherwise it would be hard to get accurate data about
> session length.
>

That's tricky, even without your specific requirements. "A session" in
Android is notoriously hard to determine.


>   And for saving data, onDestroy() is explicitly documented to be a bad
> choice.
>

Absolutely - I was suggesting onDestroy for all the clean up you stated you
needed to do.

Anyhow, you know your requirements better than I - just putting out some
food for thought. Good luck.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to