This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Heater { | |
fun on() | |
fun off() | |
fun isHot() : Boolean | |
} | |
class ElectricHeater(var heating: Boolean = false) : Heater { | |
override fun on() { | |
println("~ ~ ~ heating ~ ~ ~") | |
heating = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JobSchedulerSample { | |
private static final int JOB_ID_UPDATE = 0x1000; | |
static void setUpdateJob(Context context) { | |
// 대용량 데이터를 업데이트하기 위한 적정 조건 설정 | |
JobInfo job = | |
new JobInfo.Builder( | |
// Job에 설정할 Id 값 | |
JOB_ID_UPDATE, | |
// 조건 만족 시 UpdateDataByWiFiService가 실행 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.content.Intent; | |
import android.support.v4.app.JobIntentService; | |
import android.util.Log; | |
import android.widget.Toast; | |
import | |
/** | |
* Example implementation of a JobIntentService. | |
*/ | |
public class UpdateJobIntentService extends JobIntentService { |
OlderNewer