<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4895691186620590987</id><updated>2026-02-27T12:07:55.210-08:00</updated><category term="UI"/><category term="appwidget"/><category term="buttons"/><category term="BroadcastReciever"/><category term="HIG"/><category term="RTFM"/><category term="XML"/><category term="about"/><category term="adb"/><category term="anonymous"/><category term="callback"/><category term="code"/><category term="examples"/><category term="intro"/><category term="linux"/><category term="location"/><category term="mobile"/><category term="null"/><category term="purpose"/><category term="timecube"/><category term="tutorial"/><category term="udev"/><title type='text'>An Android Dev&#39;s Troubles</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://android-troubles.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://android-troubles.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Bryan</name><uri>http://www.blogger.com/profile/10659111213351492959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgepQhpn8zDSy6nt-8BdsltcPEFAA3cXroUEHCRY6XT_D4kdEr8pthgVN2YRtE8ZpCG9yKzMx1sOHSKynR6-NCDNNNR9z47iKUCe0E7GfGOA8KDSsbJxU3xQXOlDj6X6A/s220/energy-arc.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4895691186620590987.post-365198278172079033</id><published>2012-01-15T07:39:00.000-08:00</published><updated>2012-01-15T07:39:22.214-08:00</updated><title type='text'>Update: GUIs, Here&#39;s How They Work</title><content type='html'>So here&#39;s an update to a &lt;a href=&quot;http://android-troubles.blogspot.com/2011/12/guis-how-do-they-work.html&quot;&gt;recent post&amp;nbsp;&lt;/a&gt;: Android recently released their design guidelines for Ice Cream Sandwich. It can be found &lt;a href=&quot;http://developer.android.com/design/index.html&quot;&gt;here&lt;/a&gt;. Some interesting things to note:&lt;br /&gt;
&lt;br /&gt;
The design principals are abstract and lofty. Things like &quot;Enchant Me&quot;, &quot;Simplify My Life&quot;, and &quot;Make Me Amazing&quot; are pretty open to&amp;nbsp;interpretation, but at least it gives you an idea what the designers were thinking when they created the interface.&lt;br /&gt;
&lt;br /&gt;
The Style section of the site describes things like how to design for different resolutions, what themes would compliment the native UI, their Roboto font, icons, and finally writing style&lt;br /&gt;
&lt;br /&gt;
The writing style is most interesting to me. Here are their main guidelines.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Keep it brief&lt;/li&gt;
&lt;li&gt;Keep it Simple&lt;/li&gt;
&lt;li&gt;Be Friendly&lt;/li&gt;
&lt;li&gt;Put the most important thing first&lt;/li&gt;
&lt;li&gt;Describe only what&#39;s necessary and no more&lt;/li&gt;
&lt;/ul&gt;
It&#39;s interesting because most of the examples they used seem to have came from their older UIs. Maybe they have gotten things right with ICS. If you got the time, I would encourage you to check out their other guidelines -- it&#39;s in interesting read (if you&#39;re in to that kind of thing).</content><link rel='replies' type='application/atom+xml' href='http://android-troubles.blogspot.com/feeds/365198278172079033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-troubles.blogspot.com/2012/01/update-guis-heres-how-they-work.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/365198278172079033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/365198278172079033'/><link rel='alternate' type='text/html' href='http://android-troubles.blogspot.com/2012/01/update-guis-heres-how-they-work.html' title='Update: GUIs, Here&#39;s How They Work'/><author><name>Bryan</name><uri>http://www.blogger.com/profile/10659111213351492959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgepQhpn8zDSy6nt-8BdsltcPEFAA3cXroUEHCRY6XT_D4kdEr8pthgVN2YRtE8ZpCG9yKzMx1sOHSKynR6-NCDNNNR9z47iKUCe0E7GfGOA8KDSsbJxU3xQXOlDj6X6A/s220/energy-arc.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4895691186620590987.post-4348896371317559771</id><published>2012-01-11T17:42:00.000-08:00</published><updated>2012-01-11T17:42:31.534-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="adb"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="udev"/><title type='text'>Linux and ADB</title><content type='html'>Hello all!&lt;br /&gt;
I thought I would post a little guide on what you have to do to get adb to work with eclipse and your device out on ubuntu.&lt;br /&gt;
This assumes:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;You&#39;re running Linux as a normal user&lt;/li&gt;
&lt;li&gt;You&#39;ve installed the Android SDK&lt;/li&gt;
&lt;li&gt;You&#39;ve installed Eclipse&lt;/li&gt;
&lt;li&gt;You&#39;ve installed the Android SDK plugin for Eclipse&lt;/li&gt;
&lt;/ul&gt;
I did all of that and it worked wonderfully for the emulator, but when I tried to run it on my Nexus One, it wouldn&#39;t&amp;nbsp;recognize&amp;nbsp;it. Since I do linux for a living, I though I would do a short writeup on what was broken and how to fix it.&lt;br /&gt;
Lets begin with reproduction of the problem. I&#39;ll plug in my Android device with USB Debugging turned on. Then I&#39;ll go to a terminal and type:&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; text-align: left;&quot;&gt;user@server:~/Projects/android-sdk-linux_86/platform-tools$ ./adb devices&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; text-align: left;&quot;&gt;List of devices attached&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; text-align: left;&quot;&gt;????????????&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; text-align: left; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; text-align: left;&quot;&gt;no permissions&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Well that&#39;s no fun. Note: if I had the emulator running, it would find it just fine. Well lets take a look at what went wrong. To understand the problem we are facing, you must understand that in linux, everything is&amp;nbsp;accessed&amp;nbsp;like a file, and files have permissions. The adb-server was having issues reading the usb device and to fix that, we must find the USB device &quot;file&quot; and make sure the permissions are correct on it. Devices in linux are kept under /dev/, so after looking around there a bit I find it at&amp;nbsp;&lt;b&gt;/dev/bus/usb/001/106&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
I can do the following&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;user@server:~/Projects/android-sdk-linux_86/platform-tools$ sudo chown user /dev/bus/usb/001/106&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;enter password&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;user@server:~/Projects/android-sdk-linux_86/platform-tools$ ./adb kill-server&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;user@server:~/Projects/android-sdk-linux_86/platform-tools$ ./adb start-server&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
And now when I list my devices&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;user@server:~/Projects/android-sdk-linux_86/platform-tools$ ./adb devices&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;List of devices attached&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;HT9CRP801xxx&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;device&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Huzzah! But do I have to go through that song and dance each time I want to develop? NO!&lt;br /&gt;
You don&#39;t even have to resort to writing your own script! You can use a function included in most linux&amp;nbsp;distributions&amp;nbsp;called udev. udev is a program that is ran every time hardware changes on your machine. You have the&amp;nbsp;ability&amp;nbsp;to write &quot;rules&quot; to compare the new hardware against some parameters and if &amp;nbsp;they match, you can have it do some action, like call a script or set permissions on the newly created device files. All rules go into /etc/udev/rules.d/ . Lets take a look at the rule I created.&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;user@server:~/Projects/android-sdk-linux_86/platform-tools$ cat /etc/udev/rules.d/99-android.rules&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;SUBSYSTEM==&quot;usb&quot;, SYSFS{idVendor}==&quot;&lt;/span&gt;&lt;i style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;18d1&lt;/i&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&quot;, MODE=&quot;0666&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Basically, make a file just like that one, but change the &lt;i&gt;18d1 &lt;/i&gt;to match your device.&amp;nbsp;It&#39;s pretty straight-forward (uh...sure), but where did that &lt;i&gt;18d1 &lt;/i&gt;come from?&amp;nbsp;It came from the output of &lt;b&gt;lsusb&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;user@server:~/Projects/android-sdk-linux_86/platform-tools$ lsusb&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;...&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Bus 001 Device 107: ID &lt;/span&gt;&lt;i style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;18d1&lt;/i&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;:4e12&lt;/span&gt;&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;...&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Mine had a blank description &amp;nbsp;but maybe other device would say something about adb in there to give you a hint. I know this isn&#39;t quite a step-by-step guide, but hopefully it helps someone out. Let me know in the comments if you get stuck.</content><link rel='replies' type='application/atom+xml' href='http://android-troubles.blogspot.com/feeds/4348896371317559771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-troubles.blogspot.com/2012/01/linux-and-adb.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/4348896371317559771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/4348896371317559771'/><link rel='alternate' type='text/html' href='http://android-troubles.blogspot.com/2012/01/linux-and-adb.html' title='Linux and ADB'/><author><name>Bryan</name><uri>http://www.blogger.com/profile/10659111213351492959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgepQhpn8zDSy6nt-8BdsltcPEFAA3cXroUEHCRY6XT_D4kdEr8pthgVN2YRtE8ZpCG9yKzMx1sOHSKynR6-NCDNNNR9z47iKUCe0E7GfGOA8KDSsbJxU3xQXOlDj6X6A/s220/energy-arc.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4895691186620590987.post-378011990915812039</id><published>2011-12-29T16:37:00.000-08:00</published><updated>2011-12-29T16:39:14.418-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="anonymous"/><category scheme="http://www.blogger.com/atom/ns#" term="buttons"/><category scheme="http://www.blogger.com/atom/ns#" term="callback"/><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><title type='text'>Anonymous Classes</title><content type='html'>&lt;span style=&quot;font-size: xx-small;&quot;&gt;(Or more things I should have learned in college)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
One of the things that always tripped me up when I was working on open-source projects in High School was seeing what looked to me to be very strange formatting of code. It would be a jumble of&amp;nbsp;parentheses&amp;nbsp;and curly-braces, and it wouldn&#39;t make sense to me. Worse yet, I couldn&#39;t find a pattern to try to&amp;nbsp;associate&amp;nbsp;this formatting with. So I just skipped it and modified what I knew.&lt;br /&gt;
&lt;br /&gt;
In College, I took a programming language course where we explored the more &quot;exotic&quot; languages. We got to lisp and lambda functions and once I learned about those, I had all the&amp;nbsp;knowledge&amp;nbsp;needed to understand the weird syntax.&lt;br /&gt;
&lt;br /&gt;
It wasn&#39;t until I got into android programming that I saw funny looking code again.and then it all made sense. Here&#39;s an example:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;searchBtn.setOnClickListener(new OnClickListener() {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;@Override&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;public void onClick(View v) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;});&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This threw me for a loop -- method calls are usually in the form of&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;object.method(arg1, arg2, ...);&lt;/span&gt;&lt;br /&gt;
Why was there a new in there?&lt;br /&gt;
What&#39;s with all the curly braces?&lt;br /&gt;
Why wasn&#39;t the method call finished before all this new junk was put in?&lt;br /&gt;
&lt;br /&gt;
Well, While I was pondering these things, it all just sort of clicked. It was an Anonymous Class.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What are Anonymous Classes?&lt;/b&gt;&lt;br /&gt;
Anonymous classes are classes that have no explicit name. As a result they are only used once.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Why Would you use one?&lt;/b&gt;&lt;br /&gt;
&lt;strike&gt;Because you&#39;re lazy&lt;/strike&gt; er...because there are cases where you only need a class only to satisfy a parameter of a function. These are most useful for &lt;a href=&quot;http://en.wikipedia.org/wiki/Callback_(computer_programming)&quot;&gt;callbacks&lt;/a&gt;. Doing GUI programming, or interfacing with some type of input device, you&#39;ll see them often.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How to&amp;nbsp;interpret/use one&lt;/b&gt;&lt;br /&gt;
Well lets start off with the example above. Lets look at it&#39;s &lt;a href=&quot;http://developer.android.com/reference/android/view/View.html#setOnClickListener(android.view.View.OnClickListener)&quot;&gt;method signature&lt;/a&gt;:&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;void&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; setOnClickListener(View.OnClickListener l)&amp;nbsp;;&lt;/span&gt;&lt;br /&gt;
That&#39;s pretty straightforward, it&#39;s a function that takes one argument of type&amp;nbsp;OnClickListener.&lt;br /&gt;
Lets look at the &lt;a href=&quot;http://developer.android.com/reference/android/view/View.OnClickListener.html&quot;&gt;OnClickListener&lt;/a&gt; class. It&#39;s an interface. That means that you can&#39;t call a instance of that class, it can only be&amp;nbsp;implemented&amp;nbsp;in a class which defines all it&#39;s abstract methods. In this case, setOnClickListerner needs an instance of a OnClickListener class so that it knows what to do when clicked. Here&#39;s what you can&#39;t do:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;OnClickListener bob = new OnClickListener();&lt;/span&gt;&lt;br /&gt;
That won&#39;t compile because it has an &amp;nbsp;abstract method, onClick(View v), which needs to be defined. So we can write a class that&amp;nbsp;implements&amp;nbsp;the OnClickListener&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;class anOnClickListernerForTheStartButtonOnTheMainActivity implements View.OnClickListener {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; onClick(View v)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;//In another file&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;anOnClickListernerForTheStartButtonOnTheMainActivity bob = new&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;anOnClickListernerForTheStartButtonOnTheMainActivity();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;searchBtn.setOnClickListener(bob);&lt;/span&gt;&lt;br /&gt;
But that gets cumbersome, so we do as the first example above does and use anonymous classes.&lt;br /&gt;
&lt;br /&gt;
Hopefully this helps someone else understand the beauty of Anonymous Classes</content><link rel='replies' type='application/atom+xml' href='http://android-troubles.blogspot.com/feeds/378011990915812039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-troubles.blogspot.com/2011/12/anonymous-classes.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/378011990915812039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/378011990915812039'/><link rel='alternate' type='text/html' href='http://android-troubles.blogspot.com/2011/12/anonymous-classes.html' title='Anonymous Classes'/><author><name>Bryan</name><uri>http://www.blogger.com/profile/10659111213351492959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgepQhpn8zDSy6nt-8BdsltcPEFAA3cXroUEHCRY6XT_D4kdEr8pthgVN2YRtE8ZpCG9yKzMx1sOHSKynR6-NCDNNNR9z47iKUCe0E7GfGOA8KDSsbJxU3xQXOlDj6X6A/s220/energy-arc.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4895691186620590987.post-4551127813090880777</id><published>2011-12-27T15:46:00.000-08:00</published><updated>2011-12-27T15:48:06.866-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="HIG"/><category scheme="http://www.blogger.com/atom/ns#" term="mobile"/><category scheme="http://www.blogger.com/atom/ns#" term="timecube"/><category scheme="http://www.blogger.com/atom/ns#" term="UI"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><title type='text'>GUIs? How Do They Work?</title><content type='html'>So I&#39;ve been around a computer for most of my life and I&#39;ve seen some pretty bad designs (cue &lt;a href=&quot;http://www.timecube.com/&quot;&gt;www.timecube.com&lt;/a&gt; guy here), but one thing that has interest me is GUI design. I&#39;ve spent 4 years in college and only had about 1 class where a GUI was required. Granted, computer science isn&#39;t about GUI programming but still, I was ill prepared to start designing programs that other people would be using.&lt;br /&gt;
When I started to program for android, I was a little taken aback by the XML approach to GUI programming that I had to use and searched for something that would give me a more Visual C++ type feel that I was use to in college. I &lt;a href=&quot;http://www.droiddraw.org/&quot;&gt;found some&lt;/a&gt;&amp;nbsp;(java warning) but I&amp;nbsp;couldn&#39;t get it to do exactly what I wanted so I dug into the XML and got it under control -- but what to do with it? How should I design my app to be most usable? These are the questions I have to answer to make my app&amp;nbsp;successful.&lt;br /&gt;
&lt;br /&gt;
Looking back there have been some interesting Human Interface&amp;nbsp;Guidelines (HIG) that have been used to try to steer people in the right direction in terms of how the look and feel of an application should be. One that comes to mind is one from the GNOME HIG. It suggested that Buttons shouldn&#39;t be labeled &quot;OK&quot; and &quot;Cancel&quot; but instead use verbs to clarify what the user is about to do.&lt;br /&gt;
Some people see this as putting a bounding box on their creativity and prefer to create their own way of doing things or making an app &quot;skinnable&quot; which I think is horrible. It breaks&amp;nbsp;consistency&amp;nbsp;with everything else and a lot of the time it leaves the default butt-ugly with the excuse &quot;If they don&#39;t like it, they can change it&quot;.&lt;br /&gt;
&lt;br /&gt;
No.&lt;br /&gt;
&lt;br /&gt;
I don&#39;t wanna take time to find and change a skin just because you wanted to make your app extendable. Pick intelligent defaults is all I&#39;m saying.&lt;br /&gt;
&lt;br /&gt;
Another thing you have to think about these days is making an interface that is usable on many different devices. between androidx86,&amp;nbsp;Chinese&amp;nbsp;tablets, and car makers, you can never be sure where your app will be deployed and how it will look.&amp;nbsp;Luckily&amp;nbsp;the android sdk makes the&amp;nbsp;experience&amp;nbsp;a bit more&amp;nbsp;predictable&amp;nbsp;by allowing multiple versions of&amp;nbsp;resources&amp;nbsp;to be uploaded and letting the device choose which one to display. &amp;nbsp;Also, you specify text fonts and layout sizes in em instead of cm or px. You can still use those units but they don&#39;t scale in to different size devices. There are a lot more guidelines on how to design your app on android and they can be found&amp;nbsp;&lt;a href=&quot;http://developer.android.com/guide/practices/ui_guidelines/index.html&quot;&gt;Here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Looking at it all, it can be a bit overwhelming to try to get it all right at first, that&#39;s why I&#39;m focusing on functionally first then I can devote all my time into&amp;nbsp;usability</content><link rel='replies' type='application/atom+xml' href='http://android-troubles.blogspot.com/feeds/4551127813090880777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-troubles.blogspot.com/2011/12/guis-how-do-they-work.html#comment-form' title='21 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/4551127813090880777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/4551127813090880777'/><link rel='alternate' type='text/html' href='http://android-troubles.blogspot.com/2011/12/guis-how-do-they-work.html' title='GUIs? How Do They Work?'/><author><name>Bryan</name><uri>http://www.blogger.com/profile/10659111213351492959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgepQhpn8zDSy6nt-8BdsltcPEFAA3cXroUEHCRY6XT_D4kdEr8pthgVN2YRtE8ZpCG9yKzMx1sOHSKynR6-NCDNNNR9z47iKUCe0E7GfGOA8KDSsbJxU3xQXOlDj6X6A/s220/energy-arc.jpg'/></author><thr:total>21</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4895691186620590987.post-6673947492402475158</id><published>2011-12-26T09:56:00.000-08:00</published><updated>2011-12-27T15:47:01.914-08:00</updated><title type='text'>Motivation</title><content type='html'>It&#39;s tough to stay motivated enough to see the product through to market. I look at my phone full of half completed apps, and it makes me sad.&lt;br /&gt;
I guess one of the reasons I don&#39;t continue is because it&#39;s such a pain to develop on my my computer. It has low ram so Eclipse crashes all the time, also I always have to futz with adb to get it to see my phone, don&#39;t even think about running the emulator -- that makes my computer go OOM everytime.&lt;br /&gt;
&lt;br /&gt;
I will be getting a new computer soon and maybe then I&#39;ll be able to develop more -- I even have some more ideas of what to make. You&#39;ll hear more about those later.&lt;br /&gt;
&lt;br /&gt;
--B</content><link rel='replies' type='application/atom+xml' href='http://android-troubles.blogspot.com/feeds/6673947492402475158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-troubles.blogspot.com/2011/12/motovation.html#comment-form' title='18 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/6673947492402475158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/6673947492402475158'/><link rel='alternate' type='text/html' href='http://android-troubles.blogspot.com/2011/12/motovation.html' title='Motivation'/><author><name>Bryan</name><uri>http://www.blogger.com/profile/10659111213351492959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgepQhpn8zDSy6nt-8BdsltcPEFAA3cXroUEHCRY6XT_D4kdEr8pthgVN2YRtE8ZpCG9yKzMx1sOHSKynR6-NCDNNNR9z47iKUCe0E7GfGOA8KDSsbJxU3xQXOlDj6X6A/s220/energy-arc.jpg'/></author><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4895691186620590987.post-8992562342515182090</id><published>2010-10-14T19:24:00.000-07:00</published><updated>2010-10-14T19:26:07.854-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="appwidget"/><category scheme="http://www.blogger.com/atom/ns#" term="buttons"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="UI"/><title type='text'>Helpful Link For AppWidget Creation</title><content type='html'>Looking to get started on designing an appwidget and find that none of the tutorials on android.com have information on dealing with buttons (and other UI elements)?&lt;br /&gt;
I found a nice tutorial that deals with those issues and is pretty easy to follow:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.helloandroid.com/files/xmaswidget/android_howto-hellowidget.pdf&quot;&gt;&lt;span class=&quot;f&quot;&gt;&lt;cite&gt;http://www.helloandroid.com/files/xmaswidget/android_howto-hellowidget.pdf&lt;/cite&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Leave a comment if you&#39;ve found it helpful.</content><link rel='replies' type='application/atom+xml' href='http://android-troubles.blogspot.com/feeds/8992562342515182090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-troubles.blogspot.com/2010/10/helpful-link.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/8992562342515182090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/8992562342515182090'/><link rel='alternate' type='text/html' href='http://android-troubles.blogspot.com/2010/10/helpful-link.html' title='Helpful Link For AppWidget Creation'/><author><name>Bryan</name><uri>http://www.blogger.com/profile/10659111213351492959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgepQhpn8zDSy6nt-8BdsltcPEFAA3cXroUEHCRY6XT_D4kdEr8pthgVN2YRtE8ZpCG9yKzMx1sOHSKynR6-NCDNNNR9z47iKUCe0E7GfGOA8KDSsbJxU3xQXOlDj6X6A/s220/energy-arc.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4895691186620590987.post-5303302653138596757</id><published>2010-10-11T20:41:00.000-07:00</published><updated>2010-10-11T20:43:54.145-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="appwidget"/><category scheme="http://www.blogger.com/atom/ns#" term="BroadcastReciever"/><category scheme="http://www.blogger.com/atom/ns#" term="location"/><category scheme="http://www.blogger.com/atom/ns#" term="null"/><category scheme="http://www.blogger.com/atom/ns#" term="RTFM"/><title type='text'>Appwidget lifetimes and persistance of data</title><content type='html'>So tonight&#39;s aggravation was caused by the letter null. Basically I couldn&#39;t figure out when I was trying to get my Speed Widget to work, why I could create a locationManager and initialize it, but subsequent calls would throw a NullPointerException.&lt;br /&gt;
&lt;br /&gt;
The solution (as with most things), was to RTFM. If you look at the documentation for &lt;a href=&quot;http://developer.android.com/reference/android/content/BroadcastReceiver.html#ReceiverLifecycle&quot;&gt;BroadcastReceiver&lt;/a&gt; (Which AppWidgetProvider is extended from), you would see:&lt;br /&gt;
&lt;blockquote&gt;A BroadcastReceiver object is only valid for the duration of the call  to &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/content/BroadcastReceiver.html#onReceive%28android.content.Context,%20android.content.Intent%29&quot;&gt;onReceive(Context, Intent)&lt;/a&gt;&lt;/code&gt;.&lt;/blockquote&gt;So that pretty much solved why my local variables were disappearing each time. I figured that appwidgets had funky lifetimes, I just didn&#39;t know where to look.</content><link rel='replies' type='application/atom+xml' href='http://android-troubles.blogspot.com/feeds/5303302653138596757/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-troubles.blogspot.com/2010/10/appwidget-lifetimes-and-persistance-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/5303302653138596757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/5303302653138596757'/><link rel='alternate' type='text/html' href='http://android-troubles.blogspot.com/2010/10/appwidget-lifetimes-and-persistance-of.html' title='Appwidget lifetimes and persistance of data'/><author><name>Bryan</name><uri>http://www.blogger.com/profile/10659111213351492959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgepQhpn8zDSy6nt-8BdsltcPEFAA3cXroUEHCRY6XT_D4kdEr8pthgVN2YRtE8ZpCG9yKzMx1sOHSKynR6-NCDNNNR9z47iKUCe0E7GfGOA8KDSsbJxU3xQXOlDj6X6A/s220/energy-arc.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4895691186620590987.post-4695322387253195303</id><published>2010-10-07T21:12:00.000-07:00</published><updated>2010-10-07T21:12:36.028-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="about"/><category scheme="http://www.blogger.com/atom/ns#" term="intro"/><category scheme="http://www.blogger.com/atom/ns#" term="purpose"/><title type='text'>Hello All!</title><content type='html'>So I finally gave in and created a blogger account.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So, what is this blog about? Well I&#39;ll tell you: about 3 months ago, I started watching youtube videos about how to develop for android, and I thought to myself, &quot;I can do that&quot;. So I downloaded the SDK and got to work.&lt;br /&gt;
&lt;br /&gt;
I created the Hello World app, with no problems, so I thought I could try more complicated apps. Much failure ensued.&lt;br /&gt;
&lt;br /&gt;
So This blog is about all the issues I&#39;ve ran into and my fixes/work arounds as a sort of documentation for myself and hopefully to help others going through the same issues. &lt;br /&gt;
&lt;br /&gt;
Also maybe others can comment on my postings and give me pointers on how to do it better.&lt;br /&gt;
&lt;br /&gt;
It won&#39;t be updated much, since I have a Real Job (TM) and it&#39;ll be a while before This starts looking like a real site.</content><link rel='replies' type='application/atom+xml' href='http://android-troubles.blogspot.com/feeds/4695322387253195303/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://android-troubles.blogspot.com/2010/10/hello-all.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/4695322387253195303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4895691186620590987/posts/default/4695322387253195303'/><link rel='alternate' type='text/html' href='http://android-troubles.blogspot.com/2010/10/hello-all.html' title='Hello All!'/><author><name>Bryan</name><uri>http://www.blogger.com/profile/10659111213351492959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgepQhpn8zDSy6nt-8BdsltcPEFAA3cXroUEHCRY6XT_D4kdEr8pthgVN2YRtE8ZpCG9yKzMx1sOHSKynR6-NCDNNNR9z47iKUCe0E7GfGOA8KDSsbJxU3xQXOlDj6X6A/s220/energy-arc.jpg'/></author><thr:total>3</thr:total></entry></feed>