Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
swdev:android:database_sqlite [2018/04/30 09:39]
smayr
swdev:android:database_sqlite [2018/05/02 20:30] (current)
smayr [Database Utils]
Line 222: Line 222:
         //String selection = DbContract.TeamEntry.COL_NAME + " = ?";         //String selection = DbContract.TeamEntry.COL_NAME + " = ?";
         //String[] selectionArgs = { "My Team" };         //String[] selectionArgs = { "My Team" };
 +        String selection = null;         // no filters
 +        String[] selectionArgs = null;   // no filters
  
         // How you want the results sorted in the resulting Cursor         // How you want the results sorted in the resulting Cursor
Line 230: Line 232:
                 DbContract.TeamEntry.TABLE_NAME,   // The table to query                 DbContract.TeamEntry.TABLE_NAME,   // The table to query
                 projection,             // The array of columns to return (pass null to get all)                 projection,             // The array of columns to return (pass null to get all)
-                //selection,              // The columns for the WHERE clause +                selection,              // The columns for the WHERE clause 
-                null, +                selectionArgs,          // The values for the WHERE clause
-                //selectionArgs,          // The values for the WHERE clause +
-                null,+
                 null,                   // don't group the rows                 null,                   // don't group the rows
                 null,                   // don't filter by row groups                 null,                   // don't filter by row groups
Line 270: Line 270:
         //String selection = DbContract.TeamEntry.COL_NAME + " = ?";         //String selection = DbContract.TeamEntry.COL_NAME + " = ?";
         //String[] selectionArgs = { "My Team" };         //String[] selectionArgs = { "My Team" };
 +        String selection = null;         // no filters
 +        String[] selectionArgs = null;   // no filters
  
         // How you want the results sorted in the resulting Cursor         // How you want the results sorted in the resulting Cursor
Line 279: Line 281:
                 projection,             // The array of columns to return (pass null to get all)                 projection,             // The array of columns to return (pass null to get all)
                 //selection,              // The columns for the WHERE clause                 //selection,              // The columns for the WHERE clause
-                null, 
                 //selectionArgs,          // The values for the WHERE clause                 //selectionArgs,          // The values for the WHERE clause
-                null, 
                 null,                   // don't group the rows                 null,                   // don't group the rows
                 null,                   // don't filter by row groups                 null,                   // don't filter by row groups
Line 384: Line 384:
  
                 Intent showRubricActivity = new Intent(getApplicationContext(), RobotRubricActivity.class);                 Intent showRubricActivity = new Intent(getApplicationContext(), RobotRubricActivity.class);
-                showRubricActivity.putExtra("com.voirtech.roboticsleague.TEAM_ID", (position+1)+""); +                showRubricActivity.putExtra("com.acme.roboticsleague.TEAM_ID", (position+1)+""); 
-                showRubricActivity.putExtra("com.voirtech.roboticsleague.TEAM_INDEX", position);+                showRubricActivity.putExtra("com.acme.roboticsleague.TEAM_INDEX", position);
                 startActivity(showRubricActivity);                 startActivity(showRubricActivity);
             }             }
Line 495: Line 495:
   * [[https://developer.android.com/training/data-storage/sqlite|Data Storage: SQLite]]   * [[https://developer.android.com/training/data-storage/sqlite|Data Storage: SQLite]]
   * [[https://developer.android.com/training/data-storage/room|Data Storage: Room]]   * [[https://developer.android.com/training/data-storage/room|Data Storage: Room]]
 +  * [[https://dzone.com/articles/create-a-database-android-application-in-android-s|Create a database Android application]]