My blog has moved!

You should be automatically redirected in 6 seconds. If not, visit
http://kavachai.com
and update your bookmarks.

Friday, May 22, 2009

How to bring back "File Explorer" window in Eclipse DDMS

I accidentally closed File Explorer in DDMS view in Eclipse. Unfortunately I couldn't just use context menu to bring it back. It takes a longer way to fix such a mistake.

You'll have to do this using main menu:
  • Window > Show View > Other...
  • Under "Android" node there is "File Explorer"
  • Select it and click OK.

Comparing strings in Java

My nearest project will be for Android platform and this week I was exploring the platform and Java since last five years I've been developing using Microsoft .Net.

Yesterday I needed to check if response status from web service is eqaul to "ok". I was influented by .Net experience and did it just like this:
if (responseStatus == "ok")
I didn't expect this will not work. After some digging in Java documentation I found out that by using "==" operator I compared addresses of strings instead of contents.

The right ways to compare strings in Java are:
if (string1.equals(string2))
if (string1.equalsIgnoreCase(string2))

Friday, May 15, 2009

BlackBerry and Android platforms

Next project I'll be working on will be for cell phones. I'm not sure about the platform (we're thinking of BlackBerry or Android).
So last four days I spent checking out their SDKs. I'd like to share my impression of them.

Let me break it into several steps I went through.

Web site

Android site looks positive and leaves a feeling of openness.
BlackBerry web site looks more like a part of business and does not provide positive emotions. On the same time I felt like these guys from RIM didn't finish their job. I don't complain about the need to register (that's not a big deal), but forms for registration and downloading are like unfinished paintings. Looks fine, but doesn't feel good.
And a few words about the content. I think that content is pretty good on both sites. Probably it is better structured on Android site. Special thanks to BlackBerry for videos: it's faster than reading and it inspires to eat it all (when I read sometimes I skip parts to come back in minute which is not productive, but it's a habit I'm fighting with).

Installation

Android is a winner here. No issues at all, just followed instructions on web site.
Installing BlackBerry took much more time. And I must confess that I couldn't install Eclipse plug-in. After fighting for an hour (half of which took the download itself) I quit. That was after I installed and tried BlackBerry JDE otherwise I would proceed fighting with installer. Installing BlackBerry JDE did not bring much problem thanks to a tip with PATH variable (http://moazzam-khan.com/blog/?p=52).

Playing with development

Two main points here are: I liked Eclipse more then BlackBerry JDE and there is Eclipse supports drag&drop designer to create forms for Android.
Second one is a big plus because it allows to not digging into xml used to present forms for Android. Also looks like there is more standard GUI controls for Android.
In general working with Android brings a bit more pleasure.

Running/debugging and Emulator

When working with Android all you need to do is run your code from Eclipse and it will automatically started on emulator.
With BlackBerry the story is not so clear. After running application from BlackBerry JDE you need to manually go to Downloads menu item in emulator and run app there. After this JDE will hook up application and debug will be available.
Also I'd like to say that I had to create AVD (Android Virtual Device) for SDK version 1.5 because after installing SDK 1.5 I had emulator only for version 1.1. It was pretty simple following instructions from Android developers site.

Documentation

Both SDKs have good documentation. Android has clearer documentation and because it is on developers site it leaves a better feeling.


So my opinion is that developing for Android should bring more positive emotions to the life.