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.

Tuesday, April 7, 2009

Multiple Models in One Form

At "The Pragmatic Bookshelf" there is an extract from "Advanced Rails Recipes" by Mike Clark that explains how to properly handle dynamic creation/removal of the dependent models on one form using ajax.
Here is the link Recipe 13.

Monday, March 23, 2009

Handling move from Rails 2.2.2 to 2.3.2 version

As I preffer to work on virtual machines (by the way my personal choice is VMware) I used one of them while getting in touch with Rails. I had version 2.2.2 installed there.
Today I created a new VM for working with Rails and found out that 2.3.2 version of Rails appeared there as a result of installation. New version of Rails arrived :)
Unfortunally I was not able to run any of my demos :(

To fix this issue I started with change in "config/environment.rb" by updating
RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION
to
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
Then I had to run "rake rails:update".

Thats it. These two steps brought demos to life :)

Monday, March 16, 2009

Borland C++ 3.1

Today I needed to check some code in C++ and decided to use old good Borland C++ 3.11 just because it's fast to install it.
Unfortunatly I found out that my copy of it died together with my external drive :((
I must confess that it was not such an easy thing to find working download link on the web. But I found one at http://www.eni4ever.com/downloads.php?cat_id=1. This page also contains links to some old IDEs for other languages.

Friday, March 6, 2009

Blogger and Picasa are connected

Just discovered connection between Blogger and Picasa. I don't use Picasa to hold my photos. So when I navigated to Picasa on web from my Gmail account I was surprised to find out that I have four images in there.
After eximining what are these images I recognized images from my posts in Blogger. I didn't know about this kind of integration between Blogger and Picasa. Pretty interesting fact.