Ejemplo n.º 1
0
  boolean onlySingleExpansionFileFound() {
    for (OBBData.XAPKFile xf : OBBData.xAPKS) {
      String fileName = Helpers.getExpansionAPKFileName(this, xf.mIsMain, xf.mFileVersion);
      GameActivity.Log.debug("Checking for file : " + fileName);
      String fileForNewFile = Helpers.generateSaveFileName(this, fileName);
      String fileForDevFile = Helpers.generateSaveFileNameDevelopment(this, fileName);

      if (Helpers.doesFileExist(this, fileName, xf.mFileSize, false)
          && Helpers.doesFileExistDev(this, fileName, xf.mFileSize, false)) return false;
    }

    return true;
  }
Ejemplo n.º 2
0
  /**
   * Go through each of the APK Expansion files defined in the structure above and determine if the
   * files are present and match the required size. Free applications should definitely consider
   * doing this, as this allows the application to be launched for the first time without having a
   * network connection present. Paid applications that use LVL should probably do at least one LVL
   * check that requires the network to be present, so this is not as necessary.
   *
   * @return true if they are present.
   */
  boolean expansionFilesDelivered() {

    for (OBBData.XAPKFile xf : OBBData.xAPKS) {
      String fileName = Helpers.getExpansionAPKFileName(this, xf.mIsMain, xf.mFileVersion);
      GameActivity.Log.debug("Checking for file : " + fileName);
      String fileForNewFile = Helpers.generateSaveFileName(this, fileName);
      String fileForDevFile = Helpers.generateSaveFileNameDevelopment(this, fileName);
      GameActivity.Log.debug(
          "which is really being resolved to : " + fileForNewFile + "\n Or : " + fileForDevFile);
      if (!Helpers.doesFileExist(this, fileName, xf.mFileSize, false)
          && !Helpers.doesFileExistDev(this, fileName, xf.mFileSize, false)) return false;
    }
    return true;
  }