[android-developers] Re: Scheduling a repeating task and being notified

2009-03-20 Thread Kenny

Where to find RemoteCallbackList sample code?

On Mar 19, 10:03 pm, Streets Of Boston flyingdutc...@gmail.com
wrote:
 I did something similar, however, i did not use a BroadcastReceiver to
 get callbacks back from the service.
 Instead i used the RemoteCallbackList class:

  http://developer.android.com/reference/android/os/RemoteCallbackList

 No fiddling with intents and such. Just define a callback interface
 and bind to it in your client and call it in your service and you're
 done.

 It works like a breeze :-)

 On Mar 16, 6:16 am, BoD bodl...@gmail.com wrote:



  Replying myself, for future reference.
  For the scheduling part I used AlarmManager and a Service as mentioned
  before.
  For the notification back part I ended up using sendBroadcast from
  the service and a BroadcastReceiver on my Activity (registering/
  unregistering it in onResume/onPause). It works fine.

  BoD

  On Mar 15, 7:22 pm, BoD bodl...@gmail.com wrote:

   Hi!

   I'm trying to find the correct way to do the following:

   . I have an activity with a button that starts a repeating task in the
   background. That is, if the user goes away from my activity, I want my
   task to still be scheduled and executed every x minutes.

   . I want a status TextView to be displayed on the activity, and if the
   task happens to start executing while my activity is showing, the
   TextView should be updated so the user can be aware of what's going
   on.

   So basically, is there a way to start a scheduled background repeating
   task and be notified when it is executed?

   From what I saw in the sample applications, I understand I'm supposed
   to use AlarmManager and a Service but I'm not sure about the
   notification part.

   Thanks a lot for your help.

   BoD- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: Scheduling a repeating task and being notified

2009-03-19 Thread Streets Of Boston

I did something similar, however, i did not use a BroadcastReceiver to
get callbacks back from the service.
Instead i used the RemoteCallbackList class:

  http://developer.android.com/reference/android/os/RemoteCallbackList.html

No fiddling with intents and such. Just define a callback interface
and bind to it in your client and call it in your service and you're
done.

It works like a breeze :-)

On Mar 16, 6:16 am, BoD bodl...@gmail.com wrote:
 Replying myself, for future reference.
 For the scheduling part I used AlarmManager and a Service as mentioned
 before.
 For the notification back part I ended up using sendBroadcast from
 the service and a BroadcastReceiver on my Activity (registering/
 unregistering it in onResume/onPause). It works fine.

 BoD

 On Mar 15, 7:22 pm, BoD bodl...@gmail.com wrote:



  Hi!

  I'm trying to find the correct way to do the following:

  . I have an activity with a button that starts a repeating task in the
  background. That is, if the user goes away from my activity, I want my
  task to still be scheduled and executed every x minutes.

  . I want a status TextView to be displayed on the activity, and if the
  task happens to start executing while my activity is showing, the
  TextView should be updated so the user can be aware of what's going
  on.

  So basically, is there a way to start a scheduled background repeating
  task and be notified when it is executed?

  From what I saw in the sample applications, I understand I'm supposed
  to use AlarmManager and a Service but I'm not sure about the
  notification part.

  Thanks a lot for your help.

  BoD- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: Scheduling a repeating task and being notified

2009-03-18 Thread Kenny

Sorry, my fault. I was reading PendingIntent.send(). It was what I
meant.

http://groups.google.com/group/android-developers/browse_thread/thread/e5431d6a90b91646/a0892f62e2b42495#a0892f62e2b42495
is my concern.

Dalvik process is a zygoted JVM instance within a Linux process. It's
my understanding. Feel free to correct me please.

Kenny

On Mar 17, 1:00 am, BoD bodl...@gmail.com wrote:
 They are in the same application. The Service is started by the
 AlarmManager, so I'm not sure about what you mean by the same 'Dalvik
 process'.
 I'm also not sure of what you mean by sent(d?)Intent?

 Thanks a lot!

 BoD

 On Mar 16, 2:49 pm, Kenny yxw...@gmail.com wrote:



  Besides sendBroadcast( ), how about sentIntent( )? Are your service
  and receiver in the same Dalvik JVM process?

  Kenny

  On Mar 16, 6:16 pm, BoD bodl...@gmail.com wrote:

   Replying myself, for future reference.
   For theschedulingpart I used AlarmManager and a Service as mentioned
   before.
   For the notification back part I ended up using sendBroadcast from
   the service and a BroadcastReceiver on my Activity (registering/
   unregistering it in onResume/onPause). It works fine.

   BoD

   On Mar 15, 7:22 pm, BoD bodl...@gmail.com wrote:

Hi!

