<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Contentresolver on Haoxiqiang&#39;s Blog</title>
    <link>https://blog.substitute.tech/en/tags/contentresolver/</link>
    <description>Recent content in Contentresolver on Haoxiqiang&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Fri, 31 Mar 2017 11:19:26 +0000</lastBuildDate>
    <atom:link href="https://blog.substitute.tech/en/tags/contentresolver/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Android MediaStore: GROUP BY via ContentResolver</title>
      <link>https://blog.substitute.tech/en/posts/android%E7%9A%84mediastore/</link>
      <pubDate>Fri, 31 Mar 2017 11:19:26 +0000</pubDate>
      <guid>https://blog.substitute.tech/en/posts/android%E7%9A%84mediastore/</guid>
      <description>&lt;p&gt;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 &lt;code&gt;MediaStore&lt;/code&gt; approach proved most suitable. Since I hadn&amp;rsquo;t used it much before, this post serves as a record.&lt;/p&gt;
&lt;h2 id=&#34;the-group-by-hack-in-contentresolver&#34;&gt;The GROUP BY Hack in ContentResolver&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;ContentResolver.query()&lt;/code&gt; does not expose a &lt;code&gt;groupBy&lt;/code&gt; parameter (unlike &lt;code&gt;SQLiteQueryBuilder.query()&lt;/code&gt;), but you can achieve a similar effect by embedding &lt;code&gt;GROUP BY&lt;/code&gt; directly into the &lt;code&gt;selection&lt;/code&gt; argument.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
