From the performance point of view: Is it fine if in every access to my cursors I use something like :
public static final String COLUMN_NAME = "my_column_name";
cursor.getString(cursor.getColumnIndex(COLUMN_NAME));
Or I should see a measurable improvement in performance if I use this instead:
public static final int COLUMN_POSITION = #column_position;
cursor.getString(COLUMN_POSITION);
I prefer the first approach since the rest of the code is not depending on the position of the columns in the query, but only on the name of the column.
Is worth sacrificing this for the "performance improvement" of accessing the cursor using constant positions instead?
i guess this has nothing to do with android. in SQLite, accessing column through index (column position) is supposed to be faster.