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. (WTB) Spica & galaxy 5 second

Selamat siang,

As subject, saya mau beli Spica second & galaxy 5 second titipan 2
ekor teman yang udh mulai keracunan n pengen icip2 android.
Kalau para bos, juragan, suhu2 di sini ada yang mau jual salah satu
atau keduanya dgn kondisi :
- spica 2nd hitam
- galaxy 5 2nd warna apa saja
- kondisi lengkap,sehat, mulus, bohay. Bisa yang rooted atau masih
prawan
- khusus wilayah jakarta aja, sehingga saya bisa CoD ( barang dianter
ke rumah saya/ragunan) atau CaC ( jemput barang/ketemuan),
mohon japri-nya ke a...@visualfighter.com atau ke
cr.visualfigh...@gmail.com

Terima kasih

-afif-

-- 
===============
"

2. Salam Kenal & Salam Jabat Erat

Dear Bro & Sis

Salam kenal & salam jabat erat.

Perkenankan memperkenalkan diri. Saya Achmad Falatehan nubie dibidang android 
dan belom punya android :D

Nyemplung ke sini hendak meracuni diri sebelum membeli android... Hehehe...

Mohon kepada para master memberikan ilmunya.

Salam
AchmadF
Sent from my BlackBerry smartphone from Sinyal Bagus XL, Nyambung Teruuusss...!

-- 
===============
"

3. SDK Samples - API Level 6 and below: Where to find them?

4. request

5. Migrasi sms

6. ada yang demen Foodspotting gak?

7. Compatibility across versions