@@ -0,0 +1,2072 @@
+package com.littlepanpc.download.services;%0A%0Aimport com.littlepanpc.download.aidl.IDownloadService;%0A%0Aimport android.app.Service;%0Aimport android.content.Intent;%0Aimport android.os.IBinder;%0Aimport android.os.RemoteException;%0Aimport android.util.Log;%0A%0Apublic class DownloadService extends Service %7B%0A%09private static final String TAG = DownloadService.class.getName();%0A%09private DownloadManager mDownloadManager;%0A%0A%09@Override%0A%09public IBinder onBind(Intent intent) %7B%0A%09%09Log.i(TAG, %22onBind%22);%0A%09%09return new DownloadServiceBinder();%0A%09%7D%0A%0A%09@Override%0A%09public void onCreate() %7B%0A%09%09Log.i(TAG, %22onCreate%22);%0A%09%09super.onCreate();%0A%09%09mDownloadManager = new DownloadManager(this);%0A%09%7D%0A%0A%09public class DownloadServiceBinder extends IDownloadService.Stub %7B%0A%09%09private final String TAG2 = DownloadServiceBinder.class.getName();%0A%0A%09%09@Override%0A%09%09public void startManage() throws RemoteException %7B%0A%09%09%09Log.i(TAG2, %22startManage%22);%0A%09%09%09mDownloadManager.startManage();%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public void addTask(String url) throws RemoteException %7B%0A%09%09%09Log.i(TAG2, %22addTask%22);%0A%09%09%09mDownloadManager.addTask(url);%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public void pauseTask(String url) throws RemoteException %7B%0A%09%09%09Log.i(TAG2, %22pauseTask%22);%0A%09%09%09mDownloadManager.pauseTask(url);%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public void deleteTask(String url) throws RemoteException %7B%0A%09%09%09Log.i(TAG2, %22deleteTask%22);%0A%09%09%09mDownloadManager.deleteTask(url);%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public void continueTask(String url) throws RemoteException %7B%0A%09%09%09Log.i(TAG2, %22continueTask%22);%0A%09%09%09mDownloadManager.continueTask(url);%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public void pauseAllTask() throws RemoteException %7B%0A%09%09%09Log.i(TAG2, %22pauseAllTask%22);%0A%09%09%09mDownloadManager.pauseAllTask();%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public void resumeAllTask() throws RemoteException %7B%0A%09%09%09Log.i(TAG2, %22resumeAllTask%22);%0A%09%09%09mDownloadManager.resumeAllTask();%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public void deleteAllTask() throws RemoteException %7B%0A%09%09%09Log.i(TAG2, %22deleteAllTask%22);%0A%09%09%09mDownloadManager.deleteAllTask();%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public void finish() throws RemoteException %7B%0A%09%09%09// TODO Auto-generated method stub%0A%09%09%09mDownloadManager.finish();%0A%09%09%7D%0A%0A%09%7D%0A%0A%7D%0A

Create DownloadService.java