Android MediaStore: GROUP BY via ContentResolver

When building a photo album feature similar to WeChat, I needed to read photos and videos with multi-folder switching — and it had to be faster than WeChat. After some research, the MediaStore approach proved most suitable. Since I hadn’t used it much before, this post serves as a record. The GROUP BY Hack in ContentResolver ContentResolver.query() does not expose a groupBy parameter (unlike SQLiteQueryBuilder.query()), but you can achieve a similar effect by embedding GROUP BY directly into the selection argument. ...

March 31, 2017 · 2 min · haoxiqiang