Android Open Source - AGOGCyberStat My Prefs






From Project

Back to project page AGOGCyberStat.

License

The source code is released under:

MIT License

If you think the Android project AGOGCyberStat 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 com.agog.cyberstat;
/*from w  w w. j a  v  a 2  s.  c  o  m*/
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class MyPrefs {
  private static SharedPreferences sSettings;
  private static SharedPreferences.Editor sEditor;

  public static void init(Context context) {
    sSettings = PreferenceManager.getDefaultSharedPreferences(context);
  }
  
  @SuppressLint("CommitPrefEdits")
  public static void putString(String key,String value)
  {
    if(sEditor == null) {
      sEditor = sSettings.edit();      
    }
    sEditor.putString(key,value);
  }

  @SuppressLint("CommitPrefEdits")
  public static void putBoolean(String key,Boolean value)
  {
    if(sEditor == null) {
      sEditor = sSettings.edit();      
    }
    sEditor.putBoolean(key,value);
  }

  public static void commit()
  {
    if(sEditor == null) {
      sEditor = sSettings.edit();      
    }
    sEditor.commit();
  }

  public static String getString(String key,String d)
  {
    return(sSettings.getString(key,d));
  }

  public static Boolean getBoolean(String key,Boolean d)
  {
    return(sSettings.getBoolean(key,d));
  }

  
}




Java Source Code List

com.agog.cyberstat.BrR.java
com.agog.cyberstat.JSONSettings.java
com.agog.cyberstat.MainActivity.java
com.agog.cyberstat.MotisonNetTask.java
com.agog.cyberstat.MotisonXML.java
com.agog.cyberstat.MyPrefs.java
com.agog.cyberstat.NetR.java
com.agog.cyberstat.Trigger.java
me.allenz.androidapplog.AbstractAppender.java
me.allenz.androidapplog.AbstractLogger.java
me.allenz.androidapplog.AppenderSupportLogger.java
me.allenz.androidapplog.Appender.java
me.allenz.androidapplog.AsyncAppender.java
me.allenz.androidapplog.Configure.java
me.allenz.androidapplog.InternalLogger.java
me.allenz.androidapplog.LogCatAppender.java
me.allenz.androidapplog.LogEvent.java
me.allenz.androidapplog.LogLevel.java
me.allenz.androidapplog.LogTextView.java
me.allenz.androidapplog.LoggerConfig.java
me.allenz.androidapplog.LoggerFactory.java
me.allenz.androidapplog.Logger.java
me.allenz.androidapplog.PropertiesParser.java
me.allenz.androidapplog.ReflectUtils.java
me.allenz.androidapplog.Repository.java
me.allenz.androidapplog.RollingFileAppender.java
me.allenz.androidapplog.TextViewAppender.java