Re: [android-developers] Re: Scheduling a recurring Intent to fire off twice a day

2012-01-06 Thread TreKing
On Fri, Jan 6, 2012 at 2:37 PM, Diego Tori wrote: > But yeah, I just need to know if I'm setting it up correctly. Did you test it? Does it work? - TreKing

[android-developers] Re: Scheduling a recurring Intent to fire off twice a day

2012-01-06 Thread Diego Tori
Also, the pending intents that I check with FLAG_NO_CREATE should be checking if said intents returned null in order to set them. On Jan 6, 3:37 pm, Diego Tori wrote: > You have to assume that the functions already have an instance of > AlarmManager. > > "AlarmManager alarms = (AlarmManager) > co

[android-developers] Re: Scheduling a recurring Intent to fire off twice a day

2012-01-06 Thread Diego Tori
You have to assume that the functions already have an instance of AlarmManager. "AlarmManager alarms = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE)" But yeah, I just need to know if I'm setting it up correctly. On Jan 6, 3:02 pm, Kristopher Micinski wrote: > Sorry, now see you

[android-developers] Re: Scheduling restart of crashed service

2011-05-11 Thread Pandi
But Requirement is to run monkey for the whole package. How to debug the issue from logged message. I could not get any clue. Is it restarting Music Application or particular service/activity mentioned in the log? Thanks, Pandi On May 11, 8:41 pm, lbendlin wrote: > Why do you let the monkey run

[android-developers] Re: Scheduling restart of crashed service

2011-05-11 Thread lbendlin
Why do you let the monkey run against Android itself? You probably want to specify your application package, and prohibit monkey from jumping out of the sandbox. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send

[android-developers] Re: Scheduling ideas

2011-02-24 Thread Neilz
Yes sorry, bad wording, not an activity as such. My AlarmReceiver has one method, onReceive(), which starts an ASyncTask - that in turn does a server call, then schedules the next alarm. On Feb 24, 8:50 pm, Kostya Vasilyev wrote: > Ok, that's a receiver. > > I am guessing that your receiver uses

Re: [android-developers] Re: Scheduling ideas

2011-02-24 Thread Kostya Vasilyev
Ok, that's a receiver. I am guessing that your receiver uses startActivity. If you do that, beware of sleep/wake states, it's documented here: http://developer.android.com/reference/android/app/AlarmManager.html Android guarantees that for Wakeup-type alarms delivered to a broadcast receiver

Re: [android-developers] Re: Scheduling ideas

