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. Do you have android projects for beginner

New to Android development? Start here. Open to any discussion around
beginner's questions; this is a great way to get up and running with
your new App on ...








Click the bellow link to continue€€€€.

***********************************************************
http://www.s1.webstarts.com/Technicalcommunication/

************************************************************

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

2. how to check if another application has been started

Hey guys, I'm trying to create an application where I need to check if
an application has been started. So for example, if the calendar was
clicked, before the calendar came up, my application would start up.
Is there any way to do this?

Cheers
--~--~---------~--~----~------------~-------~--~----~

3. Managing view's refresh delay and soft keyboard

4. Dialo

5. Problem running HelloWorld (or anny sample application)

6. ADT Plugin for Eclipse Source Code

7. How to add a keyboard localisation