Android Open Source - mac-hopper App Singleton






From Project

Back to project page mac-hopper.

License

The source code is released under:

MIT License

If you think the Android project mac-hopper listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package uk.co.danhawkes.machopper;
//ww  w  . j  a va 2 s  .  c  o m
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import de.greenrobot.event.EventBus;

public class AppSingleton {

  private static Store store;
  private static AlarmUtils alarmUtils;
  private static SharedPreferences preferences;
  private static Logger logger;
  private static EventBus eventBus;

  public static void initialise(Context context) {
    AppSingleton.store = new Store(context);
    AppSingleton.alarmUtils = new AlarmUtils(context, store);
    AppSingleton.preferences = PreferenceManager.getDefaultSharedPreferences(context);
    AppSingleton.eventBus = new EventBus();
    AppSingleton.logger = new Logger(context, eventBus);
  }

  public static Store getStore() {
    return store;
  }

  public static AlarmUtils getAlarmUtils() {
    return alarmUtils;
  };

  public static SharedPreferences getPreferences() {
    return preferences;
  }

  public static Logger getLogger() {
    return logger;
  }

  public static EventBus getBus() {
    return eventBus;
  }
}




Java Source Code List

uk.co.danhawkes.machopper.AlarmUtils.java
uk.co.danhawkes.machopper.AppSingleton.java
uk.co.danhawkes.machopper.Application.java
uk.co.danhawkes.machopper.Logger.java
uk.co.danhawkes.machopper.Store.java
uk.co.danhawkes.machopper.mac.MacChangeBroadcastReceiver.java
uk.co.danhawkes.machopper.mac.MacUtils.java
uk.co.danhawkes.machopper.mac.Mac.java
uk.co.danhawkes.machopper.ui.CountdownFragment.java
uk.co.danhawkes.machopper.ui.HelpDialogFragment.java
uk.co.danhawkes.machopper.ui.LogFragment.java
uk.co.danhawkes.machopper.ui.MainActivity.java
uk.co.danhawkes.machopper.ui.preferences.ContactPreference.java
uk.co.danhawkes.machopper.ui.preferences.DonatePreference.java
uk.co.danhawkes.machopper.ui.preferences.PreferenceActivity.java
uk.co.danhawkes.machopper.ui.preferences.PreferenceFragment.java
uk.co.danhawkes.machopper.ui.preferences.TimePreference.java
uk.co.danhawkes.machopper.ui.preferences.UiUtils.java