Running application code after an Android device has finished booting is pretty straightforward. And there are already a few good tutorials available.
But, all the tutorials that have not been updated after the release of Android 2.2 (API 8), don’t mention that for it to work the App must be installed on internal storage.
This restriction on using internal storage only is documented, and a good overview is also available on stackoverflow