am trying to start my service on device boot up.

by Wojciech Topolski » Wed, 21 Jul 2010 18:05:08 GMT


Sponsored Links
 i

Below is my code. Maybe you find something interesting...

*manifest file:::*
<receiver android:enabled="true"
android:name=".broadcastreceiver.BootCompletedBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"
/>
</intent-filter>
</receiver>

<service android:name=".service.MonitoringService">
<intent-filter>
<action android:name="your.package.name.MonitoringService"
/>
</intent-filter>
</service>

*Broadcast reciever*:::

@Override
public void onReceive(Context context, Intent intent) {
// Start service.
Intent serviceIntent = new Intent(context,
MonitoringService.class);
serviceIntent.putExtra(something, something);
context.startService(serviceIntent);
}

But remember! If you deploy app on running emulator don't expect to see your
"BootCompletedBroadcastReceiver" in action. First: deploy your app. Second:
close emulator. Third: run emulator with command: emulator -avd
your_emulator_name

2010/7/21 A N K ! T <ankit.awasth...@gmail.com>

>



am trying to start my service on device boot up.

by mac-systems » Wed, 21 Jul 2010 19:10:45 GMT


 Add:

        <uses-permission
                android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

To you Manifest

--


Sponsored Links


Other Threads

1. OMX AAC Decoding on Hardware

Are you sure those 2 bytes aren't the AudioSpecificConfig()?  It is
not unusual for the AAC AudioSpecificConfig() to be 2 bytes.  Have you
tried manually checking those first 2 bytes against the syntax defined
in the ISO/IEC document?











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

2. ServiceManager( 472): error in addService

> I/SystemServer(  472): Starting Power Manager.

Smells like the binder driver.

Please only post your messages once to the group.

Nick

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. MediaStore.Images.Media.INTERNA L_CONTENT篓_URI

4. Working on an FAQ that includes a list of ports. Wondering if I have them all listed.

5. wpa_supplicaent

6. Android x86 Port

7. ServiceManager( 472): error in addService