ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î


[°³¹ß Tip] ºÎÆýà ¼­ºñ½º ½ÇÇàÇϱâ
8³â Àü
// BootDemoReceiver.java
package com.enea.training.bootdemo;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
* Simple receiver that will handle the boot completed intent and send the intent to
* launch the BootDemoService.
* @author BMB
*
*/
public class BootDemoReceiver extends BroadcastReceiver {
@Override
public void onReceive(final Context context, final Intent bootintent) {
  Intent mServiceIntent = new Intent();
mServiceIntent.setAction("com.enea.training.bootdemo.BootDemoService");
  context.startService(mServiceIntent);
}
}

// BootDemoService.java
package com.enea.training.bootdemo;

import java.util.Timer;
import java.util.TimerTask;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

/**
* Simple demo service that schedules a timer task to write something to
* the log at regular intervals.
* @author BMB
*
*/
public class BootDemoService extends Service {
/**
  * Delay until first exeution of the Log task.
  */
private final long mDelay = 0;
/**
  * Period of the Log task.
  */
private final long mPeriod = 500;
/**
  * Log tag for this service.
  */
private final String LOGTAG = "BootDemoService";
/**
  * Timer to schedule the service.
  */
private Timer mTimer;

/**
  * Implementation of the timer task.
  */
private class LogTask extends TimerTask {
  public void run() {
   Log.i(LOGTAG, "scheduled");
  }
}
private LogTask mLogTask;

@Override
public IBinder onBind(final Intent intent) {
  return null;
}

@Override
public void onCreate() {
  super.onCreate();
  Log.i(LOGTAG, "created");
  mTimer = new Timer();
  mLogTask = new LogTask();
}

@Override
public void onStart(final Intent intent, final int startId) {
  super.onStart(intent, startId);
  Log.i(LOGTAG, "started");
  mTimer.schedule(mLogTask, mDelay, mPeriod);
}
}
// AndroidManifest.xml
< ?xml version="1.0" encoding="utf-8"?>
< manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.enea.oresund.training.bootdemo"
      android:versionCode="1"
      android:versionName="1.0">
      < uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    < application android:icon="@drawable/icon" android:label="@string/app_name">
       < service android:name=".BootDemoService">
       < intent-filter>
       < action
       android:name = "com.enea.training.bootdemo.BootDemoService">
       < /action>
       < /intent-filter>
       < /service>
       < receiver android:name=".BootDemoReceiver">
       < intent-filter>
       < action
       android:name ="android.intent.action.BOOT_COMPLETED">
       < /action>
       < /intent-filter>
       < /receiver>
    < /application>
    < uses-sdk android:minSdkVersion="3" />
< /manifest>

http://androidenea.blogspot.com/2009/09/starting-android-service-after-boot.html
ÃßõÃßõ : 248 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
1,106
[Source] Åõ¸íÀ©µµ¿ì
1,105
[Source] WebView¸¦ ÀÌ¿ëÇؼ­, ÀÌÀü À¥ÆäÀÌÁö·Î À̵¿
1,104
[Source] ŸÀÌƲ¹ÙÀÇ ±ÛÀÚ»ö º¯°æ
1,103
[Source] Splash Screen
1,102
[Source] À̹ÌÁöÆÄÀÏ ´Ù¿î·Îµå
1,101
[Source] URLÀ» ÅëÇÑ À̹ÌÁö µå·ÎÀ×
1,100
[Source] PopupWindow »ç¿ë¿¹
1,099
[Source] WebView »ç¿ë¿¹ (loadUrl, loadData)
1,098
µ¿ÀûÀ¸·Î LinearLayout È­¸é¿¡ À̹ÌÁö Ãß°¡Çϱâ2
1,097
[Source] µ¿ÀûÀ¸·Î LinearLayout È­¸é¿¡ À̹ÌÁö Ãß°¡Çϱâ
1,096
[Source] Ä«¸Þ¶ó Á¦¾î
1,095
[Source] °£´ÜÇÑ MP3 Ç÷¹ÀÌ¾î ¿¹Á¦
1,094
[Source] Æù³» À½¾Ç ÆÄÀÏ ¸ñ·Ï Àоî¿À±â
1,093
[Source] MP3 ÆÄÀÏ ½ÇÇàÇϱâ
1,092
[android] ¹Ìµð¾î Ç÷¹À̾î·Î ¿Àµð¿À ºñµð¿À Àç»ýÇϱâ
1,091
µµ½º À©µµ ³×Æ®¿öÅ© ¸í·É¾î
1,090
[¾Èµå·ÎÀ̵å]ÆÄÀÏ ¿¬°á - Intent setDataAndType(Uri , MimeType)
1,089
±¸±Û °Ë»ö ÆÁ (±¸±Û¸µ, ±¸±Û °Ë»ö¹æ¹ý)
1,088
Windows 8 - Windows ±¸¼º ¿ä¼Ò ÀúÀå¼Ò¿¡¼­ ÆÄÀÏ ¼Õ»ó °Ë»ç
1,087
ÀÎÅÍ³Ý ÀͽºÇ÷η¯ 8 Á¤½Ä ´Ù¿î·Îµå
1,086
À©µµ¿ìÁî Windows 8, 8.1 ÀÇ ¹öÀüº° ei.cfg ÆÄÀÏ »ý¼ºÇÏ´Â ¹ý
1,085
Windows ¼³Ä¡ ÇÁ·Î±×·¥ ¹öÀü ±¸¼º ¹× Á¦Ç° ID ÆÄÀÏ(EI.cfg ¹× PID.txt)
1,084
ÀÌÁß ºÎÆà PC¿¡ ºÎÆà ¸Þ´º ¼³Á¤ ¶Ç´Â º¹±¸
1,083
ÆäÀ̽ººÏ µ¿¿µ»ó°ú À¯Æ©ºê µ¿¿µ»ó ´Ù¿î¹Þ´Â ¹æ¹ý
1,082
Å©·Ò(Chrome)¿¡¼­ DNS Áö¿ì±â - chrome dns flush
1,081
IE10, IE11 ¿¡¼­ Flash °¡ Á¤»óÀûÀ¸·Î ³ªÅ¸³ªÁö ¾ÊÀ» ¶§...
1,080
HTML5 ¾Ö´Ï¸ÞÀÌ¼Ç Á¦ÀÛ ÇÁ·Î±×·¥
1,079
¾µ¸¸ÇÑ jquery Ç÷¯±×ÀÎ
1,078
Windows ´ÜÃàÅ°
1,077
Internet ExplorerÀÇ ÀÛµ¿ÀÌ ÁßÁöµÇ¾ú½À´Ï´Ù-ÇØ°á ¹æ¹ý
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.