Monday, June 06, 2005

Auto-Start App on Device Startup

I need to auto-start my application when the Audiovox phone boots up. In Windows XP, there appears to be two primary methods developers use to auto-load their applications when Windows loads: (1) the application installer copies a shortcut of the program into the "StartUp" directory (C:\Documents and Settings\user\Start Menu\Programs\Startup) or a more popular method (2) add a path to your program in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run of the Windows Registry.

The nice thing about the latter method is that many programs use command line switch options to load in a special way if executed by autostart rather than by user. You could imagine building a program that uses a command line switch like -autostart that would simply load itself passively into the background when initiated by the device, while the same program might show a load screen or user interface when initiated by the user.

I am not entirely sure how this works on Smartphones. I am quite confident that method one above works. The model here is, let the installer do the work and copy a shortcut of your application into the Smartphone's Startup directory. However, I found a discussion on msdn that seems to indicate shortcuts on mobile devices are limited compared to their desktop counterparts. In WindowsXP, for example, you can set the Shortcut's target application and in the process you can include command line switches. This does not appear possible on Smartphones (link). Of course, this does not limit you in just creating a simple shortcut to your application or, as the above link outlines, creating a special boot application independent of your main executable.

Incidentally, you can see a list of programs slated to auto-start by typing "msconfig" in the Run window of Windows XP, then click the "Startup" tab. (See link for more information)

1 comment:

Anonymous said...

Copying a shortcut to your executable into the \Storage\windows\StartUp folder will autostart your app just fine.