Saturday, December 29, 2007

gcc and the eclipse CDT on the eee

Eclipse is not just for Java-centric development. The C/C++ Development Tools (CDT) provides solid support for developing applications written in C or C++ as well. I set about to test this on my eee PC where I already had eclipse set-up for Java development with GWT.

First, I needed to install gcc on the eee.

I did this in the following three steps:
1. I edited /etc/apt/sources.list and added the following line:
deb http://ftp.us.debian.org/debian/ stable main contrib non-free

2. As super-user (sudo su) I ran apt-get update from the command line. This will update the packages lists.

3. Then I did an apt-get install build-essential
Press Y when asked if its okay to install.

Once I tested an a.out "Hello, World!" app generated from a test.c file from gcc from the command line I grabbed CDT 3.1.2 (2/15/07) instead of the newer CDT 4.0.2 (11/30/07) from the Eclipse CDT Download page.

Unpacking org.eclipse.cdt-3.1.2-linux.x86.tar.gz yielded a 13MB folder with an easy to run install.sh which installed the plug-in.

I fired up eclipse and set about to write a Managed Make C Project "Hello, World" app:


And then I tried a "Managed Make C++ Project" CPP "Hello, World C++" app:


I had Adobe Acrobat, a terminal window, the File Manager, Firefox, and eclipse all up and running while surfing the web via Wi-Fi (several open tabs) and compiling a small array manipulation C++ program.

The performance and versatility of the eee continues to surprise me.

Saturday, December 22, 2007

Three Great Google Tools: GWT, Maps API, Gears

Today I spent some time reviewing three amazing Google tools:
1. GWT, 2. Maps API, and 3. Gears.

