Thanks, that did the trick

On Sat, Mar 26, 2011 at 12:32 PM, Mark Murphy <mmur...@commonsware.com> wrote:
> On Sat, Mar 26, 2011 at 12:24 PM, Kevin Anthony
> <kevin.s.anth...@gmail.com> wrote:
>> I have an application that needs to fetch messages from a server,
>> currently i do this via a service, running in the background.
>> However, when my application is not in the foreground, it quickly gets
>> pushed out of memory, and stops checking for messages.
>
> This is a good thing. An everlasting service like this is an
> anti-pattern and should be avoided wherever possible.
>
>> I've been playing with AbstractThreadedSyncAdapter, but this seems a
> little heavy handed.
>
> Could be -- I haven't had a chance to mess with that yet.
>
>> Is there some middle ground?  Something i should look into?
>
> Use AlarmManager and fetch the messages on a periodic basis, with the
> user controlling the polling frequency (including an option for
> manual-refresh-only) via a SharedPreference.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android Training in London: http://bit.ly/smand1, http://bit.ly/smand2
>
> --
> 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



-- 
Thanks
Kevin Anthony
www.NoSideRacing.com

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