Android Can I use JOIN in a mediastore request

Is there any method for using the connection in the request in the mediastar data?

Or is there also some method of accessing media data through a database rather than with a content provider?

Thanks.

+2
source share
2 answers

But I think that you can use associations with content providers. If you complete two queries, you can join them using CursorJoiner. I use it and it works well.

Snapshot from Android docs:

CursorJoiner joiner = new CursorJoiner(cursorA, keyColumnsofA, cursorB, keyColumnsofB); for (CursorJointer.Result joinerResult : joiner) { switch (joinerResult) { case LEFT: // handle case where a row in cursorA is unique break; case RIGHT: // handle case where a row in cursorB is unique break; case BOTH: // handle case where a row with the same key is in both cursors break; } } 

this is not exactly the same as the SQL join, but it is useful. In each case, you can manipulate both cursors that point to the processed line.

+3
source

Is there any method for using a connection in a mediastore data request?

With content provider requests, there may not be JOINs.

Or is there also some method of accessing media data through a database rather than with a content provider?

Only if you write your own firmware.

+3
source

Source: https://habr.com/ru/post/1232273/


All Articles