First, I took a look at the Google Web Toolkit (GWT) which is an open source Java software development framework that makes writing AJAX applications easy for Java developers (meaning you don't need to speak or code in Javascript).

I played around with Build 1.4.61 (11/29/07, 24MB Linux) on my eee PC.

I built a "Hello, World" GWT app in minutes and tested in hosted mode using the following three provided shell scripts:
1. projectCreator -eclipse MyProjectName
2. applicationCreator -eclipse MyProjectName com.abc.client.MyApp

By running the next shell script two windows appeared: The GWT development shell (this is kind of like a console window) and a web browser window.
3. MyApp-shell

Once you click on the 'Click me' button then a "Hello World!" string appears next to the button.

From here you can fire up eclipse and File > Import... the project and go to town with it.


There are tons of resources that Google has put up like presentations, videos, tools/libraries, articles/tutorials, ebooks, you name it.


I found "Google Web Toolkit: Taking the pain out of Ajax" by Ed Burnette to be a very helpful guide providing guidance on the GWT installation process and the creation of your first GWT app. This book covers UI elements, Remote Procedure Calls, History/Bookmarks, JNI, Internationalization (I18N), and Java Emulation.

Second, I took a look at The Google Maps API which is a great way to introduce you to the world of web mapping. When Google Maps first came out in 2005 it popularized Ajax and the Web 2.0 way of looking at web apps. With the Maps API you don’t have to worry about finding and managing your own data, installing and configuring your own server, or even creating your own cross-browser AJAX mapping framework from scratch. It’s a programmer’s delight! With a little bit of JavaScript and a few latitude/longitude points, you'll be ready to embed Google Maps in your own web pages. Amazing!

Finally, I took a look at an open source Google tool in Beta called Google Gears that aims to fix the airplane issue: a browser extension that lets developers create web applications that can run offline. Again, even though in Beta, tons of resources for developers are provided by Google including videos, developer guides, and API guides.

Where to start!

Wednesday, December 19, 2007

The Java Real-Time System

Today I attended the final event of the year for the New York Java Special Interest Group, aka the NY JavaSIG, on the topic of real-time Java.

Looks like with the improvements in Java performance, more and more firms are starting to use Java technology to implement more and more of their critical software, and thereby realizing developmental productivity gains over more traditional C/C++ development. The problem is time-critical systems have no guarantee that, at any instant in time, the process will not be interrupted by the Java Garbage Collector, or other higher-priority processes. That's where the Java Real-Time System comes in.


The presentation was given by Eric Bruno of Sun Microsystems.
A couple of articles of interest written by Eric that he noted on this topic were:
1. Go Inside the Java Real-Time System
2. Java RTS Real-Time Enables Financial Applications

One special note for me was that the event was held at Google's NY Sales & Engineering Office on the 4th floor so this provided me the opportunity to look first hand at the work environment at Google. It looked like the entire place was in a loft on one large floor. Very cool.

Sunday, December 16, 2007

eclipse on eee PC

Today I installed the Android SDK and eclipse (with the ADT plug-in) on my eee PC. Actually, I installed EasyEclipse Expert Java (easyeclipse-expert-java-1.2.2-2.tar.gz, 122MB).

The trick was the unpacking. I was unpacking 1.3.0 to my SD card which is a FAT partition and this was having the effect that the file permissions were coming out all messed up. At first I thought it was some compatibility issue with 1.3.0 and I tried again with 1.2.2 but got the same results. Once I unpacked to the internal flash drive (I ended up with 1.2.2) and renamed the jre sub directory in sub directory easyeclipse-expert-java-1.2.2 to jre_unused so that eclipse can use the system jre instead of the jre distributed in the download it worked.


I went through the "Hello, World!" tutorial which hung on me once (requiring a reboot). It took some tinkering with the Run setting to finally get the console to display the output but then it worked like a charm.


For those who wonder about performance I was listening to my mp3s while I was doing the tutorial and had Firefox opened as well reading the Sunday NY Times -- which btw featured a great article on GOOG vs MSFT in case you missed it.

Thursday, December 13, 2007

Gutsy Gibbon in vmware


I finally installed ubuntu 7.10 in a vmware virtual machine on my XP box to start to play with it. What I was really interested in was:

1. making beryl work but I'm having some trouble since I'm inside a vmware instance. if you haven't heard of beryl (an OpenGL accelerated desktop which is a combined window manager and composite manager) check out this 4 minute youtube video which has garnered more than 1 million hits which gives an impressive demo. there are other related videos this will pull in. more precisely there is a video of beryl on a eee!

2. eventually installing ubuntu on my new eee. I was going to do it from the how-tos but it looks like they are assembling a nicely tweaked and optimized Ubuntu version for the eee and polishing off what they call eeeXubuntu over at the eeeuser forum. they also posted how to get beryl working on the stock distro.

But I'm already getting used to the xandros distro (debian fork not considered to be debian compatible) on the 800 x 480 screen that comes with the eee although beryl on my eee would be cool.

Today I learned you can open a terminal window by clicking Ctrl+Alt+T. I next typed in "konqueror" to get the konqueror browser up. I also installed the littlefox theme on Firefox to squeeze a little more real estate onto the browser window. btw skype worked out of the box and I made some calls already on it with really crisp voice quality over wi-fi.

Not bad considering I just got my little black eee today from UPS after buying it at bestbuy last Friday (btw: already back-ordered if you're thinking of doing the same for X-mas).

One thing I'm noticing too is that with my Mac mini, N800, ubuntu vmware, and now my eee laptop I really find little use for actually using Windows.

Sunday, December 02, 2007

Android on Ubuntu 7.04, Feisty Fawn


Today I installed Android on my vmware emulated Ubuntu 7.04 instance of Linux running on my Windows XP PC by following the below three easy steps.

1. The SDK
First, I downloaded the Android SDK for Linux (currently versioned at m3-rc22a and weighing in at 55 MB). I unpacked the archive in my home directory.

2. The IDE
Then I downloaded Eclipse for Linux (currently eclipse-java-europa-fall2-linux-gtk.tar.gz weighing in at 78.6 MB). I unpacked this in my home folder as well.

3. The Plug-in
Finally, I installed a custom plugin called the Android Development Tools (ADT), which adds integrated support for Android projects and tools. To download and install the ADT plugin, set up an Eclipse remote update site as described in the steps below.

1. Start Eclipse, then select Help > Software Updates > Find and Install....
2. In the dialog that appears, select Search for new features to install and press Next.
3. Press New Remote Site.
4. In the resulting dialog box, enter a name for the remote site (e.g. Android Plugin) and enter this as its URL:

https://dl-ssl.google.com/android/eclipse/

Press OK.
5. You should now see the new site added to the search list (and checked). Press Finish.
6. In the subsequent Search Results dialog box, select the checkbox for Android Plugin > Eclipse Integration > Android Development Tools and press Next. Currently, ADT 0.3.1.
7. Read the license agreement and then select Accept terms of the license agreement, if appropriate. Press Next.
8. Press Finish.
9. The ADT plugin is not signed; you can accept the installation anyway by pressing Install All.
10. Restart Eclipse.
11. After restart, update your Eclipse preferences to point to the SDK directory:
1. Select Window > Preferences... to open the Preferences panel. (Mac OS X: Eclipse > Preferences)
2. Select Android from the left panel.
3. For the SDK Location in the main panel, press Browse... and locate the SDK directory.
4. Press Apply, then OK.

That's it!

To test it I created my first Android project by follow these steps:

  1. Select File > New > Project
  2. Select Android > Android Project, and press Next
  3. Select the contents for the project:
    • Select Create new project in workspace to start a project for new code.

      Enter the project name, the base package name, the name of a single Activity class to create as a stub .java file, and a name to use for your application.

    • Select Create project from existing source to start a project from existing code. Use this option if you want to build and run any of the sample applications included with the SDK. The sample applications are located in the samples/ directory in the SDK.

      Browse to the directory containing the existing source code and click OK. If the directory contains a valid Android manifest file, the ADT plugin fills in the package, activity, and application names for you.

  4. Press Finish.
I selected the HelloActivity sample and ran it which popped up the Android Emulator. Next, I'll start on the exercises one by one. Probably the Hello, Android! project would be the best place to start.

Saturday, December 01, 2007

The Asus eee Galaxy


I've been away from my blog for awhile but I've been looking at this beautiful lap/palm top for the past month. It's $400 and I can't think of a reason why not to get it.

If you haven't heard of it before it is the Asus eee PC or more formally the Asus Eee 4G-Galaxy 7" screen PC Mobile Internet Device (512 MB RAM, 4 GB Hard Drive, Linux Preloaded) and now comes in Black. It is all solid-state flash so it should be blazing fast and light as a feather. Don't know what I'll do with my N800 or as I call it poor man's iPhone once this little baby arrives. I love my N800 and saw all of Mad.Men on it's little screen while talking to my Skype friends via wi-fi.

Although you can install XP on this and even a MacOS X Leopard hack it comes with Linux so why bother. The distro is Xandros based.

This looks like the perfect laptop to develop some Android app on.

By the way if you are wondering how to pronounce either Asus or eee check this out. The comments are hilarious:
How to pronounce Asus and eee PC