Olias Tech Blog

You name it, it's fair game here: Android development, Windows, C#, Java, my pet, Video Games, Xbox, and Twitter. This is where I dump bits that may be helpful. Or not.

Tuesday, May 18, 2010

ToMarketWeb.com - ToMarket's New Home

ToMarketWeb.com is up and running as the home to my popular Android App ToMarket Grocery Shopping List.  Check it out!

http://tomarketweb.com/

Saturday, April 24, 2010

AllredHouse.com is the new blog site

I have moved my blog to http://www.allredhouse.com/ - check it out!

Tuesday, April 13, 2010

Android Layout findViewById Returns Null

Every once in a while you run across a coding issue that has occurred in the past but you can't remember the resolution. Tonight is one of those times and the issue was an Android Layout one.

I had a layout xml file with the following id on a TextView:


id="@+id/foo"




In the OnCreate() method I set the content view:

setContentView(R.layout.my_main);

And then went to get the TextView as such:

TextView foo = (TextView) this.findViewById(R.id.foo);

The problem is, foo is always null.

The issue here is that you must use the correct schema for the id node, which I'm guessing is compiling correctly due to some past version compatibility "feature" in the Android code. Simply making the change to use android:id as shown below, made the null an issue of my past (again) and now I can move on to using the TextView any way I like.



Every once in a while you run across a coding issue that has occurred in the past but you can't remember the resolution. Tonight is one of those times and the issue was an Android Layout one.

I had a layout xml file with the following TextView:

android:id="@+id/foo" 


Tuesday, March 2, 2010

Google Android Developers Rejoice!

In a huge move, Google has sent out emails to thousands of Android developers stating that if they have an Android app with 3.5+ stars and 5k+ downloads, they get a FREE (as in beer) phone! Here is the mail:

+++++++++++++++++++++
Subject: Device Seeding Program for Top Android Market Developers
From: android-market-seeding@google.com

Due to your contribution to the success of Android Market, we would like to present you with a brand new Android device as part of our developer device seeding program. You are receiving this message because you're one of the top developers in Android Market with one or more of your applications having a 3.5 star or higher rating and more than 5,000 unique downloads.

In order to receive this device, you must click through to this site, read the terms and conditions of the offer and fill out the registration form to give us your current mailing address so that we can ship your device.

You will receive either a Verizon Droid by Motorola or a Nexus One. Developers with mailing addresses in the US will receive either a Droid or Nexus one, based on random distribution. Developers from Canada, EU, and the EEA states (Norway, Lichtenstein), Switzerland, Hong Kong, Taiwan, and Singapore will receive a Nexus One. Developers with mailing addresses in countries not listed above will not receive a phone since these phones are not certified to be used in other countries.

We hope that you will enjoy your new device and continue to build more insanely popular apps for Android!
+++++++++++++++++++++++++++

I thought I was a phanboy before... Google, you Rock!

Wednesday, February 10, 2010

Motorola S9 Volume Control Issue Solved!

My Motorola S9 headset failed during a recent workout. My symptoms were: low volume, unresponsive buttons. since it was well over the warranty period, in frustration I decided to peel the black + - phone rubber button off of the unit (I figured why not, the thing is basically useless as it is). I then noticed that there is a little screw that connects the ear-bud housing to the head set that appeared to be corroded. I took out an exacto and started scraping the screw and noticed the base of the screw appeared have corrosion or something that extended to one of the wires. I scraped some of this substance and immediately the volume went to full (I had started a tune in advance - I suppose I could have shorted the whole unit, but I was taking a chance on that like I said). I cleared away the corrosion, tested the unit, then covered the screw and the cavity with super glue (I'm not sure if that is a smart move or not). As I type I am once again listening to my wireless bluetooth headset once again!

Monday, December 14, 2009

Shameless plug for ToMarket Android App

OK, some of you know that I have an Android App in the Android Market called ToMarket. It is a convenient little shopping App that has a bit of a following. As I decide where to go next with it in it's evolution I have a new website called www.ToMarketWeb.com that will host web services and possibly an online version of the app. Chaeck the site out - log into the forum and say hello if you like.

Tuesday, December 1, 2009

SQL Order By using columns of Strings that may be numbers...

Had a column of type string that may be numbers that are entered by the user of an application. The user is allowed to sort, but using the standard "order by colname asc" can give this nasty list:

1
12
19
3
4
44
7
acorns
beer

Changing the command to read "order by cast(colname as signed) asc" makes the list much prettier:

1
3
4
7
12
19
44
acorns
beer

This syntax was using MySQL, but should port nicely elsewhere.