Wednesday, March 26, 2008

Eclipse: Powerful Open Source IDE

Eclipse is an open source software project dedicated to providing a strong, full featured, and industry level platform for developing and supporting highly integrated software engineering tools. Excluding small Eclipse Runtime Kernel, all other components are “plug-in”, integrated through pre defined extension points. Eclipse platform defines set of frameworks and common services that collectively makes an integration-ware. Almost 1565 Eclipse plug-ins are available which can easily download and installed.

Fundamentally, Eclipse is a framework for plug-ins. Besides its runtime kernel, the platform consists of the workbench, workspace, help, and team components. Other tools plug into this basic framework to create a usable application. Plug-ins add functionality through predefined extension points that the Eclipse platform offers. Plug-ins can also define new extension points for others to extend. This plug-in architecture provides a flexible, open, scalable, tool-integration solution. With the open Eclipse platform, you can customize a component or extend it to suit the needs of your development environment.
The Graphical Modeling Framework, a representative integration project built on Eclipse, consists of a plug-in set that bridges between the Graphical Editing Framework and the Eclipse Modeling Framework platforms. GMF extends and integrates GEF and EMF seamlessly so that application developers can fully utilize GEF’s visual-representation capability and EMF’s data-representation capability to build graphical modeling editors. The GMF plug-ins for diagram editing provide a set of services that you can use to extend graphical editors. GMF also leverages other Eclipse plug-ins, such as EMF Technology-Transaction, Validation, and Object Constraint Language, to enable model-level validation.

Eclipse is a cost-effective, productive development environment to support life-cycle software development through effective tool integration. The flexible plug-in architecture and resource management let organizations customize and extend Eclipse to meet their engineering processes, tool integration, and project management needs.

Useful References
For basic concepts about the Eclipse plug-in architecture, extensions, and examples, see the Eclipse Foundation site (www.eclipse.org), especially www. eclipse.org/articles/Article-Plug-inarchitecture/plugin_architecture.html. Good overviews of existing plug-ins, especially plug-ins in their early development stages, are available at http://eclipse-plugins.info/eclipse/index.jsp and http://www.eclipseplugincentral.com/.
Eclipse-related publications are available at www.eclipse.org/resources/index.php.
For detailed information about how to set up Tomcat and JBoss in Eclipse for J2EE development, see www.purposesolutions.com/Resources/EclipseJ2EE.html. The Eclipse Project Resource Center offers many tutorials, articles, magazines, plug-ins, cheat sheets, conference lists, and the latest books at www.deitel.com/Eclipse.

Saturday, March 22, 2008

SWT (Standard Widget Toolkit)

The Standard Widget Toolkit (SWT) is a graphical widget toolkit for use with the Java platform. It was originally developed by IBM and is now maintained by the Eclipse Foundation in tandem with the Eclipse IDE. It is an alternative to the AWT and Swing Java GUI toolkits provided by Sun Microsystems as part of the Java Platform, Standard Edition.

SWT is a graphics library and a widget toolkit integrated with the native window system especially with Windows but Linux and Solaris are supported as well. SWT is an OS-independent API. SWT can be seen as a thin wrapper over the native code GUI of the host operating system.

SWT is written in Java. The design strategy of SWT was focused on building a simple, essential library that would produce GUI applications closely coupled to the native environment.

SWT has been designed to be as inexpensive as possible. This means that it is native-oriented. Anyway, it differs from AWT in a number of details. SWT provides different Java implementations for each platform, and each of these implementations calls natively (through the Java Native Interface, JNI) the underlying native implementation. The old AWT is different in that all platform-dependent details are hidden in C (native) code and the Java implementation is the same for all the platforms.


Resources:

An important difference from normal Java programming is the way OS-dependent objects are managed in SWT. Swing emulates a large part of such objects (such as widgets, for instance) in Java, leaving the disposal job to the JRE garbage collector. This saves a lot of complexity for the programmer but this lack of control can lead to some unexpected issues, especially with cross-platform development.

SWT designers chose a different approach, obliging the developer to explicitly dispose of OS-dependent objects in the application code. SWT has been designed with efficiency in mind, so handling explicitly OS resources becomes an occasion to promote efficient programming and not just a necessity. Resource disposal is needed to free the OS resources used by the SWT application. Such OS resources need to be explicitly de-allocated by invoking the dispose method.

In practice, disposing of objects is a delicate business and it can lead to unpredictable results whenever another object tries to access an already disposed item.

The Basic Structure of an SWT Program

