コード例 #1
0
  private void createTableWorkItems(SQLiteDatabase db) {
    String sql = WorkItemConstants.CREATE_TABLE;
    if (Log.isLoggable(TAG, Log.VERBOSE)) {
      Log.v(TAG, "createTableWorkItems : sql=" + sql);
    }
    db.execSQL(sql);

    DateTime now = new DateTime(DateTimeZone.UTC);
    db.execSQL(
        WorkItemConstants.INSERT_ROW,
        new Object[] {
          "Refresh Shows",
          WorkItemConstants.Frequency.DAILY,
          WorkItemConstants.Download.JSONARRAY,
          EndpointConstants.Type.OVERVIEW.name(),
          EndpointConstants.OVERVIEW,
          "",
          "",
          -1,
          WorkItemConstants.Status.NEVER.name(),
          now.getMillis()
        });
    db.execSQL(
        WorkItemConstants.INSERT_ROW,
        new Object[] {
          "Refresh Events",
          WorkItemConstants.Frequency.DAILY,
          WorkItemConstants.Download.JSON,
          EndpointConstants.Type.EVENTS.name(),
          EndpointConstants.EVENTS,
          "",
          "",
          -1,
          WorkItemConstants.Status.NEVER.name(),
          now.getMillis()
        });
    db.execSQL(
        WorkItemConstants.INSERT_ROW,
        new Object[] {
          "Refresh Broadcasting",
          WorkItemConstants.Frequency.HOURLY,
          WorkItemConstants.Download.JSON,
          EndpointConstants.Type.LIVE.name(),
          EndpointConstants.LIVE,
          "",
          "",
          -1,
          WorkItemConstants.Status.NEVER.name(),
          now.getMillis()
        });
    //        db.execSQL( WorkItemConstants.INSERT_ROW, new Object[] { "Refresh Recent Episodes",
    // WorkItemConstants.Frequency.HOURLY, WorkItemConstants.Download.JSONARRAY,
    // EndpointConstants.Type.RECENT.name(), EndpointConstants.RECENT, "", "", -1,
    // WorkItemConstants.Status.NEVER.name(), now.getMillis() } );
    db.execSQL(
        WorkItemConstants.INSERT_ROW,
        new Object[] {
          "Refresh Youtube Episodes",
          WorkItemConstants.Frequency.DAILY,
          WorkItemConstants.Download.JSON,
          EndpointConstants.Type.YOUTUBE.name(),
          EndpointConstants.YOUTUBE,
          "",
          "",
          -1,
          WorkItemConstants.Status.NEVER.name(),
          now.getMillis()
        });
  }
コード例 #2
0
  private void createTableEndpoints(SQLiteDatabase db) {
    String sql = EndpointConstants.CREATE_TABLE;
    if (Log.isLoggable(TAG, Log.VERBOSE)) {
      Log.v(TAG, "createTableEndpoints : sql=" + sql);
    }
    db.execSQL(sql);

    DateTime now = new DateTime(DateTimeZone.UTC);
    db.execSQL(
        EndpointConstants.INSERT_ROW,
        new Object[] {
          EndpointConstants.Type.EVENTS.name(),
          EndpointConstants.EVENTS,
          EndpointConstants.DownloadType.ARRAY.name(),
          "",
          now.getMillis()
        });
    db.execSQL(
        EndpointConstants.INSERT_ROW,
        new Object[] {
          EndpointConstants.Type.LIVE.name(),
          EndpointConstants.LIVE,
          EndpointConstants.DownloadType.OBJECT.name(),
          "",
          now.getMillis()
        });
    db.execSQL(
        EndpointConstants.INSERT_ROW,
        new Object[] {
          EndpointConstants.Type.DETAILS.name(),
          EndpointConstants.DETAILS,
          EndpointConstants.DownloadType.OBJECT.name(),
          "",
          now.getMillis()
        });
    db.execSQL(
        EndpointConstants.INSERT_ROW,
        new Object[] {
          EndpointConstants.Type.RECENT.name(),
          EndpointConstants.RECENT,
          EndpointConstants.DownloadType.ARRAY.name(),
          "",
          now.getMillis()
        });
    db.execSQL(
        EndpointConstants.INSERT_ROW,
        new Object[] {
          EndpointConstants.Type.OVERVIEW.name(),
          EndpointConstants.OVERVIEW,
          EndpointConstants.DownloadType.ARRAY.name(),
          "",
          now.getMillis()
        });
    db.execSQL(
        EndpointConstants.INSERT_ROW,
        new Object[] {
          EndpointConstants.Type.LIST.name(),
          EndpointConstants.LIST,
          EndpointConstants.DownloadType.ARRAY.name(),
          "",
          now.getMillis()
        });
    db.execSQL(
        EndpointConstants.INSERT_ROW,
        new Object[] {
          EndpointConstants.Type.YOUTUBE.name(),
          EndpointConstants.YOUTUBE,
          EndpointConstants.DownloadType.OBJECT.name(),
          "",
          now.getMillis()
        });
  }