package com.mick88.dittimetable;

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

public class PdfDownloaderService extends Service
{
	public PdfDownloaderService() {
	}

	@Override
	public IBinder onBind(Intent intent)
	{
		// TODO: Return the communication channel to the service.
		throw new UnsupportedOperationException("Not yet implemented");
	}
}

@@ -27,16 +27,69 @@
 table;%0A%0A
+import com.mick88.dittimetable.timetable.Timetable;%0A%0A
 import a
@@ -108,16 +108,16 @@
 ervice;%0A
-
 import a
@@ -139,16 +139,45 @@
 Intent;%0A
+import android.os.AsyncTask;%0A
 import a
@@ -260,37 +260,244 @@
 lic 
-PdfDownloaderService() %7B
+static final String EXTRA_TIMETABLE = %22timetable%22;%0A%09%0A%09%0A%09@Override%0A%09public int onStartCommand(Intent intent, int flags, int startId)%0A%09%7B%0A%09%09downloadPdf((Timetable) intent.getSerializableExtra(EXTRA_TIMETABLE));%0A%09%09return START_STICKY;
 %0A%09%7D%0A
+%09
 %0A
-
 %09@Ov
@@ -604,16 +604,16 @@
 ervice.%0A
-
 %09%09throw 
@@ -673,10 +673,404 @@
 d%22);%0A%09%7D%0A
+%09%0A%09private void downloadPdf(Timetable timetable)%0A%09%7B%0A%09%09new AsyncTask%3CTimetable, Void, Void%3E()%0A%09%09%7B%0A%0A%09%09%09@Override%0A%09%09%09protected Void doInBackground(Timetable... params)%0A%09%09%09%7B%0A%09%09%09%09Timetable timetable = params%5B0%5D;%0A%09%09%09%09String url = timetable.getPdfUrl();%0A%09%09%09%09%0A%09%09%09%09return null;%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09@Override%0A%09%09%09protected void onPostExecute(Void result) %0A%09%09%09%7B%0A%09%09%09%09stopSelf();%0A%09%09%09%7D%0A%09%09%09%0A%09%09%7D.execute(timetable);%0A%09%7D%0A
 %7D%0A

implement service to fetch pdf url async