| | 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<PlayListListener> 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(); |
---|
| | editor.putString("uid", uid); |
---|
| |
---|
| | public Location getLocation(){ |
---|
| | return location; |
---|
| | } |
---|
| | |
---|
| | public void getBackgroundService(){ |
---|
| | |
---|
| | private ArrayList<PlayListListener> l; |
---|
| | public AmaryllisBackgroundService getBackgroundService() { |
---|
| | return amaryllisbackgroundservice; |
---|
| | } |
---|
| | |
---|
| | } |
---|
| | |
---|
| | |