So With background thread spawned from Service, provides functionality
as desired.
But it has 2 drawback which i must consider
As Mark wrote: Only waiting for time tick, it is not wise to wait from
app, better use alarmmanger.
As Kostya wrote: I should be considering that service may be killed in
extreme condition if OS think.
-Amit
On Feb 4, 11:54 pm, Kostya Vasilyev <kmans...@gmail.com> wrote:
> 04.02.2011 21:48, Amit :
>
> > Thanks for reply.
>
> > Is it necessary to ride on AlarmManager or similar other service.
>
> To get reliable scheduled notifications, yes.
>
> > Is
> > there any drawback in using background thread spawned from my process
> > itself.
>
> If you just spawn a thread without a service, then you're not telling
> Android that what you're doing is important, and it may decide to get
> rid of your application's process. This will terminate the thread as
> well, aborting any network IO you may have at that time.
>
> > And my process own at least one service so i can assume life
> > of my process will be towards higher side.
>
> Just having a service doesn't help with extending a process' lifetime.
>
> Android considers your service more important than others in two cases
> (that I know of):
>
> - Your service was bound by a foreground application;
> - The service called startForeground.
>
> -- Kostya
>
>
>
> > Thanks,
> > amit
>
> > On Feb 4, 5:17 pm, Kostya Vasilyev<kmans...@gmail.com> wrote:
> >> Yes, use AlarmManager, possibly with an IntentService or
> >> WakefulIntentService.
>
> >> --
> >> Kostya Vasilyev --http://kmansoft.wordpress.com
> >> 04.02.2011 15:14 "Amit"<agrawalamit2...@gmail.com> :
>
> >>> Hi,
> >>> Is it possible to trigger periodic network I/O from a pocess, who is
> >>> currently in background. And in my case it is possible that none of
> >>> activiy is in foreground at the time when network i/o is requested.
> >>> This I/O is client driven.
> >>> Thanks in advance
> >>> -Amit
> >>> --
> >>> 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+unsubscribe@googlegroups.com<android-developers%2Bunsubscribe@googlegroups.com>
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/android-developers?hl=en
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment