open iphone application development

Today, I started hacking my iphone and built my first application with the help of the book iPhone Open Application Development. The dev environment setup took some 3 hours – copying the frameworks from iPhone, setting up the tool-chain and building it. But finally I was able to build something.


With my recent experience of learning cocoa/objective-C, the development seemed pretty easy and straight forward. I just created a project template and a shell script to automatically copy my new application to my iPhone. The API was also simple and straight forward.

I’ve got the official iPhone developer invitation as well, which I’m going to purchase by this month end or first week of next month. My only gripe about Apple’s SDK is that I cannot run the application I wrote on my own iPhone. I can only test the app in Simulator, but for the time being I prefer the hacked version of open development.

Bean Shell Compiler

Bean Shell makes your Java programs scriptable. Recently I started working on it. BeanShell provides its own JavaScript-like syntax to access your Java Objects. You can even change the syntax to anything you like using JavaCC. I started playing with it. BeanShell uses a Parser and Abstract Syntax Tree (AST) to tokenize the code. Here’s a small class for compiling the BSH script, before sending it to the interpreter.

JMX HelloWorld

Introduction

JMX or Java Management eXtensions gives you the ability to manage programs remotely. I’ve been working on JMX in one of the SOA application. I would like to share how my first program in JMX has been written and deployed onto JBoss. The MBeans are also know as Platform MBeans (MBeans – Management Beans). You can use JMX to remotely invoke the function on an object. In layman terms, JMX MBeans can be used as "Remote Control" for the "Object that implements the MBean". Using the MBean the object’s operations can be invoked remotely. The JBoss application server has been constructed over a microkernel that uses JMX specification. Every service JBoss provides is an MBean or collection of MBeans. Different kinds of MBeans and notifications are not covered in this article. This article just explains two examples: The plain MBean (HelloWorld), and creating and deploying MBean in the JBoss as an SAR (Service Archive).

The HelloWorld MBean

As already told, MBeans are a way to control the Object remotely. A JMX Agent will expose the MBeans to the platform. Here are the setps to create the first Manageable Object using MBeans.
Step 1: Create the HelloWorldMbean class with sayHello method (Note: MBean interface to be named as ***Mbean):

Step 2: Create the Implementation for the MBean:

Step 3: Create an Agent that exposes the MBean to the platform, so that we can manage it remotely:

Once the three classes are created, compile all of them, and then run the Agent class using the command java -Dcom.sun.management.jmxremote com.vijaykiran.jmx.HelloWorldAgent If you are using Eclipse then, you need to set the VM arguements in the "Run…" dialog. If you want you can download the Zip file Eclipse Project at the end of the article. Now your Agent is running and exposed to the platform. If you want to invoke the function, goto command line and use the jconsole command to strart the JMX console. The command is in your Javabin directory.

Click on Connect, then goto MBeans Tab. You’ll find com.vijaykiran.jmx package on the left, and expand it to get the HelloWorld Mbean. And then select it and on the right pane, click on the Operations tab. You’ll find the sayHelloButton(). Click on it, and your method is ivoked via the exposed MBean.

XUL tutorial

Mozilla platform provides framework and components to develop crossplatform rich client applications. Mozilla platform contains various technologiy implementations like AJAx, CSS, HTML, DOM,JavaScript, XML, RDF, RSS, XUL, XSLT and XML.

Mozilla provides XPFE (Cross Platfrom Front End) Framework to build the rich cross platform applications. The XPFE contains three basic parts: XUL, JavaScript and CSS. XUL defines the interface, JavaScript is used to attach the behaviour and logic to the interface. CSS does similar part as with HTML, it provides styles and varaiations of the interfaces.

XUL is the XML User interface Language, which lets the developer build rich cross platform applications, that can be run online or offline. Since the behaviour, interface and locale&skin are completely disconnected, they can be very easily customized and localized. XUL is based on XML, so its very easy to learn and get started. In these series of articles I’ll try to explain how I’m developing a small application using Mozilla platform.

Links

Mozilla
Mozilla Developer Wiki
XUL Planet