<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Accessing the internal calendar database inside Google Android applications</title>
	<atom:link href="http://jimblackler.net/blog/?feed=rss2&#038;p=151" rel="self" type="application/rss+xml" />
	<link>http://jimblackler.net/blog/?p=151</link>
	<description>planet of the apps</description>
	<lastBuildDate>Tue, 09 Apr 2013 08:08:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Android 自动静音程序 Auto Silent Pro - 手机开发网</title>
		<link>http://jimblackler.net/blog/?p=151&#038;cpage=2#comment-126103</link>
		<dc:creator>Android 自动静音程序 Auto Silent Pro - 手机开发网</dc:creator>
		<pubDate>Wed, 30 Jan 2013 12:56:41 +0000</pubDate>
		<guid isPermaLink="false">http://jimblackler.net/blog/?p=151#comment-126103</guid>
		<description>[...] 获取 Google Calendar 的数据不像获取联系人和短信等数据那样，官方有文档，而这是官方不支持的。于是我就在网上查了很久，最后终于查到一个比较靠谱的，http://jimblackler.net/blog/?p=151，这网页上面写得很清楚，我就不粘贴代码了，唯一注意的是一定要添加android.permission.READ_CALENDAR 在 AndroidManifest.xml 里。不过想起来，有的日程事件不是上课，就没有必要设默认静音。然后我就想到 Google Calendar 在新建每个 event 的时候，都会有两个选择，Busy 和 Available。如果选Busy 的时候，就表示你很忙，需要静音，选 Available 的时候，就表示不需要静音，这样岂不是很好？但是，这个 Busy 和 Available 具体又对应 Google Calendar 的数据库的哪个字段呢？然后我看了看 android.provider 里面的 Calendar.java 源码，源码里面有一个字段的注释让我觉得有点靠谱，“transparency”，注释是：Transparency for the event&#8211; does the event consume time on the calendar?，嗯，就是它了。后来我有点不确定，自己实际试了试，新建两个 event，一个选 Busy，一个选Available，然后用 Root Explorer 实际看这两个 event 的 transparency 字段值，发现就是这个字段。OK！ [...]</description>
		<content:encoded><![CDATA[<p>[...] 获取 Google Calendar 的数据不像获取联系人和短信等数据那样，官方有文档，而这是官方不支持的。于是我就在网上查了很久，最后终于查到一个比较靠谱的，http://jimblackler.net/blog/?p=151，这网页上面写得很清楚，我就不粘贴代码了，唯一注意的是一定要添加android.permission.READ_CALENDAR 在 AndroidManifest.xml 里。不过想起来，有的日程事件不是上课，就没有必要设默认静音。然后我就想到 Google Calendar 在新建每个 event 的时候，都会有两个选择，Busy 和 Available。如果选Busy 的时候，就表示你很忙，需要静音，选 Available 的时候，就表示不需要静音，这样岂不是很好？但是，这个 Busy 和 Available 具体又对应 Google Calendar 的数据库的哪个字段呢？然后我看了看 android.provider 里面的 Calendar.java 源码，源码里面有一个字段的注释让我觉得有点靠谱，“transparency”，注释是：Transparency for the event&#8211; does the event consume time on the calendar?，嗯，就是它了。后来我有点不确定，自己实际试了试，新建两个 event，一个选 Busy，一个选Available，然后用 Root Explorer 实际看这两个 event 的 transparency 字段值，发现就是这个字段。OK！ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rajeesh</title>
		<link>http://jimblackler.net/blog/?p=151&#038;cpage=2#comment-101450</link>
		<dc:creator>rajeesh</dc:creator>
		<pubDate>Mon, 05 Nov 2012 07:36:08 +0000</pubDate>
		<guid isPermaLink="false">http://jimblackler.net/blog/?p=151#comment-101450</guid>
		<description>Hi JIm, 
How can i edit my reminder&#039;s snooze time. I successfully created events with remainders  but later i can&#039;t  edit their snoozing interval.
i&#039;m doing with android 2.2.

could you help me..</description>
		<content:encoded><![CDATA[<p>Hi JIm,<br />
How can i edit my reminder&#8217;s snooze time. I successfully created events with remainders  but later i can&#8217;t  edit their snoozing interval.<br />
i&#8217;m doing with android 2.2.</p>
<p>could you help me..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://jimblackler.net/blog/?p=151&#038;cpage=2#comment-80296</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Tue, 05 Jun 2012 00:13:43 +0000</pubDate>
		<guid isPermaLink="false">http://jimblackler.net/blog/?p=151#comment-80296</guid>
		<description>I was wondering if you have a comprehensive example to use the new API for ICS along with for 3.x and below without having to recompile for each type of device.</description>
		<content:encoded><![CDATA[<p>I was wondering if you have a comprehensive example to use the new API for ICS along with for 3.x and below without having to recompile for each type of device.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Android Guy</title>
		<link>http://jimblackler.net/blog/?p=151&#038;cpage=2#comment-63268</link>
		<dc:creator>Android Guy</dc:creator>
		<pubDate>Fri, 20 Jan 2012 21:34:34 +0000</pubDate>
		<guid isPermaLink="false">http://jimblackler.net/blog/?p=151#comment-63268</guid>
		<description>Time for an update - they finally released the public API, and it&#039;s slightly different. In ICS there is a new CalendarContract class, similar to what they did for ContactContract. See the official docs for the names you should now use instead of hardcoding strings that happen to work... See &lt;a href=&quot;http://developer.android.com/reference/android/provider/CalendarContract.Calendars.html&quot; rel=&quot;nofollow&quot;&gt;http://developer.android.com/reference/android/provider/CalendarContract.Calendars.html&lt;/a&gt; for the real deal.</description>
		<content:encoded><![CDATA[<p>Time for an update &#8211; they finally released the public API, and it&#8217;s slightly different. In ICS there is a new CalendarContract class, similar to what they did for ContactContract. See the official docs for the names you should now use instead of hardcoding strings that happen to work&#8230; See <a href="http://developer.android.com/reference/android/provider/CalendarContract.Calendars.html" rel="nofollow">http://developer.android.com/reference/android/provider/CalendarContract.Calendars.html</a> for the real deal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sally</title>
		<link>http://jimblackler.net/blog/?p=151&#038;cpage=2#comment-58978</link>
		<dc:creator>Sally</dc:creator>
		<pubDate>Tue, 13 Dec 2011 14:31:33 +0000</pubDate>
		<guid isPermaLink="false">http://jimblackler.net/blog/?p=151#comment-58978</guid>
		<description>Hello , 
i need you help ,, 
i am developing a program for my university . i want to include a calender where i add the impotant event to it ;user can click on the date and look at the event ....
besides that whenever an event is close ,notifcation to the user .

i dont want the user to write anything in the calender

how to do so ?</description>
		<content:encoded><![CDATA[<p>Hello ,<br />
i need you help ,,<br />
i am developing a program for my university . i want to include a calender where i add the impotant event to it ;user can click on the date and look at the event &#8230;.<br />
besides that whenever an event is close ,notifcation to the user .</p>
<p>i dont want the user to write anything in the calender</p>
<p>how to do so ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ash</title>
		<link>http://jimblackler.net/blog/?p=151&#038;cpage=2#comment-54804</link>
		<dc:creator>Ash</dc:creator>
		<pubDate>Fri, 14 Oct 2011 12:51:20 +0000</pubDate>
		<guid isPermaLink="false">http://jimblackler.net/blog/?p=151#comment-54804</guid>
		<description>Thanks for above info. I have a doubt, in my app, i need to show only todays/current days&#039; events.How do i specify the range for that ?

Also, if i need 2 show events for today &amp; tomorrow, how can i do that ? Do i need to use a different URI :-  &quot;/instances/when&quot;  OR &quot;/instances/whenbyday&quot; ?
Pl help</description>
		<content:encoded><![CDATA[<p>Thanks for above info. I have a doubt, in my app, i need to show only todays/current days&#8217; events.How do i specify the range for that ?</p>
<p>Also, if i need 2 show events for today &amp; tomorrow, how can i do that ? Do i need to use a different URI :-  &#8220;/instances/when&#8221;  OR &#8220;/instances/whenbyday&#8221; ?<br />
Pl help</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: androidtutorial&#124;android tricks&#124;guide</title>
		<link>http://jimblackler.net/blog/?p=151&#038;cpage=2#comment-54182</link>
		<dc:creator>androidtutorial&#124;android tricks&#124;guide</dc:creator>
		<pubDate>Fri, 30 Sep 2011 04:27:05 +0000</pubDate>
		<guid isPermaLink="false">http://jimblackler.net/blog/?p=151#comment-54182</guid>
		<description>[...] There is no developer api to put reminder in &#8211; phone users calendar &#8211; (for payment reminder etc) per http://jimblackler.net/blog/?p=151 [...]</description>
		<content:encoded><![CDATA[<p>[...] There is no developer api to put reminder in &#8211; phone users calendar &#8211; (for payment reminder etc) per <a href="http://jimblackler.net/blog/?p=151" rel="nofollow">http://jimblackler.net/blog/?p=151</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://jimblackler.net/blog/?p=151&#038;cpage=2#comment-53591</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Tue, 13 Sep 2011 10:08:20 +0000</pubDate>
		<guid isPermaLink="false">http://jimblackler.net/blog/?p=151#comment-53591</guid>
		<description>Hello Jim, 
I was wondering whether you was also experiencing weird issues with Google Calendar:
while using your example my &quot;all day&quot; events start at 01am and finish at 01am the next day.
However the time of &quot;startTime-endTime&quot; events is correct.
Have you experienced this behaviour?</description>
		<content:encoded><![CDATA[<p>Hello Jim,<br />
I was wondering whether you was also experiencing weird issues with Google Calendar:<br />
while using your example my &#8220;all day&#8221; events start at 01am and finish at 01am the next day.<br />
However the time of &#8220;startTime-endTime&#8221; events is correct.<br />
Have you experienced this behaviour?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anil</title>
		<link>http://jimblackler.net/blog/?p=151&#038;cpage=2#comment-52767</link>
		<dc:creator>Anil</dc:creator>
		<pubDate>Sat, 20 Aug 2011 06:03:10 +0000</pubDate>
		<guid isPermaLink="false">http://jimblackler.net/blog/?p=151#comment-52767</guid>
		<description>Hi Jim,
I have followed your tutorial to access the internal android calendar database. It works for all entries except for recurring events. The cursor does not return any recurring events at all. Can you please help me here. I am running this on Froyo (2.2) Following is my cursor declaration - 

 String[] projection = new String[] { &quot;title&quot;, &quot;description&quot;, &quot;dtstart&quot;, &quot;eventLocation&quot; };
    String selection = &quot;(calendar_id=&quot; + calID + &quot;)AND &quot; + (now - window)
            + &quot;&lt;dtstart AND dtstart&lt; &quot; + (now + (window));
    String sortorder = &quot;dtstart ASC&quot;;

    Cursor managedCursor = getCalendarManagedCursor(projection, selection,
            &quot;events&quot;, sortorder);

    private Cursor getCalendarManagedCursor(String[] projection,
        String selection, String path, String sort) {
    Uri calendars = Uri.parse(&quot;content://calendar/&quot; + path);
    Cursor managedCursor = null;
    try {
        managedCursor = getContentResolver().query(calendars, projection,
                selection, null, sort);
    } catch (IllegalArgumentException e) {
        Log.w(DEBUG_TAG,
                &quot;Failed to get provider at [&quot; + calendars.toString() + &quot;]&quot;);
    }

    if (managedCursor == null) {
        // try again
        calendars = Uri.parse(&quot;content://com.android.calendar/&quot; + path);
        try {
            managedCursor = getContentResolver().query(calendars,
                    projection, selection, null, sort);
        } catch (IllegalArgumentException e) {
            Log.w(DEBUG_TAG,
                    &quot;Failed to get provider at [&quot; + calendars.toString()
                            + &quot;]&quot;);
        }</description>
		<content:encoded><![CDATA[<p>Hi Jim,<br />
I have followed your tutorial to access the internal android calendar database. It works for all entries except for recurring events. The cursor does not return any recurring events at all. Can you please help me here. I am running this on Froyo (2.2) Following is my cursor declaration &#8211; </p>
<p> String[] projection = new String[] { &#8220;title&#8221;, &#8220;description&#8221;, &#8220;dtstart&#8221;, &#8220;eventLocation&#8221; };<br />
    String selection = &#8220;(calendar_id=&#8221; + calID + &#8220;)AND &#8221; + (now &#8211; window)<br />
            + &#8220;&lt;dtstart AND dtstart&lt; &quot; + (now + (window));<br />
    String sortorder = &quot;dtstart ASC&quot;;</p>
<p>    Cursor managedCursor = getCalendarManagedCursor(projection, selection,<br />
            &quot;events&quot;, sortorder);</p>
<p>    private Cursor getCalendarManagedCursor(String[] projection,<br />
        String selection, String path, String sort) {<br />
    Uri calendars = Uri.parse(&quot;content://calendar/&quot; + path);<br />
    Cursor managedCursor = null;<br />
    try {<br />
        managedCursor = getContentResolver().query(calendars, projection,<br />
                selection, null, sort);<br />
    } catch (IllegalArgumentException e) {<br />
        Log.w(DEBUG_TAG,<br />
                &quot;Failed to get provider at [&quot; + calendars.toString() + &quot;]&quot;);<br />
    }</p>
<p>    if (managedCursor == null) {<br />
        // try again<br />
        calendars = Uri.parse(&quot;content://com.android.calendar/&quot; + path);<br />
        try {<br />
            managedCursor = getContentResolver().query(calendars,<br />
                    projection, selection, null, sort);<br />
        } catch (IllegalArgumentException e) {<br />
            Log.w(DEBUG_TAG,<br />
                    &quot;Failed to get provider at [&quot; + calendars.toString()<br />
                            + &quot;]&quot;);<br />
        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matteo</title>
		<link>http://jimblackler.net/blog/?p=151&#038;cpage=2#comment-52753</link>
		<dc:creator>Matteo</dc:creator>
		<pubDate>Fri, 19 Aug 2011 18:23:57 +0000</pubDate>
		<guid isPermaLink="false">http://jimblackler.net/blog/?p=151#comment-52753</guid>
		<description>@Bmjones:
you said that you can run it on android 2.3. I can&#039;t in my Samsung Galaxy S2 (That is 2.3.3).
This is the code I use:

Cursor cursor = getContentResolver().query(Uri.parse
(&quot;content://com.android.calendar/calendars&quot;),
new String[]{&quot;calendar_id&quot;,&quot;displayname&quot;},null,null,null);

is it correct ??
&quot;content://com.android.calendar/calendars&quot; is good for 2.3 ??
thank you for help !!
matteo</description>
		<content:encoded><![CDATA[<p>@Bmjones:<br />
you said that you can run it on android 2.3. I can&#8217;t in my Samsung Galaxy S2 (That is 2.3.3).<br />
This is the code I use:</p>
<p>Cursor cursor = getContentResolver().query(Uri.parse<br />
(&#8220;content://com.android.calendar/calendars&#8221;),<br />
new String[]{&#8220;calendar_id&#8221;,&#8221;displayname&#8221;},null,null,null);</p>
<p>is it correct ??<br />
&#8220;content://com.android.calendar/calendars&#8221; is good for 2.3 ??<br />
thank you for help !!<br />
matteo</p>
]]></content:encoded>
	</item>
</channel>
</rss>
