// Define the projection (columns to be fetched) String[] projection = { "id", "name", "age" }; // Fetch data using query Cursor cursor = db.query( "employee", projection, null, null, null, null, null ); // Get the number of columns in the cursor result set int columnCount = cursor.getColumnCount();In this code snippet, we use the getColumnCount method to get the number of columns in the cursor result set. Package library: The android.database.Cursor class is part of the Android SDK and is included in the android.database package.