title: How to query android call log data with group by date
body: <p>I am querying call dates in call log database in android phone. After reading some articles, they said this needs to make some injection in my query method like this.</p>
  
  <pre><code>Cursor cursor = activity.getContentResolver().query(
                      CallLog.Calls.CONTENT_URI,
                      new String[] { CallLog.Calls.DATE},
                      "" + ") GROUP BY (" + CallLog.Calls.DATE,
                      null, CallLog.Calls.DATE + " DESC");
  </code></pre>
  
  <p>When I run my app and I got the following error message.</p>
  
  <pre><code>near ")": syntax error (code 1): , while compiling: SELECT date FROM calls WHERE ((() GROUP BY (date) AND ((type != 4)))) ORDER BY date DESC
  </code></pre>
  
  <p>Actually, I can't figure out how this query was built and why ((type !=4)) filter was appended to GROUP BY clause. I am currently using (compileSdkVersion 19, minSdkVersion 10 and targetSdkVersion 19). Is there any way to make raw query to Call Log Database because I want to write the query with my own to group dates.</p>