Going Android: Which Device To Pick?
Jun 7th
Over the last year I’ve been asked quite a few times:
Hey,I’m going to Android, which phone/device should I get?
It’s a pretty easy question to answer …
Buy the best phone you can afford.
The reason for this response is because essentially you’re buying something you want to
- Enjoy
- Be Happy With
- Have For Awhile
Enjoyment and Be Happy are in the same boat in my opinion. Here’s how I gauge those:
- Is the Device Fast?
- Does it have everything I need?
- Is it not modified to Hell?
- Does it fit my needs (Some keyboards are too small for big hands, and some are on screen only).
I’ve worked with numerous phones and here’s my synopsis for you:
TMobile G1
Great Phone. My first foray into Android and I still have one today. I’ve burned through two warranties, but I attest that to the fact that I’m hard on phones.
Rating: 3/5 Stars.
Reason: 2 stars is missing because I’m stuck on Android 1.6 unless I mod it. The processor is a slow and its a V1 Product. However, it works great and its reliable. It’s getting old and if you’re going to buy a new phone, just get a newer more powerful one (more on that below).
TMobile Samsun Behold II
This thing is a pile of junk. This is the only Android phone I’ve met thus far that I cannot stand and nearly hate it. The UI is so unresponsive that it makes the phone impossible to use. Samsung also thought they were bright and smart so they modded destroyed the default Android UI that it was hard as hell to use. I couldnt figure it out. It was not intuitive and was an absolute PITA.
Rating: 1/5 Stars
Reason for the “at least they got 1 star” rating. The phone worked. Barely.
TMobile MyTouch
I liked this phone, it was the first move into the keyboard-less Android phones for me. It was basically a souped up G1 with some more power. Nothing else to really say about it. Oh yeah, it looks pretty.
Rating: 3/5 Stars
Reason for missing 2 Stars: Same as G1
Verizon Droid
This phone is NICE. I really like the phone. However, I don’t like the keyboard. It wasn’t designed that well in my opinion. Other than that, its super nice, its at 2.1 right now and supposed to go to 2.2 soon. Bonus here is that right now, as of this writing Verizon is giving away a free Droid when you buy one. “Buy one get one free”. So even if you only need one, you have one for backup incase you brick it, or break it, or just one to play with and Mod while the other one is safe.
Rating: 4/5 Stars
Reason for the missing star: The keyboard, but this is my preference, some people like it.
Nexus One
Whoa. This is one bad motherfelker. I bought one for myself and my wife liked it so much that she took it from me and gave me her G1! I have developed on it, used it for internet, phone, driving, typing, everything. This thing is badass. I love this phone. I have no complaints, other than the price. But then again, buy what you can afford, if you can afford it, get it.
Rating 5/5 Stars
Verizon Incredible
Note: I have not actually held this phone. I’m going off a friend of mines review. Long story short, its Super nice and its like the Nexus Ones close cousin. Super fast, nice and snappy, and I have not heard any complaints yet.
Rating: 5/5 Stars
Sprint Evo 4G
Note: Again, I have not held it in hand, however I have a fellow developer friend who went to Google I/O and got one for free there and gave me a pretty good rundown. Essentially, Sprint (or HTC, someone) altered the UI a bit so its kind of clunky from what I hear. I need to go to Best Buy and check one out. Other than that its pretty awesome. The real downfall is that real 4G coverage is super limited right now. So unless you live in one of the 4G holy-lands, your running 3G. Also, reports from the field say that 4G Sucks Battery faster than a Dyson Air Blade dries your hands.
Rating: 4/5 Stars
Reason for -1 Star: I’m hearing a few complaints about it and usually that means there is something going on with it … and .. it was only released today! But overall, its a good move by Sprint. The first of anything is usually the king of the market for awhile. Kudos to Sprint for that.
Wrap Up
Overall, buy what you can afford. If you’re on TMobile … get a Nexus One. If you’re on Verizon, get an Incredible (or droid if the incredible is too expensive). Get something you’re going to be super happy with. Even if the “one you want” is an extra hundred. You’ll be soooo happy you did.
ASPNET MVC: Handling Multiple Buttons on a Form with jQuery
Jun 4th
Sometimes your task in MVC involves many buttons in the same form. Such as the screen shot here. 
What happens in most situations is that you end up having some code that kind of looks like this:
<form action="/foo/save"> <!-- My HTML and multiple buttons --> </form>
… and then the code looks like this
public ActionResult Save(CustomerList customers, string buttonName)
{
if(buttonName == "Save")
{
// do something
}
else if (buttonName == "Reload")
{
// etc, etc
}
// Other if's, etc, etc
}
We can solve this with a little jQuery. By attaching a click handler to the button we can tell the form where we want it to go. Therefore keeping our controllers actions very slim.
Here’s the jQuery:
// This assumes your buttons have id's "save-button" and "update-button"
$("#save-button").click(function () {
// Redirect to add facility for Credit Exposure
var form = $(this).parents('form:first');
form.attr('action', '<%=Url.RouteUrl(new { controller = "foo", action = "save" }) %>');
});
$("#reload-button").click(function () {
// Redirect to add facility for Credit Exposure
var form = $(this).parents('form:first');
form.attr('action', '<%=Url.RouteUrl(new { controller = "foo", action = "reload" }) %>');
});
Now when the user clicks “Save” they will go to the “Save” Action on the “FooController”. When the user clicks “Reload” they will go to the “Reload” action on the”FooController”. No more logic switches in the Controller.
You can download and example here (minus the MVC Goo):
Desert Code Camp: Android
May 15th
Thank you for coming to the Introduction to Android Development at the Desert Code Camp Today.
Below you’ll find today’s code and presentation:
Code: http://github.com/donnfelker/Agilevent-Demo
Presentation: (coming later today)
Desert Code Camp Tomorrow!
May 14th
I’ll be presenting “Introduction to Android Development” and “ASP.NET MVC2 with the Spark View Engine”. Sign up for yopur sessions here: http://www.desertcodecamp.com
If you’re in the area, I hope to see ya there!
Android: Odd Error in DefaultHttpClient
Apr 29th
I’m working on a couple of projects that interact with REST api’s and consume JSON data and in doing so I use the DefaultHttpClient from apache, located in the Android framework.
The Error
Last night I was working on a project and kept getting this error:
java.lang.IllegalStateException: Target host must not be null, or set in parameters.
I spent about 20 minutes banging my head against the wall, inspecting through the debugger, googling, etc. Long story short, there was not much info out there on how to fix this error. I found out what it was after another 20 minutes banging my head against the keyboard.
The Issue
I was connecting to website with the following URI:
www.example.org/api/json/get_stuff
The problem is that I was missing the “http://”. Therefore it should have been:
http://www.example.org/api/json/get_stuff
This fixed the issue. The reason is that the scheme was not provided in the URI. As soon as this was changed the entire client worked as expected.
Normally I wouldn’t blog this, but this is one of those issues where if I can’t find the resolution to the issue, I might as well blog it so others can find it when they run into it.