Example #1
0
 /**
  * 更新APK下载点的信息
  *
  * @param info
  */
 public void updateInfos(DownloadAPK info) {
   String sql = "update download_info set compeleteload = ? where version = ? ";
   try {
     Object[] values = {info.getCompleteload(), info.getVersion()};
     database = pipiDBHelp.getWritableDatabase();
     database.execSQL(sql, values);
   } catch (Exception e) {
     // TODO: handle exception
   }
 }
Example #2
0
  /** 保存APK下载的断点的信息 */
  public void saveInfos(DownloadAPK info) {
    if (isDownload(info.getVersion())) deleteInfos(info.getVersion());
    try {
      String sql =
          "insert into download_info ( startpoint , endpoint , compeleteload , filesize , url , version , path ) values (?,?,?,?,?,?,?)";
      Object[] bindArgs = {
        info.getStartPoint(),
        info.getEndPoint(),
        info.getCompleteload(),
        info.getLoadFileSize(),
        info.getUrl(),
        info.getVersion(),
        info.getPath()
      };
      database = pipiDBHelp.getWritableDatabase();
      database.execSQL(sql, bindArgs);
    } catch (Exception e) {
      // TODO: handle exception

    }
  }