I'm trying to find the correct way to do the following:

. I have an activity with a button that starts arepeatingtaskin the
background. That is, if the user goes away from my activity, I want my
   taskto still be scheduled and executed every x minutes.

. I want a status TextView to be displayed on the activity, and if the
   taskhappens to start executing while my activity is showing, the
TextView should be updated so the user can be aware of what's going
on.

So basically, is there a way to start a scheduled backgroundrepeating
   taskand be notified when it is executed?

From what I saw in the sample applications, I understand I'm supposed
to use AlarmManager and a Service but I'm not sure about the
notification part.

Thanks a lot for your help.

BoD- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: Scheduling a repeating task and being notified

2009-03-16 Thread BoD

Replying myself, for future reference.
For the scheduling part I used AlarmManager and a Service as mentioned
before.
For the notification back part I ended up using sendBroadcast from
the service and a BroadcastReceiver on my Activity (registering/
unregistering it in onResume/onPause). It works fine.

BoD

On Mar 15, 7:22 pm, BoD bodl...@gmail.com wrote:
 Hi!

 I'm trying to find the correct way to do the following:

 . I have an activity with a button that starts a repeating task in the
 background. That is, if the user goes away from my activity, I want my
 task to still be scheduled and executed every x minutes.

 . I want a status TextView to be displayed on the activity, and if the
 task happens to start executing while my activity is showing, the
 TextView should be updated so the user can be aware of what's going
 on.

 So basically, is there a way to start a scheduled background repeating
 task and be notified when it is executed?

 From what I saw in the sample applications, I understand I'm supposed
 to use AlarmManager and a Service but I'm not sure about the
 notification part.

 Thanks a lot for your help.

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



[android-developers] Re: Scheduling a repeating task and being notified

2009-03-16 Thread Kenny

Besides sendBroadcast( ), how about sentIntent( )? Are your service
and receiver in the same Dalvik JVM process?

Kenny

On Mar 16, 6:16 pm, BoD bodl...@gmail.com wrote:
 Replying myself, for future reference.
 For the scheduling part I used AlarmManager and a Service as mentioned
 before.
 For the notification back part I ended up using sendBroadcast from
 the service and a BroadcastReceiver on my Activity (registering/
 unregistering it in onResume/onPause). It works fine.

 BoD

 On Mar 15, 7:22 pm, BoD bodl...@gmail.com wrote:



  Hi!

  I'm trying to find the correct way to do the following:

  . I have an activity with a button that starts a repeating task in the
  background. That is, if the user goes away from my activity, I want my
  task to still be scheduled and executed every x minutes.

  . I want a status TextView to be displayed on the activity, and if the
  task happens to start executing while my activity is showing, the
  TextView should be updated so the user can be aware of what's going
  on.

  So basically, is there a way to start a scheduled background repeating
  task and be notified when it is executed?

  From what I saw in the sample applications, I understand I'm supposed
  to use AlarmManager and a Service but I'm not sure about the
  notification part.

  Thanks a lot for your help.

  BoD- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: Scheduling a repeating task and being notified

2009-03-16 Thread BoD

They are in the same application. The Service is started by the
AlarmManager, so I'm not sure about what you mean by the same 'Dalvik
process'.
I'm also not sure of what you mean by sent(d?)Intent?

Thanks a lot!

BoD

On Mar 16, 2:49 pm, Kenny yxw...@gmail.com wrote:
 Besides sendBroadcast( ), how about sentIntent( )? Are your service
 and receiver in the same Dalvik JVM process?

 Kenny

 On Mar 16, 6:16 pm, BoD bodl...@gmail.com wrote:

  Replying myself, for future reference.
  For theschedulingpart I used AlarmManager and a Service as mentioned
  before.
  For the notification back part I ended up using sendBroadcast from
  the service and a BroadcastReceiver on my Activity (registering/
  unregistering it in onResume/onPause). It works fine.

  BoD

  On Mar 15, 7:22 pm, BoD bodl...@gmail.com wrote:

   Hi!

   I'm trying to find the correct way to do the following:

   . I have an activity with a button that starts arepeatingtaskin the
   background. That is, if the user goes away from my activity, I want my
  taskto still be scheduled and executed every x minutes.

   . I want a status TextView to be displayed on the activity, and if the
  taskhappens to start executing while my activity is showing, the
   TextView should be updated so the user can be aware of what's going
   on.

   So basically, is there a way to start a scheduled backgroundrepeating
  taskand be notified when it is executed?

   From what I saw in the sample applications, I understand I'm supposed
   to use AlarmManager and a Service but I'm not sure about the
   notification part.

   Thanks a lot for your help.

   BoD- Hide quoted text -

  - Show quoted text -


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