<?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>TVS Technical Blog</title>
	<atom:link href="http://tinyvital.com/techblog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://tinyvital.com/techblog</link>
	<description>Technical Stuff from Tiny Vital Systems, LLC</description>
	<lastBuildDate>Sat, 08 Aug 2009 18:43:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Android Noob &#8211; Custom View Wont Draw &#8211; Here&#8217;s Why</title>
		<link>http://tinyvital.com/techblog/?p=46</link>
		<comments>http://tinyvital.com/techblog/?p=46#comments</comments>
		<pubDate>Sat, 08 Aug 2009 18:43:32 +0000</pubDate>
		<dc:creator>John Moore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tinyvital.com/techblog/?p=46</guid>
		<description><![CDATA[I defined a custom SurfaceView and included an onDraw() method.
It wasn&#8217;t getting called &#8211; a mystery.
I added a background color to its declaration in main.xml and that fixed it.
Grrr.
]]></description>
			<content:encoded><![CDATA[<p>I defined a custom SurfaceView and included an <strong>onDraw()</strong> method.</p>
<p>It wasn&#8217;t getting called &#8211; a mystery.</p>
<p>I added a background color to its declaration in main.xml and that fixed it.</p>
<p>Grrr.</p>
]]></content:encoded>
			<wfw:commentRss>http://tinyvital.com/techblog/?feed=rss2&amp;p=46</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Noob &#8211; Performance requirements and &#8220;bad&#8221; Java</title>
		<link>http://tinyvital.com/techblog/?p=44</link>
		<comments>http://tinyvital.com/techblog/?p=44#comments</comments>
		<pubDate>Sun, 02 Aug 2009 20:58:44 +0000</pubDate>
		<dc:creator>John Moore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tinyvital.com/techblog/?p=44</guid>
		<description><![CDATA[THere is a section in the SDK docs on designing for performance. It has lots of suggestions, and some of them run contrary to &#8220;good Java&#8221; practice. Hence, if you do good Java practice, you want to look at these.
For example, they discourage getters/setters, preferring public access between classes. This is a big Object Oriented [...]]]></description>
			<content:encoded><![CDATA[<p>THere is a <a href="http://developer.android.com/guide/practices/design/performance.html">section in the SDK docs</a> on designing for performance. It has lots of suggestions, and some of them run contrary to &#8220;good Java&#8221; practice. Hence, if you do good Java practice, you want to look at these.</p>
<p>For example, they discourage getters/setters, preferring public access between classes. This is a big Object Oriented and Java No-No. But it&#8217;s the right thing to do where you need it.</p>
]]></content:encoded>
			<wfw:commentRss>http://tinyvital.com/techblog/?feed=rss2&amp;p=44</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Noob &#8211; Duh &#8211; Where the JVM Log (and exceptions) lurk</title>
		<link>http://tinyvital.com/techblog/?p=42</link>
		<comments>http://tinyvital.com/techblog/?p=42#comments</comments>
		<pubDate>Sun, 02 Aug 2009 20:56:33 +0000</pubDate>
		<dc:creator>John Moore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tinyvital.com/techblog/?p=42</guid>
		<description><![CDATA[Learning to work with Android, I guess it helps to play around with all the tools before doing too much serious development.
I had been wondering where to find stack traces when my code blew out with uncaught exceptions, or failed to start.
Well, I need look no farther. One of the functions of the adb utility [...]]]></description>
			<content:encoded><![CDATA[<p>Learning to work with Android, I guess it helps to play around with all the tools before doing too much serious development.</p>
<p>I had been wondering where to find stack traces when my code blew out with uncaught exceptions, or failed to start.</p>
<p>Well, I need look no farther. One of the functions of the adb utility is just that:</p>
<blockquote><p>a<strong>db.exe logcat</strong></p></blockquote>
<p>It does the trick and shows lots of other interesting traces.</p>
<p>And, you can write to it yourself using the <b>Log</b> class in the SDK.</p>
]]></content:encoded>
			<wfw:commentRss>http://tinyvital.com/techblog/?feed=rss2&amp;p=42</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Android &#8211; SDK/Eclipse Screwup causes Runtime Exception</title>
		<link>http://tinyvital.com/techblog/?p=40</link>
		<comments>http://tinyvital.com/techblog/?p=40#comments</comments>
		<pubDate>Sun, 02 Aug 2009 05:01:35 +0000</pubDate>
		<dc:creator>John Moore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tinyvital.com/techblog/?p=40</guid>
		<description><![CDATA[I created an android project in eclipse that had a custom MySurfaceView object that was a subclass of SurfaceView and was declared in the layout. I refactored this project several times.
When I tried to run it, it blew up immediately. 
I used adb.exe logcat to look at the logs and it was having trouble &#8220;inflating&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>I created an android project in eclipse that had a custom MySurfaceView object that was a subclass of SurfaceView and was declared in the layout. I refactored this project several times.</p>
<p>When I tried to run it, it blew up immediately. </p>
<p>I used <strong>adb.exe logcat</strong> to look at the logs and it was having trouble &#8220;inflating&#8221; MySurfaceView &#8211; couldn&#8217;t find the class.</p>
<p>After wasting lots of time, I suspected that the project wasn&#8217;t being built correctly. I created a new ASurfaceView class and put all the MySurfaceView stuff in it so it was identical except for the name. I then deleted MySurfaceView.java.</p>
<p>The problems was fixed.</p>
]]></content:encoded>
			<wfw:commentRss>http://tinyvital.com/techblog/?feed=rss2&amp;p=40</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android &#8211; Noob &#8211; How to Get a Click on View</title>
		<link>http://tinyvital.com/techblog/?p=36</link>
		<comments>http://tinyvital.com/techblog/?p=36#comments</comments>
		<pubDate>Sun, 12 Jul 2009 23:53:50 +0000</pubDate>
		<dc:creator>John Moore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tinyvital.com/techblog/?p=36</guid>
		<description><![CDATA[Here is how to arrange to get a click on a view that doesn&#8217;t have an onClick() method to override.

  this.setOnClickListener(
        new OnClickListener() {
            @Override
            [...]]]></description>
			<content:encoded><![CDATA[<p>Here is how to arrange to get a click on a view that doesn&#8217;t have an <strong>onClick()</strong> method to override.</p>
<pre>
  this.setOnClickListener(
        new OnClickListener() {
            @Override
            public void onClick(View v) {
                 _mainThread.setCenter();
            }
        }
  );
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tinyvital.com/techblog/?feed=rss2&amp;p=36</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android &#8211; Noob &#8211; Simple Sprite Graphics</title>
		<link>http://tinyvital.com/techblog/?p=34</link>
		<comments>http://tinyvital.com/techblog/?p=34#comments</comments>
		<pubDate>Sun, 12 Jul 2009 21:24:42 +0000</pubDate>
		<dc:creator>John Moore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tinyvital.com/techblog/?p=34</guid>
		<description><![CDATA[So I wanted to have an object that floated around over a fixed background. This is called a &#8220;sprite.&#8221;
Examining the documentation didn&#8217;t show the word &#8220;sprite&#8221; anywhere. However, it turns out that the Lunar Lander example included with the SDK does sprite graphics (even uses the word) to animate the landing craft.
It&#8217;s pretty simple &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>So I wanted to have an object that floated around over a fixed background. This is called a &#8220;sprite.&#8221;</p>
<p>Examining the documentation didn&#8217;t show the word &#8220;sprite&#8221; anywhere. However, it turns out that the <strong>Lunar Lander example</strong> included with the SDK does sprite graphics (even uses the word) to animate the landing craft.</p>
<p>It&#8217;s pretty simple &#8211; just draw the object on your view&#8217;s <em>graphics</em> object.</p>
]]></content:encoded>
			<wfw:commentRss>http://tinyvital.com/techblog/?feed=rss2&amp;p=34</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android &#8211; Noob &#8211; Application Blows Up Before First Statement</title>
		<link>http://tinyvital.com/techblog/?p=32</link>
		<comments>http://tinyvital.com/techblog/?p=32#comments</comments>
		<pubDate>Sun, 12 Jul 2009 21:22:09 +0000</pubDate>
		<dc:creator>John Moore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tinyvital.com/techblog/?p=32</guid>
		<description><![CDATA[One of the most frustrating debug problems is when the application blows up before it gets to the first debug statement.
Here are a couple of hints:

Using the debugger, look at the stack trace. It may have clues in it (or it may not tell you much)
Examing the metadata XML files and be sure all references [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most frustrating debug problems is when the application blows up before it gets to the first debug statement.</p>
<p>Here are a couple of hints:</p>
<ol>
<li>Using the debugger, look at the stack trace. It may have clues in it (or it may not tell you much)</li>
<li>Examing the metadata XML files and be sure all references to Java classes are exactly right &#8211; package name spelled right, etc</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://tinyvital.com/techblog/?feed=rss2&amp;p=32</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Programming &#8211; Noob &#8211; Debug Logging</title>
		<link>http://tinyvital.com/techblog/?p=27</link>
		<comments>http://tinyvital.com/techblog/?p=27#comments</comments>
		<pubDate>Sun, 12 Jul 2009 04:57:42 +0000</pubDate>
		<dc:creator>John Moore</dc:creator>
				<category><![CDATA[Androd]]></category>

		<guid isPermaLink="false">http://tinyvital.com/techblog/?p=27</guid>
		<description><![CDATA[So I wanted to log my accelerometer averager without slowing it down significantly&#8230;
Android provides two things that together make this easy (although I haven&#8217;t figured out how to get a snapshot as opposed to a scrolling log):

A logging class &#8211; in my case, I used:
 android.util.Log.d(&#8221;ACC&#8221;, &#8220;dX:&#8221; + dampedX + &#8221; LX:&#8221; + lastX + [...]]]></description>
			<content:encoded><![CDATA[<p>So I wanted to log my accelerometer averager without slowing it down significantly&#8230;</p>
<p>Android provides two things that together make this easy (although I haven&#8217;t figured out how to get a snapshot as opposed to a scrolling log):</p>
<ol>
<li>A logging class &#8211; in my case, I used:<br />
<blockquote><p> android.util.Log.d(&#8221;ACC&#8221;, &#8220;dX:&#8221; + dampedX + &#8221; LX:&#8221; + lastX + &#8221; buf[" + avgOldest + "]=&#8221; + avgBufX[avgOldest]);</p></blockquote>
</li>
<li>A debug interface for the device or emulator that does lots of cool things, including showing the log in real time. This is called <strong>ddms</strong> and is found in the SDK tools directory. It is a batch file that fires up a GUI. See <a href="http://developer.android.com/guide/developing/tools/ddms.html">this write-u</a>p.</li>
</ol>
<p>;</p>
]]></content:encoded>
			<wfw:commentRss>http://tinyvital.com/techblog/?feed=rss2&amp;p=27</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Android Programming &#8211; Noob &#8211; Debug Fails on Actual Device</title>
		<link>http://tinyvital.com/techblog/?p=18</link>
		<comments>http://tinyvital.com/techblog/?p=18#comments</comments>
		<pubDate>Sat, 11 Jul 2009 21:01:25 +0000</pubDate>
		<dc:creator>John Moore</dc:creator>
				<category><![CDATA[Androd]]></category>

		<guid isPermaLink="false">http://tinyvital.com/techblog/?p=18</guid>
		<description><![CDATA[Android debugging can be done either with the emulator, or directly on the hardware device via the USB connection.
I had an app which was debugging fine on the emulator, but on the phone, just ran without hitting breakpoints.
It turns out that one needs to add the attribute android:debuggable=&#8221;true&#8221; to the application XML element.
It would be [...]]]></description>
			<content:encoded><![CDATA[<p>Android debugging can be done either with the emulator, or directly on the hardware device via the USB connection.</p>
<p>I had an app which was debugging fine on the emulator, but on the phone, just ran without hitting breakpoints.</p>
<p>It turns out that one needs to add the attribute <strong>android:debuggable=&#8221;true&#8221;</strong> to the <strong>application </strong>XML element.</p>
<p>It would be helpful if the emulator were to raise a question when this element is missing, since this represents a failure to accurately emulate the device.</p>
]]></content:encoded>
			<wfw:commentRss>http://tinyvital.com/techblog/?feed=rss2&amp;p=18</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Programming &#8211; Noob &#8211; How to get Periodic Events</title>
		<link>http://tinyvital.com/techblog/?p=16</link>
		<comments>http://tinyvital.com/techblog/?p=16#comments</comments>
		<pubDate>Sat, 11 Jul 2009 20:58:50 +0000</pubDate>
		<dc:creator>John Moore</dc:creator>
				<category><![CDATA[Androd]]></category>

		<guid isPermaLink="false">http://tinyvital.com/techblog/?p=16</guid>
		<description><![CDATA[I have a graphics application that needs to get periodic events in order to update a sensor data filter.
It turns out the way this is normally done is to create an independent thread with a main loop which calls whatever needs a &#8220;tick&#8221; periodically.
This is used in the Lunar Lander demo that comes with the [...]]]></description>
			<content:encoded><![CDATA[<p>I have a graphics application that needs to get periodic events in order to update a sensor data filter.</p>
<p>It turns out the way this is normally done is to create an independent thread with a main loop which calls whatever needs a &#8220;tick&#8221; periodically.</p>
<p>This is used in the Lunar Lander demo that comes with the SDK.</p>
<p>PROBLEM: this is not very accurate real time. It would be better to have an interval timer that does not depend on the vagaries of running a loop with &#8220;sleep&#8221; in it. <strong>android.os.CountDownTimer </strong>may do this, but it does want to stop eventually.</p>
<p>Experimenting&#8230;</p>
<p><strong>update&#8230;</strong></p>
<p><strong>android.os.CountDownTime </strong>does the trick<strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://tinyvital.com/techblog/?feed=rss2&amp;p=16</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

