diff --git a/app/src/main/java/org/ntlab/amaryllis/client/Amaryllis.java b/app/src/main/java/org/ntlab/amaryllis/client/Amaryllis.java index 0566fbd..8a60f9c 100644 --- a/app/src/main/java/org/ntlab/amaryllis/client/Amaryllis.java +++ b/app/src/main/java/org/ntlab/amaryllis/client/Amaryllis.java @@ -1,16 +1,30 @@ package org.ntlab.amaryllis.client; import android.app.Application; +import android.content.Intent; import android.content.SharedPreferences; import android.location.Location; +import org.ntlab.amaryllis.client.entities.AmaryllisBackgroundService; +import org.ntlab.amaryllis.client.entities.PlayListListener; + +import java.util.ArrayList; + public class Amaryllis extends Application { private String token = null; private String uid = null; private String password=null; private String name = null; private Location location; - + private ArrayList playListListeners; + AmaryllisBackgroundService amaryllisbackgroundservice; + Amaryllis(){ + super(); + Intent intent=new Intent(this,amaryllisbackgroundservice.getClass()); + startService(intent); + amaryllisbackgroundservice=(AmaryllisBackgroundService)getApplicationContext(); + for(PlayListListener pl: playListListeners) amaryllisbackgroundservice.subscribe(pl); + } public void setUid(String uid) { SharedPreferences prefData = getSharedPreferences("pref_data", MODE_PRIVATE); SharedPreferences.Editor editor = prefData.edit(); @@ -78,8 +92,9 @@ return location; } - public void getBackgroundService(){ - + private ArrayList l; + public AmaryllisBackgroundService getBackgroundService() { + return amaryllisbackgroundservice; } }