As already said, an SWT program relies upon the native platform resources (wrapped by the Display class, as we will see later on) both in terms of allocated resources (such as colors, images, and so on) and as regards the event mechanism. As regards event handling, in SWT there is only one thread that is allowed to handle native user interface events.

We now see the basic structure of an SWT program.

There are two basic classes used in any SWT application, the Display and Shell classes. Instances of the Display class are responsible for managing the connections between SWT and the underlying operating system, enforcing the SWT models (for colors or images, for example). The Shell class instead represents windows managed by the platform-dependent desktop manager.

Typically, an SWT program will first create a local resources manager (an instance of the Display class) and attach all the needed widgets to one or more Shell objects.

A snippet of code showing the use of the Display and Shell classes.

00:     Display display = new Display();
01: Shell shell = new Shell(display);
02: //GUI code here
03: shell.open();
04: while (!shell.isDisposed()) {
05: if (!display.readAndDispatch())
06: display.sleep();
07: }
08: display.dispose();
09: }
10: }

Basic Controls

Some of the basic components are the following:

  • Button. This component is the well-known button component used in toolbars, forms, and so forth.

  • ComboBox. This widget is the well-known combo box component.

  • Label. This component represents a (non-selectable) object that displays a string or an image.

  • List. This widget represents a basic list component.

  • ProgressBar. It shows a progress indicator.

  • Sash. It is the Swing equivalent of a JSplitPane. It is a widget that can be dragged to resize two areas in a GUI.

  • Scale. This component implements an editable GUI item representing a range of continuous numeric values.

  • Slider. This component represents an editable object that stands for a range of discrete, numeric values.

  • Table. This component represents a basic table.

  • Text. This component represents a basic text area.

  • Tree. This component represents a basic tree widget.

  • StyledText. This component represents a text area with styled fonts and other advanced attributes.


Thursday, March 13, 2008

Fedora VS Ubuntu

Fedora and Ubuntu, both are popular among people who like Linux Environment. The question arises in one’s mind is, what’s the difference between two?
In many ways Fedora and Ubuntu family are similar, both tend to focus on Gnome and give you a great deal of bleeding edge software. Ubuntu was found by Mark Shuttleworth and sponsored by Canonical Ltd. It is currently one of the most popular GNU/Linux flavors. Fedora is a general purpose system; it does not concentrate on one specific market. It is suitable both for home users, programmers and the corporate server. In each case it requires some customization however, Fedora Core stability is comparable to similar distros like Ubuntu or openSUSE. There are many efforts to make the software testing within Fedora Core even better by implementing an automated test system. Ubuntu is based on Debian, which is one of the most stable and mature distributions available. Still, Ubuntu comes with fresh software and instabilities may occur. Kubuntu on the other hand is considered a bit worse in terms of stability since recent versions of KDE usually break more often that fresh GNOME.
Ubuntu's stated purpose is to replace Windows but their first bug is that Windows is more popular. As such, they strive to make it as user-friendly as possible, and you will often, but not always, find that things work with less effort on Ubuntu. Ubuntu and the rest of its family use a live installation disk which more attractive for new users. Fedora, regardless of the latest official line, is more or less a testing ground for RedHat, they often put in new things, and might not test them as thoroughly as they would be tested.
Ubuntu uses sudo for everything, they discourage even giving root a password. Fedora makes sudo a bit more difficult to use for the non-root user since even with sudo. Ubuntu uses the apt system for package management; you will find it faster than yum. To the end user, in many ways, it's simply a matter of getting used to the syntax of one or the other.
As someone who prefers BSD and the far more minimalist ArchLinux, both distros strike as having too much installed as default as well as too much reliance on GUI tools, but this is just my taste. Might be one reason that many professionals use Fedora, because it's what they use at work, so using it at home makes you more comfortable with it, and better able to act reflexively if there are problems.
For a beginner, it would be more appropriate to recommend Ubuntu. Not because Fedora is bad, but Ubuntu is aimed more at the beginner. That’s the reason the Fedora forums seem more mature, many Fedora people are people who've been using Linux for years and started with RedHat.

Android (Mobile Phones Platform)

Android is a software development platform for mobile phones based on the Linux operating system. It is developed by Google and the Open Handset Alliance.

Android is a software "stack" for mobile phones that's based on open-source software. Android is called a "stack" because its software extends from the lowest levels controlling the phone's hardware to the highest levels of user interaction. At the bottom is a stripped-down version of the Linux kernel. On top of the kernel is the open-source WebKit Web browser and several other open-source programs.

