<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rick Guyer .com &#187; Palm Pre</title>
	<atom:link href="http://rickguyer.com/tag/palm-pre/feed/" rel="self" type="application/rss+xml" />
	<link>http://rickguyer.com</link>
	<description>Information about the web, web development, and technology.</description>
	<lastBuildDate>Wed, 21 Sep 2011 13:50:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Resetting the All Inboxes counter on your Palm Pre</title>
		<link>http://rickguyer.com/all-inboxes-counter-palm-pre/</link>
		<comments>http://rickguyer.com/all-inboxes-counter-palm-pre/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 23:01:57 +0000</pubDate>
		<dc:creator>ricog</dc:creator>
				<category><![CDATA[webOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Palm Pre]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://rickguyer.com/?p=151</guid>
		<description><![CDATA[I've been digging around on webOS for a little while, learning how it ticks. I get pretty excited about the possibilities of open source mobile development. Although I haven't created any official apps yet, I've learned some pretty cool stuff.

A few weeks after I got my Palm Pre my All Inboxes mailbox counter got out of sync. If I had any unread mail it would show +5 more than what I had. I think this occurred when I removed an account or had a crash or something. I've forgotten the details. Anyway, it was bugging the hell out of me. So today I decided to track it down. To my surprise it wasn't too hard to figure out.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been digging around on <a href="http://en.wikipedia.org/wiki/WebOS">webOS</a> for a little while, learning how it ticks. I get pretty excited about the possibilities of open source mobile development. Although I haven&#8217;t created any official apps yet, I&#8217;ve learned some pretty cool stuff.</p>
<p>A few weeks after I got my <a href="http://www.palm.com/us/products/phones/pre/">Palm Pre</a> my All Inboxes mailbox counter got out of sync. If I had any unread mail it would show +5 more than what I had. I think this occurred when I removed an account or had a crash or something. I&#8217;ve forgotten the details. Anyway, it was bugging the hell out of me. So today I decided to track it down. To my surprise it wasn&#8217;t too hard to figure out.<span id="more-151"></span></p>
<p>Initially I tried different things; like removing all the email accounts, rebooting the phone, and various other attempts to &#8220;trick&#8221; the Pre into resetting the unread counter for All Inboxes. And please keep in mind that the simplest way to solve this problem (for most people) will be to <a href="http://www.weboshelp.net/webos-mojo-development-resources/frequently-asked-questions/444-how-do-i-perform-a-hard-reset-on-the-pre">reset the Palm Pre to its factory settings</a>. I haven&#8217;t tried a reset, but I&#8217;m pretty sure it will do the trick. For me though, I knew the unread counter was just a field in a record in a database somewhere on the Pre. And updating that field was a lot more fun than a reset would have been. Below I describe how I fixed the inbox counter.</p>
<p>The process involves <a href="http://www.webos-internals.org/wiki/Portal:Accessing_Linux">rooting your Pre</a> in order to get access to the <a href="http://www.sqlite.org/">SQLite</a> database that most of the Pre&#8217;s data is stored on. Although rooting is fairly straight forward and this fix is only a few commands on a rooted Pre, I do not encourage anyone to root their phone and risk messing something up. If you don&#8217;t know what you are doing and don&#8217;t feel comfortable turning your Palm Pre into a paper weight in the spirit of adventure, you might want to stop reading this article.</p>
<p>For everyone else, let the fun begin.</p>
<ol>
<li>First, like I said, you need to <a href="http://www.webos-internals.org/wiki/Portal:Accessing_Linux">root your Palm Pre</a>.</li>
<li>Next, from the root prompt enter the Pre&#8217;s relevant SQLite database with this command:
<pre class="brush: php">sqlite3 /var/luna/data/dbdata/PalmDatabase.db3</pre>
</li>
<li>Take a peek at the record that holds the unread message counter for All Inboxes:
<pre class="brush: php">SELECT * FROM com_palm_accounts_ActiveRecordFolder WHERE syncKey=&#039;_All_Inboxes_&#039;;</pre>
<p>You&#8217;ll see something like this:</p>
<pre class="brush: php">|1|5|7|45079976738820|EMAIL|_All_Inboxes_|0|-9999991||All inboxes|0|0|48378511622153|44|4182610||||||0|0|0|0|0|All inboxes||||||||||||||||</pre>
<p>For those who care, you can see the details of the com_palm_accounts_ActiveRecordFolder table by running:</p>
<pre class="brush: php">.schema com_palm_accounts_ActiveRecordFolder</pre>
<p>That&#8217;s how I learned about the syncKey and the unreadCount used below.</li>
<li>Now let&#8217;s update the counter:
<pre class="brush: php">UPDATE com_palm_accounts_ActiveRecordFolder SET unreadCount=1 WHERE syncKey=&#039;_All_Inboxes_&#039;;</pre>
<p>In the above example I set unreadCount=1 because I had one unread mail across all my email accounts. You&#8217;ll probably want to change the number to your actual unread count. At this point you should be able to look at your Pre and see that the counter is fixed.</li>
<li>Exit SQLite:
<pre class="brush: php">.exit</pre>
</li>
</ol>
<p>That&#8217;s it. I restarted my Pre after doing this, but it probably isn&#8217;t necessary.</p>
<p>I hope this proves useful to someone/anyone. If you have any comments or need some help let me know. I&#8217;m really enjoying webOS and plan to learn more.</p>
]]></content:encoded>
			<wfw:commentRss>http://rickguyer.com/all-inboxes-counter-palm-pre/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

