Micah wrote:
> Bump for the weekend crowd.  Anyone know how to test BOOT_COMPLETED
> intents? 

Outside of Eclipse, install the application, reboot the emulator, and
live without a debugger. Use the Log class to emit information to LogCat
as needed.

>> I'm using Eclipse on windows to do my Android development and I want
>> to test / debug some code that runs on Android startup.  I have setup
>> my program to receive the BOOT_COMPLETED broadcast intent (which is
>> working) and from there it launches a service that runs in the
>> background on the device indefinitely.

Consider switching your service to run off of AlarmManager for scheduled
bits of work. There is very little in Android that really requires you
to have a service running "indefinitely", particularly since they won't
(e.g., Android can shut them down if needed for memory, they won't run
while the device is asleep). Use your BOOT_COMPLETED listener to
schedule the AlarmManager.

This has the side benefit of being more testable in Eclipse, since you
can play with the alarm settings to get it to fire off sometime after
you have the debugger set up.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, $35/Year

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to