views:

297

answers:

2

I am trying to find out the best way to do a simple table join on my two tables using a sqlite database in an android application. Is the simplest way to use CursorJoiner or is there any easier way?

+2  A: 

Better to do this in SQL. Create a VIEW with necessary JOINs.

alex
I tried to do that but had problems getting my project to recognize it for some reason.
Cptcecil
+2  A: 

In the implementation of SQLiteDatabase and SQLiteQueryBuilder you will see that it is possible to pass the tables you want to join to the table argument of query even though the documentation implies it will only take a single name of a table. The documentation for SQLiteQueryBuilder is more clear and even suggests things like foo, bar or foo LEFT OUTER JOIN bar ON (foo.id = bar.foo_id).

Tim Kryger