2011-02-24 Thread Justin Anderson
That is not "an activity that extends a Broadcast receiver." That is a class that extends a Broadcast receiver, making AlarmReceiver a broadcast receiver, not an Activity. On Thu, Feb 24, 2011 at 1:27 PM, Neilz wrote: > Like this: > > public class AlarmReceiver extends BroadcastReceiver { > > O

[android-developers] Re: Scheduling ideas

2011-02-24 Thread Neilz
Like this: public class AlarmReceiver extends BroadcastReceiver { On Feb 23, 10:11 pm, Kostya Vasilyev wrote: > 24.02.2011 1:06,Neilzпишет: > > >   I'm using an Activity that > > extends a BroadcastReceiver... > > An Activity that extends a Broadcast receiver? Sorry, I'm not sure I > understand

Re: [android-developers] Re: Scheduling ideas

2011-02-23 Thread Kostya Vasilyev
24.02.2011 1:06, Neilz пишет: I'm using an Activity that extends a BroadcastReceiver... An Activity that extends a Broadcast receiver? Sorry, I'm not sure I understand what this means. Do you mean something else - like a BroadcastReceiver subclass that starts an Activity subclass? -- Ko

[android-developers] Re: Scheduling ideas

2011-02-23 Thread Neilz
Hi Kostya. Regarding this info you suggested... the examples seem to demonstrate this for starting and stopping a Service. I'm using an Activity that extends a BroadcastReceiver... can it still be used in the same way? I'm a little confused about how to implement this. Thanks for the help, Neil.

Re: [android-developers] Re: Scheduling ideas

2011-02-20 Thread Dianne Hackborn
No, AsyncTask has nothing to do with when your process is killed. In both ways -- it can not allow it to be killed, nor can it *prevent* it from being killed (having a Service, Activity, etc running is what lets the system know how important the process is to be kept around, and thus whether it wi

[android-developers] Re: Scheduling ideas

2011-02-20 Thread Neilz
Ok. I think I may have found one factor influencing this. I'm using ASyncTask to handle the thread. I've just been reading some blogs on this, and it seems it is hard coded to use the lowest priority, which means it may well be killed off when used on a device with low memory (like my Hero in this

[android-developers] Re: Scheduling ideas

2011-02-20 Thread Neilz
I'm using the service to connect to a server and get dynamic info for the app, which I want to happen each morning. Not updates, just up to date data that the app uses, in this case sporting info. I'll look into that info, thanks. On Feb 20, 1:57 pm, Kostya Vasilyev wrote: > This means Android d

Re: [android-developers] Re: Scheduling ideas

2011-02-20 Thread Kostya Vasilyev
This means Android decided to get rid your process, thinking it wasn't important. http://android-developers.blogspot.com/2010/02/service-api-changes-starting-with.html Add a call to startForeground while updating data, and stopForeground when done. And btw, you are using AlarmService to sche

[android-developers] Re: Scheduling ideas

2011-02-20 Thread Neilz
Yep, added a Throwable block, still nothing. The only output I get is this: 02-20 13:33:26.067: INFO/ActivityManager(83): Process com.my.app.android.activity:remote (pid 4610) has died. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To p

Re: [android-developers] Re: Scheduling ideas

2011-02-20 Thread Kostya Vasilyev
20.02.2011 16:18, Neilz пишет: I did the network test... Active network info: NetworkInfo: type: WIFI[], state: CONNECTED/ CONNECTED, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: true That's good. And added a general Exception block, which still didn't c

[android-developers] Re: Scheduling ideas

2011-02-20 Thread Neilz
Thanks Kostya. I did the network test... Active network info: NetworkInfo: type: WIFI[], state: CONNECTED/ CONNECTED, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: true And added a general Exception block, which still didn't catch anything! -- You received

Re: [android-developers] Re: Scheduling ideas

2011-02-20 Thread Kostya Vasilyev
If your device switches off the networking connection while sleeping, then yes, that line can throw an exception. It should be an IOException, which should go into the log, but since it doesn't seem to be - add a catch block for Exception (or even better, Throwable) and log it, see what happen

[android-developers] Re: Scheduling ideas

2011-02-20 Thread Neilz
Reviving this thread yet again... There does seem to be some kind of bug in the code. Strange thing is though, it does get caught. The code always works fine within normal circumstances, but when it's run as an Alarm Service, the process dies at a particular line, and it isn't caught in the catch

Re: [android-developers] Re: Scheduling ideas

2011-02-07 Thread Kostya Vasilyev
Neil, A background service may be stopped by Android at its discretion. The beauty of AlarmManager is that it doesn't matter - when an alarm fires, the component that the pending intent is intended for will be started as necessary. The alarms are not kept in the application's process, they a

[android-developers] Re: Scheduling ideas

2011-02-07 Thread Neilz
More issues with this. I'm testing on a Nexus and Hero. It all runs fine on the Nexus, but on the Hero after I schedule the alarm, sometimes the process seems to die: 02-07 09:00:36.664: INFO/ActivityManager(98): Process com.my.app.activity:remote (pid 1813) has died. And that's it, no other log

Re: [android-developers] Re: Scheduling ideas

2011-02-06 Thread Kostya Vasilyev
Yes, this was discussed recently here: http://code.google.com/p/android/issues/detail?id=14536 and there appears to be no workaround, except explaining this to the user (in the application's UI or if he contacts you). I was just saying that there are devices out there with pretty weird quirks

[android-developers] Re: Scheduling ideas

2011-02-06 Thread Neilz
Really, BOOT_COMPLETED can be disabled? That poses me a bit of a problem. So there's no way for me to know whether my alarm service has been restarted. On Feb 5, 4:01 pm, Kostya Vasilyev wrote: > Well, some devices have really weird settings, like the HTC "fast boot" > optimization for the Desir

Re: [android-developers] Re: Scheduling ideas

2011-02-05 Thread Kostya Vasilyev
05.02.2011 18:47, Neilz пишет: No I'm testing on a Nexus... Ok. But I can't be responsible for user's individual settings, so I'll just have to assume that in some cases the network will not be available during the night. Unless there's a command to explicitly wake up the connection? Well,

[android-developers] Re: Scheduling ideas

2011-02-05 Thread Neilz
No I'm testing on a Nexus... But I can't be responsible for user's individual settings, so I'll just have to assume that in some cases the network will not be available during the night. Unless there's a command to explicitly wake up the connection? On Feb 5, 3:42 pm, Kostya Vasilyev wrote: > In

Re: [android-developers] Re: Scheduling ideas

2011-02-05 Thread Kostya Vasilyev
Interesting. I take it by wireless you mean cellular? My HTC Hero has an option for "always on cellular data connection" - I guess it's specific to HTC phones, as neither my Samsung Galaxy S or Motorola Milestone have that. Is your phone made by HTC by any chance? If so, perhaps you could ch

Re: [android-developers] Re: Scheduling ideas

2011-02-05 Thread Mark Murphy
On Sat, Feb 5, 2011 at 10:22 AM, Neilz wrote: > Yes, looking at the log output, it seems the device disables the > wireless connection after a few minutes while the phone's sleeping, to > save resources I suppose. So I'll just have to code around that, and > reset the alarm to try again until the

[android-developers] Re: Scheduling ideas

2011-02-05 Thread Neilz
Yes, looking at the log output, it seems the device disables the wireless connection after a few minutes while the phone's sleeping, to save resources I suppose. So I'll just have to code around that, and reset the alarm to try again until the connection is back. On Feb 5, 1:29 pm, Kostya Vasilyev

Re: [android-developers] Re: Scheduling ideas

2011-02-05 Thread Kostya Vasilyev
Neil, That's pretty much how I test too, except my code lacks a check for isConnected, only for null. This is what I get in my app's log: NetworkInfo: type: MOBILE[EDGE], state: CONNECTED/CONNECTED, reason: apnSwitched, extra: internet.mts.ru, roaming: false, failover: false, isAvailable: t

[android-developers] Re: Scheduling ideas

2011-02-05 Thread Neilz
Hi Kostya. Yes, the alarm gets called... it's just my own call which stops it doing it's task. For example: if(isNetworkAvailable(mContext)){ // do stuff... } public static boolean isNetworkAvailable(Context context) { ConnectivityManager connMgr = (ConnectivityManager) contex

Re: [android-developers] Re: Scheduling ideas

2011-02-05 Thread Kostya Vasilyev
05.02.2011 15:40, Neilz пишет: Ok, one problem with this alarm service. I schedule it for some time in the morning, and when I get up and check the phone, the alarm didn't get called, because it thinks there's no network connection. I'm sure the alarm did get called, as the AlarmManager servic

Re: [android-developers] Re: Scheduling ideas

2011-02-05 Thread Marcin Orlowski
On 5 February 2011 13:40, Neilz wrote: > Ok, one problem with this alarm service. > > I schedule it for some time in the morning, and when I get up and > check the phone, the alarm didn't get called, because it thinks > there's no network connection. Alarm manager makes does not care network conn

[android-developers] Re: Scheduling ideas

2011-02-05 Thread Neilz
Ok, one problem with this alarm service. I schedule it for some time in the morning, and when I get up and check the phone, the alarm didn't get called, because it thinks there's no network connection. This is a call I make deliberately (I always check there's a connection before making the serve

[android-developers] Re: Scheduling ideas

2011-02-01 Thread Neilz
Aha... good thinking! Thanks for the help again, Kostya :) On Feb 1, 9:26 pm, Kostya Vasilyev wrote: > Neil, > > You can set a non-repeating RTC or RTC_WAKEUP alarm at a fixed time, > then when it fires, set the next one. > > Rinse, repeat :) > > -- Kostya > -- You received this message becaus

Re: [android-developers] Re: Scheduling ideas

2011-02-01 Thread Kostya Vasilyev
Neil, You can set a non-repeating RTC or RTC_WAKEUP alarm at a fixed time, then when it fires, set the next one. Rinse, repeat :) -- Kostya 02.02.2011 0:22, Neilz пишет: One thing I'm unsure of is how to schedule an alarm for a certain time, like 8am every day. All I can see is setting a r

[android-developers] Re: Scheduling ideas

2011-02-01 Thread Neilz
One thing I'm unsure of is how to schedule an alarm for a certain time, like 8am every day. All I can see is setting a repeat, at an interval of x milliseconds. Ok, so I can say "one day's worth" of milliseconds, but that's placing a lot of trust on the system clock? I can see that going wrong som

Re: [android-developers] Re: Scheduling ideas

2011-02-01 Thread Kostya Vasilyev
01.02.2011 20:35, Neilz пишет: Right, thanks. And will that stay on the device as long as the app is still installed? Yes. (And, I suppose, will it get removed if the app is uninstalled?) Believe so. -- Kostya On Feb 1, 5:25 pm, Kostya Vasilyev wrote: Right, alarms are not persistent.

[android-developers] Re: Scheduling ideas

2011-02-01 Thread Neilz
Right, thanks. And will that stay on the device as long as the app is still installed? (And, I suppose, will it get removed if the app is uninstalled?) On Feb 1, 5:25 pm, Kostya Vasilyev wrote: > Right, alarms are not persistent. > > Implement a receiver for android.intent.action.BOOT_COMPLETED,

Re: [android-developers] Re: Scheduling ideas

2011-02-01 Thread Kostya Vasilyev
Right, alarms are not persistent. Implement a receiver for android.intent.action.BOOT_COMPLETED, and set the alarm again after the device reboots. -- Kostya 01.02.2011 20:22, Neilz пишет: Thanks... this seems to be what I'm after. However I just put together a simple repeat alarm, outputtin

[android-developers] Re: Scheduling ideas

2011-02-01 Thread Neilz
Thanks... this seems to be what I'm after. However I just put together a simple repeat alarm, outputting a Toast every minute, which was fine. But it didn't work again after a phone restart... how can this be implemented? -- You received this message because you are subscribed to the Google Gro

[android-developers] Re: Scheduling ideas

2011-02-01 Thread neuron
AlarmManager :) -- 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

[android-developers] Re: "Scheduling restart of crashed service", but no call to onStart() follows

2010-03-08 Thread kostmo
I should link to the question on Stack Overflow where it is said that you can restart your service from onCreate() manually, which actually will be called after memory pressure kills it. http://stackoverflow.com/questions/2398482/scheduling-restart-of-crashed-service-but-no-call-to-onstart-follows

[android-developers] Re: "Scheduling restart of crashed service", but no call to onStart() follows

2010-03-08 Thread James Wang
No. It is depend on system. -- 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.c

[android-developers] Re: Scheduling

2009-06-22 Thread bsbi...@googlemail.com
Thanks On Jun 18, 12:43 pm, Charlie Collins wrote: > This thread has good info on this topic from Dianne and Mark, start > with reading through > this:http://groups.google.com/group/android-developers/browse_thread/threa > > On Jun 18, 3:40 am, "bsbi...@googlemail.com" > wrote: > > > > > H

[android-developers] Re: Scheduling

2009-06-18 Thread Charlie Collins
This thread has good info on this topic from Dianne and Mark, start with reading through this: http://groups.google.com/group/android-developers/browse_thread/thread/98aba3b545ba4b16/. On Jun 18, 3:40 am, "bsbi...@googlemail.com" wrote: > Hi, > > I am writing a demo app that allows the user to s

[android-developers] Re: Scheduling

2009-06-18 Thread Dianne Hackborn
If scheduling is on the order of minutes or more, I strongly recommend using the alarm manager so your app doesn't need to remain running the entire time. On Thu, Jun 18, 2009 at 12:40 AM, bsbi...@googlemail.com < bsbi...@googlemail.com> wrote: > > > Hi, > > I am writing a demo app that allows th

[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 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/a

[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

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

[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 wrote: > Besides sendBroadcast( ), how about sentInt

[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 wrote: > Replying myself, for future reference. > For the scheduling part I used AlarmManager and a Service as mentioned > before. > For the "notificati

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