views:

20

answers:

1

I'm creating a method that will see if a column in a database row is populated; and if so, it returns the varchar in that row, else it calls a web service to return that data.

My question is: What is the standard way of simply selecting a column with Android? (select mycolumn from mytable where _id = x;)

I've created a ContentProvider around my database. Should I just call 'query' directly? Note: This method is in a Service

+1  A: 

you just need to mess with the selection argument in the query

String selection = MyDatabaseConstants.ID " = " + String.valueOf(x);
Cursor c = getContentResolver().query(MyDatabaseConstants.Content_URI,MyDatabaseConstants.Proj, selection,null,null,null);
schwiz
Ok. That's what I figured, but I wanted to make sure. Thank you
Andrew