Android Open Source - OpenCmsMobile-AndroidApp Config






From Project

Back to project page OpenCmsMobile-AndroidApp.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project OpenCmsMobile-AndroidApp 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 cz.nelasoft.opencms.mobile;
//from  ww w  .  j  a  v  a  2  s . c  om
import java.util.Properties;

import org.json.JSONException;
import org.json.JSONObject;

import android.content.res.Resources;

public class Config {

  private static String configUrl;
  private static String configContext;
  private static int splashDisplayLength;

  private static String defaultConfigJson = "";

  private static JSONObject mainConfig;

  public static void initConfig(Resources resources) throws Exception {
    Properties prop = new Properties();
    prop.load(resources.openRawResource(R.raw.config));
    configUrl = prop.getProperty("configUrl");
    configContext = prop.getProperty("configContext");
    splashDisplayLength = Integer.parseInt(prop.getProperty("splashDisplayLength"));
  }

  public static JSONObject getMainConfig() {
    return mainConfig;
  }

  public static String getConfigUrl() {
    return configUrl;
  }

  public static String getConfigContext() {
    return configContext;
  }

  public static String getDefaultConfigJson() {
    return defaultConfigJson;
  }

  public static int getSplashDisplayLength() {
    return splashDisplayLength;
  }

  public static void setDefaultConfigJson(String defaultConfigJson) throws JSONException {
    mainConfig = new JSONObject(defaultConfigJson);
    mainConfig.getJSONObject("MobileApplication");
  }
}




Java Source Code List

cz.nelasoft.opencms.mobile.Config.java
cz.nelasoft.opencms.mobile.ContactsFragment.java
cz.nelasoft.opencms.mobile.DownloadManager.java
cz.nelasoft.opencms.mobile.EventAdapter.java
cz.nelasoft.opencms.mobile.EventDetailActivity.java
cz.nelasoft.opencms.mobile.EventFragment.java
cz.nelasoft.opencms.mobile.Event.java
cz.nelasoft.opencms.mobile.FileCache.java
cz.nelasoft.opencms.mobile.IRefreshFragment.java
cz.nelasoft.opencms.mobile.ImageLoader.java
cz.nelasoft.opencms.mobile.MainActivity.java
cz.nelasoft.opencms.mobile.MemoryCache.java
cz.nelasoft.opencms.mobile.NewsAdapter.java
cz.nelasoft.opencms.mobile.NewsDetailActivity.java
cz.nelasoft.opencms.mobile.NewsFragment.java
cz.nelasoft.opencms.mobile.News.java
cz.nelasoft.opencms.mobile.SplashActivity.java
cz.nelasoft.opencms.mobile.StyleableSpannableStringBuilder.java
cz.nelasoft.opencms.mobile.WebContentFragment.java