/*
ApicAday - Everyday.. is different, your mood, your life.
Copyright (c) 2010
Oliver Selinger <oliver.selinger@autburst.com>,
Michael Greifeneder <michael.greifeneder@autburst.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.autburst.picture;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
public class UploadService extends Service {
public static final String ALBUM_NAME = "albumName";
//private SharedPreferences prefs;
//private String albumName;
@Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
String albumName = intent.getStringExtra(ALBUM_NAME);
Uploader uploader = new Uploader(this, (NotificationManager)getSystemService(NOTIFICATION_SERVICE), albumName, getSharedPreferences(Utilities.PIC_STORE, 0));
Thread thread = new Thread(uploader);
thread.start();
return super.onStartCommand(intent, flags, startId);
}
@Override
public IBinder onBind(Intent arg0) {
return binder;
}
private IBinder binder = new LocalBinder();
public class LocalBinder extends Binder {
Service getService() {
return UploadService.this;
}
}
}