Re : How to catch BOOT_COMPLETED_ACTION from an IntentReceiver

by GAYET Thierry » Wed, 24 Jun 2009 20:38:00 GMT


Sponsored Links
 First thanks for your quick reply. I have well found the code you told me about 
(OnBootReceiver).

I have one more question 'cos i as i have said before i ma programming a 
service that i want to start when Android boot.

My core class extends Service not  BroadcastReceiver. So may i extend more than 
one time. I mean to extends  Service and BroadcastReceiver. for the same class 
? 

Maybe i need to add a public class OnBootReceiver extends BroadcastReceiver 
inside my service project ? But if so how to link this second class with the 
service one ?

 Regards


Thierry GAYET
NextInnovation.org
+33(0)663.849.589




________________________________
De : Mark Murphy <mmur...@commonsware.com>
 : android-developers@googlegroups.com
Envoy le : Mercredi, 24 Juin 2009, 14h08mn 24s
Objet : [android-developers] Re: How to catch BOOT_COMPLETED_ACTION from an 
IntentReceiver





You'll see this covered as part of:

 http://androidguys.com/?p=4411 

Sample code implementing BroadcastReceivers for BOOT_COMPLETED can be
found at:

 http://commonsware.com/AdvAndroid/ 

(scroll down, download the "Source Code" from the link, and look for
SysEvents/OnBoot and SysServices/Alarm projects)

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

_The Busy Coder's Guide to *Advanced* Android Development_
Version 0.9 Available!



      
--~--~---------~--~----~------------~-------~--~----~



Re : How to catch BOOT_COMPLETED_ACTION from an IntentReceiver

by Mark Murphy » Wed, 24 Jun 2009 21:03:04 GMT


 


BOOT_COMPLETED must be received by a <receiver> element for a
BroadcatReceiver. You have no choice in the matter.

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

Android Development Wiki:  http://wiki.andmob.org 

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Task Manager in Android

> Um, please don't use private APIs like IActivityManager. :)  The

Hello hackbod,
I would like to find out how to get an instance of
android.app.ActivityManager from my code ?

PS: Could I clarify from my application how many another applications
were running recently ?

--~--~---------~--~----~------------~-------~--~----~

2. Creating a mock location provider

Hi,

On the Location-based Service APIs doc page, under Creating mock
LocationProviders, it's stated that:

One way to generate a suitable KML file is to get directions in Google
Earth. Right-click the "Route" entry that appears at the end of the
sequence of turns and select "Save as..." with "Save as type:" set to
"Kml *(*.kml)".

I did that, and called the file "kengps.kml".  (I've included the file
at the end of this message).

I put the file in the folder (in my Android project):

        /data/misc/location/myGPS

and restarted my project.  However, when I execute

LocationManager locationManager =
        (LocationManager) getSystemService(LOCATION_SERVICE);
List<LocationProvider> providerList = locationManager.getProviders();

the list providerList still only contains one element, the built-in
"gps" provider.

What am I missing here?
Thanks in advance,
Ken Bowen

====== The kengps.kml file ===========
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
        <name>kenRoute.kml</name>
        <Style id="roadStyle">
                <LineStyle>
                        <color>7fcf0064</color>
                        <width>6</width>
                </LineStyle>
        </Style>
        <Placemark>
                <name>Route</name>
                <visibility>0</visibility>
                <description><![CDATA[Distance: 0.7&#160;mi (about 4 
mins)<br/>Map
data &#169;2008 Tele Atlas]]></description>
                <styleUrl>#roadStyle</styleUrl>
                <MultiGeometry>
                        <LineString>
                                <coordinates>
-71.13088999999999,42.39704,0 -71.1309,42.3979,0 -71.1309,42.3979,0
-71.12641000000002,42.39394,0 -71.12641000000002,42.39394,0
-71.12313,42.39584,0 -71.12239,42.39622,0 -71.12239,42.39622,0
-71.12209,42.39565,0 </coordinates>
                        </LineString>
                </MultiGeometry>
        </Placemark>
</Document>
</kml>


--~--~---------~--~----~------------~-------~--~----~

3. Error no space left on device

4. Do we have any functionalities in Android to intercept calls and SMS

5. i try to catch an exeption in a thread but although it does throws the exeption the catch i planted did not cought it, why is that?

6. I want to Draw a image on image on x and y axis

7. sqlite and junit