コード例 #1
0
  /** 读取系统配置信息 */
  private static void readSystemConfig() {
    File file = new File(sAppRootDirPath, SYS_CONFIG_FILE_NAME);
    if (!file.exists()) {
      systemConfigInfo = null;
      return;
    }
    String systemConfigJson = FileUtil.readFileFromSDCard(sAppRootDirPath, SYS_CONFIG_FILE_NAME);

    Gson gson = new Gson();
    systemConfigInfo = gson.fromJson(systemConfigJson, SystemConfigInfo.class);
  }
コード例 #2
0
  /**
   * 读取用户配置信息
   *
   * @return void
   */
  private static void readUserConfig() {
    File file = new File(sCurrentUserConfigPath, USER_CONFIG_FILE_NAME);
    if (!file.exists()) {
      userConfigInfo = null;
      return;
    }

    String userConfigJson =
        FileUtil.readFileFromSDCard(sCurrentUserConfigPath, USER_CONFIG_FILE_NAME);

    Gson gson = new Gson();
    userConfigInfo = gson.fromJson(userConfigJson, UserConfigInfo.class);
  }