fredag 17 oktober 2008

Web service for sending SMS

As i might have explained, i work with value added services for operators.
In a couple of weeks we complete a web service that makes it possible to send SMS.
The mainadvantage of this interface is that you can connect to your operator and all the SMS that you send from your web service client would be charged in your operator bill.
If you are interested, you could try it out : http://blog.mobispine.com/2008/10/ws-10-is-soon-here.html

It's all based on SOAP through HTTP(S) and in the first version you can send SMS.

måndag 15 september 2008

I like Google Web Toolkit

It took me some time before i started to play around with Google Web Toolkit but i must say i like. I use Netbeans 6.1 and following these instructions it was extremly simple to set up.

I tried some simple stuff just to start with. For example changing style of text and buttons through the CSS and it was easy. Next thing i wanted to do was to migrate Google Maps with GWT. Unfortually i must say that i was really dissapointed.

First i tried to use Google official Java implementation for Google Maps and it failed. (http://code.google.com/p/gwt-google-apis/wiki/MapsGettingStarted ) I had big troubles with Java Heap Space error and nothing solved this problem.

Next step was to try another library not supported by Google. (http://sourceforge.net/projects/gwt/)
I had some trouble with as well because it used a Long return value in class and GWT gave big NO NO.

Third step was to use native methods in my GWT classes and finally i could start to communicate!

Example code:

final AsyncCallback callback2 = new AsyncCallback() {
public void onSuccess(Object result) {

String position = (String) result;
printLittle(position);
String x = position.split(",")[0].trim();
String y = position.split(",")[1].trim();

setMap1(x,y);
}

public void onFailure(Throwable caught) {
lblServerReply.setText("Communication failed");
}
};
....
private native void setMap1(String x, String y)/*-{
$wnd.setMap1(x,y);
}-*/;


Notice how the native method setMap1 is written.

This made it working and i plan to implement some things i've been thinking about.

I really like GWT, easy to start with and easy to integrate with other javascript.

Next step is to try out Jmaki that comes with Glassfish and see what it can provide.

lördag 30 augusti 2008

FindBugs is cool

This week we started to use a new tool in our biggest project called FindBugs. I read about this tool in Java Power Tools.

What this tool does is to find code that has bugs or has some other errors that you should take care of. These are issues that you compiler wont tell you.
Some examples:

You need a instance of Long and you do like this:
Long l = new Long(1);

if (l != null && l.equals("null")){
....

Java compiler wont say anything but probably you will get in trouble when this code is executed because you executing equals againts a String instance.

Another example is that how you should create Number instances:
Long l = new Long(1);

Better way is using Long.valueOf(1) and this is what findbugs will tell you.
Or in some situationes using autoboxing.

These are only some examples and there a lot of more situations where FindBugs will help you.

We have a small project with about 10 classes and a couple of thousand lines of code. I used FindBugs on it and cleared all warnings and errors. There where about 100 of those before. Extremly cool to have something not generating the smallest warning.

This tool was extremly simple to install in Eclipse (http://findbugs.cs.umd.edu/eclipse/) and to make a task for it in Ant is 5 minute work.
Now im thinking what tool we could start using in the project next week.

måndag 25 augusti 2008

Google is cool

I was looking around in Google labs to find some cool stuff and acctually i did ! :-)

I found http://www.lively.com/popular. I played around and started too feel like a children that plays around :-)

Its a three dimensional world where you can interact with others. Not not only chat, you kiss them, hug them, shake their hands or even kick their asses! Little violent put pretty cool :-)

I say try it, probably you a couple of hours to spend in there.

Who am i

Im a system developer working at Mobispine . We have a product called eSMS which is used for sending SMS/MMS from computers and its mainly the product i work with .

Im a Java guy and this blog will mainly be about my experience and opinions in different isues concerning Java and other cool tehnologies.
Hope someone likes it, otherwise dont read it :-)