Andrew Mahttp://andrewma.com/2013-05-18T00:00:00-07:00Resolving "SDK does not have any Build Tools installed" error2013-05-18T00:00:00-07:00Andrew Matag:andrewma.com,2013-05-18:2013/05/18/resolving-sdk-does-not-have-any-build-tools-installed-error/<p>After upgrading my Android SDK to 22, I started running into failed builds with the error message:</p>
<pre class="literal-block">
{android-sdk}/tools/ant/build.xml:479: SDK does not have any Build Tools installed
</pre>
<p>Couldn’t find very much on the web on how to resolve this and eventually I realized that it was because I only updated existing packages. In SDK 22, the platform tools and build tools are split up into their own items in the SDK manager.</p>
<p>Make sure you install the build-tools and platform-tools.</p>
Bubbling OnClick events2012-05-11T00:00:00-07:00Andrew Matag:andrewma.com,2012-05-11:2012/05/11/bubbling-onclick-events/<p>Today, I ran into a problem where I needed to bubble up the OnClick event. Inside of a RelativeLayout, I had a TextView which I had to make clickable (so that it could get some animation) because of this, the OnClickevent got swallowed up. To get around this, in the constructor, I create an <a class="reference external" href="http://developer.android.com/reference/android/view/View.OnClickListener.html">OnClickListener</a> which would simply call <a class="reference external" href="http://developer.android.com/reference/android/view/View.html#performClick()">performClick()</a> from the parent.</p>
<p>Here's how it goes</p>
<div class="highlight"><pre><span class="kd">final</span> <span class="n">View</span> <span class="n">parent</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
<span class="n">mTitleView</span> <span class="o">=</span> <span class="o">(</span><span class="n">TextView</span><span class="o">)</span> <span class="n">findViewById</span><span class="o">(</span><span class="n">R</span><span class="o">.</span><span class="na">id</span><span class="o">.</span><span class="na">TitleView</span><span class="o">);</span>
<span class="n">mTitleView</span><span class="o">.</span><span class="na">setOnClickListener</span><span class="o">(</span><span class="k">new</span> <span class="n">OnClickListener</span><span class="o">()</span> <span class="o">{</span>
<span class="nd">@Override</span>
<span class="kd">public</span> <span class="kt">void</span> <span class="nf">onClick</span><span class="o">(</span><span class="n">View</span> <span class="n">v</span><span class="o">)</span> <span class="o">{</span>
<span class="n">parent</span><span class="o">.</span><span class="na">performClick</span><span class="o">();</span>
<span class="o">}</span>
<span class="o">});</span>
</pre></div>
Android Lifecycle for two activities2012-01-24T00:00:00-08:00Andrew Matag:andrewma.com,2012-01-24:2012/01/24/android-lifecycle-for-two-activities/<p>Today, I ran into some problems of not understanding how the lifecycle of two activities. When one activity starts another activity, when does the <a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onPause()">onPause</a>/<a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onStop()">onStop</a>/<a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onDestroy()">onDestroy</a> run in comparison to the <a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onCreate()">onCreate</a>/<a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onStart()">onStart</a>/<a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onResume()">onResume</a> of the next activity. I put some logging in and here are the results:</p>
<div class="line-block">
<div class="line">Activity<strong>A</strong>.<a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onCreate()">onCreate</a></div>
<div class="line">Activity<strong>A</strong>.<a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onStart()">onStart</a></div>
<div class="line">Activity<strong>A</strong>.<a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onResume()">onResume</a></div>
<div class="line">Activity<strong>A</strong>.<a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onPause()">onPause</a></div>
<div class="line">Activity<strong>B</strong>.<a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onCreate()">onCreate</a></div>
<div class="line">Activity<strong>B</strong>.<a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onStart()">onStart</a></div>
<div class="line">Activity<strong>B</strong>.<a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onResume()">onResume</a></div>
<div class="line">Activity<strong>A</strong>.<a class="reference external" href="http://developer.android.com/reference/android/app/Activity.html#onStop()">onStop</a></div>
</div>
<p>For official docs about this, see: <a class="reference external" href="http://developer.android.com/guide/topics/fundamentals/activities.html#CoordinatingActivities">Coordinating Activities</a></p>
Find Used Memory Slots via Command Line2012-01-14T00:00:00-08:00Andrew Matag:andrewma.com,2012-01-14:2012/01/14/find-used-memory-slots-via-command-line/<p>Yesterday, I was going to order some more ram for my laptop and I didn’t have a screwdriver around to check if the 4gb in my current setup was composed of one 4gb dimm or 2 x 2gb dimm. I found a nifty command-line options (Windows only) to display this information for me.</p>
<p>wmic MEMORYCHIP get banklabel, capacity, caption, devicelocator, partnumber</p>
<p>via <a class="reference external" href="http://support.risualblogs.com/blog/2010/05/04/find-used-memory-slots-via-command-line/">Find Used Memory Slots via Command Line</a></p>