Skip to content

Instantly share code, notes, and snippets.

View cwdoh's full-sized avatar

Changwook Doh cwdoh

View GitHub Profile
@cwdoh
cwdoh / SyncJobService.java
Last active June 26, 2017 08:35
Scaffolding JobService
package com.example.android.jobscheduler.service;
import android.app.job.JobParameters;
import android.app.job.JobService;
import android.content.Intent;
public class SyncJobService extends JobService {
ArtworkDownloader mDownloader;
@Override
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 {
interface Heater {
fun on()
fun off()
fun isHot() : Boolean
}
class ElectricHeater(var heating: Boolean = false) : Heater {
override fun on() {
println("~ ~ ~ heating ~ ~ ~")
heating = true