[iphone-java] Starting a java application automatically
Wes Biggs
wes at tralfamadore.com
Tue Dec 2 13:20:39 UTC 2008
1. Look in /System/Library/LaunchDaemons. You need a .plist referencing
your app.2. I've had some tips on this but haven't tried implementing. The
following is from the author of Insomnia -- see
http://code.google.com/p/iphone-insomnia/
"However if you would like your application to do something periodically a
much better approach would be to schedule a wake up, and allow it to sleep in
between times, to conserve battery power like so:
NSCalendarDate *nextWake = [[NSCalendarDate calendarDate]
dateByAddingYears:0 months:0 days:0 hours:0 minutes:15 seconds:0];
CPSchedulePowerUpAtDate((CFDateRef)nextWake);
Then you need to cancel the suspend power notifications while you are doing
your work, so the phone stays on while it is working. If you don't do this
then it turns off again 15 seconds later interfering with what you need
done. This last part is in the Insomnia source code on this site."
HTH
Wes
2008/11/25 Evert Wagenaar <evert.wagenaar at mint.nl>
> Hi all,
>
> I created a small program which logs my location every minute (only
> when I'm traveling). I currently start it manually with a shell script
> containing 'nohup java -jar myapp.jar' . After that it runs nicely in
> the background.
>
> Two questions;
>
> 1. How can I make it start automatically?
> 2. When the iPhone goes into standby mode the process dies after a
> couple of minutes. Is there any way to keep it alive?
>
> Thanks,
>
> Evert
>
> _______________________________________________
> iPhone-Java mailing list
> iPhone-Java at telesphoreo.org
> http://www.telesphoreo.org/cgi-bin/mailman/listinfo/iphone-java
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.telesphoreo.org/pipermail/iphone-java/attachments/20081202/b4df6120/attachment.htm
More information about the iPhone-Java
mailing list