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


[°³¹ß 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
ÃßõÃßõ : 250 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
1,136
Android VideoView Example
1,135
[°³¹ß Tip] WebView ·Îµù½Ã ŸÀÌƲ¹Ù¿¡ ÁøÇàÁß ¾ÆÀÌÄÜ º¸ÀÌ°Ô Çϱâ
1,134
[°³¹ß Tip] webview ½ºÅ©·Ñ
1,133
[°³¹ß Tip] WebView ¿¡¼­ ÀÚ¹Ù ½ºÅ©¸³Æ® »ç¿ë¿¹
1,132
[°³¹ß Tip] WebView À¥ÆäÀÌÁö ·Îµù½Ã°£ ±¸Çϱâ
1,131
[°³¹ß Tip] WebView ÆäÀÌÁö°¡ ·ÎµùµÇ¾úÀ»¶§ ó¸®
1,130
[°³¹ß Tip] WebView¿¡ »õâ(href)ÀÌ ¶ã¶§ À¥ºê¶ó¿ìÁ®°¡ ¾Æ´Ñ ÇöÀç WebView·Î Ãâ·ÂÇϱâ
1,129
[°³¹ß Tip] WebView¿¡¼­ ¸ÖƼ ÅÍÄ¡ °¡´ÉÇÏ°Ô Çϱâ
1,128
[°³¹ß Tip] WebView¿¡¼­ ¸ÖƼ ÅÍÄ¡ ÁÜ °¡´ÉÇÏ°Ô Çϱâ
1,127
[°³¹ß Tip] WebView¿¡¼­ ¹®ÀÚ¿­ ¼±ÅÃÇϱâ
1,126
[°³¹ß Tip] webview¿¡¼­ À¯Æ©ºê µ¿ÀÛ½ÃÅ°±â
1,125
[°³¹ß Tip] Wifi ¿¬°á »óÅ °¨ÁöÇϱâ
1,124
[°³¹ß Tip] ³»ÀåµÈ ¾îÇ÷ΠSMS ¸Þ½ÃÁö º¸³»±â
1,123
[°³¹ß Tip] ´Ü¸»±â Æù¹øÈ£ ¾Ë¾Æ³»±â
1,122
[°³¹ß Tip] ¸®¼Ò½º¸íÀ¸·Î ÇØ´ç ¸®¼Ò½º ID ±¸Çϱâ
1,121
[°³¹ß Tip] ¸ÖƼÅÍÄ¡ (Multi Touch) ±¸Çö ¼Ò½º
[°³¹ß Tip] ºÎÆýà ¼­ºñ½º ½ÇÇàÇϱâ
1,119
[°³¹ß Tip] ¾Èµå·ÎÀÌµå ±â±âº° °íÀ¯ ID
1,118
[°³¹ß Tip] ¾ÈÅ׳ª ¿µ¿ª ¾ø¾Ö±â
1,117
[°³¹ß Tip] ¾×Ƽ¹öƼ(Activity)¿¡¼­ ¾Ö´Ï¸ÞÀÌ¼Ç È¿°úÁÖ±â
1,116
[°³¹ß Tip] ¾×Ƽ¹öƼÀÇ Å¸ÀÌƲ¹Ù Á¦°Å, ¾ÈÅ׳ª ¿µ¿ª±îÁö Á¦°Å
1,115
[°³¹ß Tip] ¿Àµð¿À / ºñµð¿À ½ÇÇà
1,114
[°³¹ß Tip] ÀüÈ­°¡ ¿ÔÀ»¶§ À̺¥Æ® ¼ö½ÅÇϱâ
1,113
[°³¹ß Tip] ÆÄÀÏ(File) »ç¿ë
1,112
[°³¹ß Tip] Æù ¸¶ÀÌÅ©¿¡ ³ìÀ½Çϱâ
1,111
[°³¹ß Tip] ÇØ´ç ActionÀ» ¼öÇàÇÒ¼ö°¡ ÀÖ´Â ¾×Ƽ¹öƼ(¾îÇÃ)ÀÌ Á¸ÀçÇÏ´ÂÁö ã±â
1,110
[°³¹ß Tip] ÇöÀç µð¹ÙÀ̽º(Æù)ÀÇ IP ÁÖ¼Ò ¾Ë¾Æ³»±â
1,109
[°³¹ß Tip] XmlPullParser¸¦ ÀÌ¿ëÇؼ­ rss³» title Ç׸ñ Àбâ
1,108
[°³¹ß Tip] ÇöÀç ¿¬ÁÖÁßÀÎ ¿Àµð¿À ¾îÇÃÀ» À½¼Ò°Å Çϱâ
1,107
[°³¹ß Tip] È­¸é »ó´ÜÀÇ Å¸ÀÌƲ¹Ù (»óŹ٠°¨Ãß±â)
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.