We can't run Android on a phone that we might have today. Instead, manufacturers like HTC, LG, Samsung, and Motorola (all OHA members) will need to adapt it to future handsets. If the consortium has its way, these phones will be available in stores in the second half of 2008. You'll also be able to buy an Android-based phone over the Internet and drop in a chip from the cell phone that's in your pocket today, assuming you have a cell phone from T-Mobile, AT&T, or another provider that uses the GSM transmission standard.

On 12 November 2007 the OHA released a preview of the Android software development kit which includes development and debugging tools, a set of libraries, a device emulator, documentation, sample projects and tutorials. Developers are required to download the Android SDK to an x86-based computer running Windows XP or Vista, Mac OS X 10.4.8 or later, or Linux.

Java Development Kit, Apache Ant, and Python 2.2 or later are also required. Eclipse 3.2 or later is the only officially supported IDE through Android Development Tools Plugin but the programmer is free to use command line tools to create, build and debug Android applications.

Android has the following Features:

Handset layouts : The platform is adaptable to both larger, VGA, 2D graphics library, 3D graphics library based on OpenGL ES 1.0 specifications, traditional smartphone layouts.

Storage : SQLite for structured data storage

Connectivity : Android supports a wide variety of connectivity technologies including GSM, Bluetooth, EDGE, 3G, and Wi-Fi.

Messaging : Both SMS and MMS are available.

Web browser : The web browser available in Android is based on the open-source WebKit application framework.

Java virtual machine : Software written in Java can be compiled into Dalvik bytecodes and executed in the Dalvik virtual machine, which is a specialized VM implementation designed for mobile device use, although not technically a standard Java Virtual Machine.

Media support : Android will support advanced audio/video/still media formats such as MPEG-4, H.264, MP3, and AAC, AMR, JPEG, PNG, GIF.

Additional hardware support : Android is fully capable of utilizing video/still cameras, touchscreens, GPS, compasses, accelerometers, and accelerated 3D graphics.

Development environment : Includes a device emulator, tools for debugging, memory and performance profiling, a plugin for the Eclipse IDE.


Tuesday, March 11, 2008

We are back!

I am blogging again after a while. It has been a very busy few months as we have been building our Engineering team.

This blog should be more active now as I have also recruited members of my team to start contributing here.

From next week, I will resume my review of open source technologies. I wanted to take this post to introduce our new contributors: Naveed, Umair, Usman and Waqas. You can view their profiles on the right.

I would also like to let you know about the two other blogs that people from TMM are contributing to: Small Business Marketing, Sea Frieghts
OpenWrt for Wireless Access Points


Introduction


OpenWrt as the name suggests is open source i.e. the source code is available for free, it has no subscription fee and there are no commercial versions with extra features. It is a GPL (GNU General Public License) Linux distribution for wireless routers. OpenWrt is designed to be customizable and modular so that new features can be added as modules in the forms of packages. Instead of trying to cram every possible feature into one firmware, OpenWrt provides only a minimal firmware with support for add-on packages. For users this means the ability to custom tune features, removing unwanted packages to make room for other packages and for developers this means being able to focus on packages without having to test and release an entire firmware. OpenWrt primarily uses a command-line interface, but also features an optional web-based GUI interface. Technical support is provided through the forums and IRC channel.


Variants


There are two versions of OpenWrt

  1. whiterussian

  2. kamikaze

whiterussian is the older, more properly documented and the more stable of the two but its development ha stopped since February 2007. Whereas kamikaze is the newer version with a different design that supports a wide range of devices. Currently it supports devices from more than 75 manufacturers that include MikroTik's RouterBoards, LinkSys, D-Link, 3COM, Asus, Dell, Microsoft, Motorola, Netgear, Philips, Siemens, Toshiba and the list goes on. It has a new kernel and is stable but work is in progress.


Features


The biggest change is probably the addition of webif, the Web-based Admin Console that lets you install and remove packages with a click or two. There are more applications available for OpenWrt almost every day. in addition to webif, OpenWrt has a fully writable JFFS2 file system, which allows for package management via the ipkg package system. This makes OpenWrt very versatile and adaptable to any particular situation. You can add new packages. Supports all networking and security stuff like VPN, firewall, DHCP, VLANs, WPA encryption, iptables etc.


Conclusion


With OpenWrt, friendly and helpful volunteers have created a powerful and fun Linux system that replaces the default Linksys firmware. You can use OpenWrt to implement everything from programmable VLANs to intrusion detection on a compact, fan-less box. With OpenWrt, you will be amazed at what free software is up to these days.