Sunday, March 13, 2005

Moblogger MIDP2 version 0.9 released!



I am exited to announce that my mobile photo blogging application that I bloged about few weeks back is now an open source project at sourceforget.net. I started it as a fun project but then I started using it big time, so I figured it kind of made the case for an open source project. Moreover it has been a good learning experience for me as this is my first open source project. Guys at sourceforge.net are awsome I gotta tell ya! They provide such wonderful service with excellent support - for FREE! I think I'll briefly share my experience starting the project - in case you have a good project idea but could use some jump starting - documentation at sourceforge site is pretty exhaustive, exhaustive enough to scare away potential users!

First step is registering an account at sourceforge.net. All you need is a valid email id. Once you are registered and logged in, you need to raise a project registration request. There are a few steps you need to go though, specifying your project details, selecting the open source licence type that you would use, agreeing to sourceforge.net terms etc. Make sure you set a valid name with valid first and last names as your true identity on your account before hand. My project was rejected initially because I used my initials for last name - the usual indian way. Also make sure you have a good description of the project - some selling like why you think it should be an open source should help! But like I mentioned earlier, their support is amazing and normally your project should get approved in a day or two.

Once the project is approved, you could start the development. Since I already had a working version of the application, I just directly checked in the source after making some refinements, add proper comments etc. Sourceforge.net basically provides you with two types of server access. One is for CVS and other is a regular shell that you can use for running scripts, cron jobs etc. Btw ssh is the only mechanism to access the servers. You can follow these instructions to download and configure ssh tools (if you dont already have one) and generating keys. You have a couple of options with the source, you can either use the sourceforge.net CVS service or maintain it elsewhere and SFTP only downloadable version. I have checked in the source to sourceforge.net CVS. Again you can either use WinCVS(with ssh) as described here or directly logon to the shell and then access CVS from there. I choose to use the second option as I dont like WinCVS - bit clumsy for me.

In order to make your project publicly downloadable, you need to use the sourceforge File Release System by selecting "File Release" link from project Admin screen. Typically a downloadable module contains the source(ofcourse!), the executable/deployable, Release notes and documentation. You could generate the deployable module using the sourceforge.net complie farm. The compile options are quite exhaustive and supports a wide varitey of OSes and development platforms. But as I didnt find a J2ME compile option there, I decided not to inlcude a deployable version of Moblogger2 for the time being. Instead I added proper compliation and deployment instructions in my release notes. However you do have the option to create the release module in any place you choose to, it just need to be uploaded in a place as mentioned at the "File release system" documentation. You could use either Securecopy or SFTP to upload the release module.

Here's the best part: Your project gets a free custom website hosted by sourceforge.net which incidently has excellent web hosting facilities! You have full support for PHP4, Apache SSI, CGI (Perl, Python) and MySQL (yes you project gets your own MySQL db) - better than what most (cheap) commercial hosting providers has to offer. I have not created a homepage for Moblogger2 but its defenitley going to happen sometime soon. The URL is defaulted to projectname.sourceforge.net but you could configure to use your own domain if you have one. All you owe sourceforge.net is a small logo that you need to display on your site.

So would you like to contribute in Moblogger2? There sure is plenty of stuff to do: Support for Blogger API, Atom API etc.. the list looooong. Just add a comment below with your email and I will get in touch with you.

Sun certified Associate for J2SE



It seems Sun is launching a brand new certification titled "Sun Certified Associate for theJava 2 Platform, Version 1.0".

Though the details are not very clear at this point, this is supposed to be the new entry level certification in Java. From this post at Javaranch by one of sun's certification managers:
If you are a beginner or an expert who knows exactly what you'd belooking for
when hiring an entry level programmer into your team, thisis your opportunity to
get involved in the creation of the upcomingindustry leading certification exam.
So would this make SCJP a level2 certification? Not sure about that but defenitely makes sense as there are more basic skills that one would expect from a junior developer than Core Java. I mean stuff like Web technologies and protocols, XML, Configuration management, team skills, IDE, OS basics etc are important too. Maybe more important than Core Java and SJCP in case of support and maintenence kind of roles - which is exactly what most entry level positions are. I bet this is the gap sun is addressing with this.

The blueprint survey is on as usual so if you are a beta guy ;) ( you get free beta vouchers in case you didnt know), you can find the instructions to participate at Javaranch forum. I am participating in the survey but about the beta exam... ummm I think I'll say pass this time!

Friday, February 25, 2005

Non generic collections in J2SE 5.0



It seems you cannot use the plain old collection objects - the non generic versions aka "raw" collections - anymore without getting unchecked warnings!

The following code doesn't use any generics but compiler throws unchecked warnings as shown below:

List c = new ArrayList();
c.add(new Object());

>javac -Xlint Test.javaTest.java:10: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List

c.add(new Object());
^
1 warning

Compiler has infact recognized the "raw" type but still decides to throw a generic related - note the type variable E - warning. Price for "guaranteed" type safety I guess!



Food for thought: IT folks are usually skeptical about the X.0 versions and tend to wait for the X.xx before taking the plunge!

Sun Generics tutorial bug



As per the Sun Generics tutorial page # 15, Section 7.3 - Arrays, you can declare array types whose element type is a type variable or a parameterized type, but not array objects.

The sample code there states that the following is legal but would generate unchecked warning.


List<String> c[] = new List<?>[10];


But actually this code doesn't compile and so it doesn't appear to be legal. It seems only unbounded wild cards are allowed for both array types and array objects. So following code is legal and it works too:


List<?> c[] = new List<?>[10];


Very strange this being the "official" tutorial. Hope someone fixes this soon.

Thursday, February 24, 2005

Free IBM certification vouchers!!!



IBM has started giving out free test vouchers (worth $175 ) again! It seems they do it every year for a limited period of time. Here's what you need to do - take the 10$ pre-assesment test at the IBM test site. This test is very easy and it seems they use the same set of questions. It is an online test anyway- no need to go to a test center ;) (Check this link in case you didnt get my drift!). IBM will send you the voucher in 3-4 days once you pass the test. To be eligible, you need to take the pre-assessment before this April 30th and the free voucher itself is valid only till June 30th. Here's the official announcement if you wanna take a look. Many people at Javaranch have already received thier free vouchers and there are only about a 400 or so left it seems - so hurry up and all the best!

Using Commons logging with Websphere



Having trouble running Jakartha commons logging with Websphere?

This IBM link might save you some pain!

Friday, February 11, 2005

SCJP5 (Tiger) , Generics and Concurrency



Took the Sun beta exam for SCJP5 (Tiger) yesterday. I had this free voucher and we were having knowledge sharing sessions on new Tiger features at work - which kind of helped me make my decision but the real point of attraction was the long 5 hour torture! I really wanted to see if I could stand the 5 hour marathon exam with 160+ questions. And I guess I made it even though I got burned out at the end! About after 4 hours into the test I could look at the questions and realize that it is a simple one, but couldn't get myself to concentrate enough to pick the right answer !!! Especially the ones with exhibits (code) - I didn't even bother to click those. I really wonder what the exam authors were thinking when they designed this mammoth. I mean it would be pretty hard to make a fair judgment on the difficulty level based on the test takers performance. Well.. Unless you go to the extreme extent of time slotting exam and judge difficulty level separately for each slots - provided the test engine is capable of capturing all necessary inputs for such an exhaustive analysis!


Content wise I think the exam was pretty tough - lots of generic and autoboxing stuff from the new feature side. But the ones that I got beaten up was the thread ones - not too tough technically but a whole set of lengthy code exhibits combined with the dreaded "this code will not compile/complier error" as a valid option makes them really really hard! However bit of a disappointment with the new concurrency stuff - not even a single question related to any of the new util.concurrent package or the new concurrent collections. Even though it is not explicitly mentioned in the exam objectives, I was expecting a few questions as I think this is one of the most important addition - maybe even more important than generics from a usability perspective. I mean this is stuff that we, Java developers, have been missing for a long time. Btw the drag and drop questions were fun - they have got it right this time and I really enjoyed those.


Anyway now that I'm done with it, I am happy I took it. And the news today at javaranch
is that the beta deadline got extended until March 6 - So plenty of time still if you want to take it - costs only 50$ instead of the regular 150$. But here's my advise - wait for the official 2 hour(or so) exam - because this five hour torture is definitely not worth it.

Wednesday, February 02, 2005

Free gmail accounts giveaway



I've got some gmail account to giveaway if you need. Add a comment with your email below and I'll send one your way - first come first serve! Btw if you didnt know already, you could get gmail invites by starting a blogger account. Thats how I got mine - not sure if it still works though..

Monday, January 31, 2005

SMTP email attachments from nokia 6600 using t-zones



I wanted to post images to flickr fom my phone and realized that the email app that comes with nokia 6600 (t-mobile) doesnt let you send attachments more than 1K! But as always there are workarounds in the net including an firmware upgrade(!) and using one of those third party email apps possibly with an external SMTP server - and people who tried these have had mixed results. To me, none of the options sounded very appealing so I decided to write my own midlet to send attachments. Moreover having my own midlet meant I can take pictures and send the same in one shot - was defenitely worth trying. So here's is what I did.

1. Use MMAPI to take pictures - basically followed the MMAPI sample program that comes with the WTK. I used VideoControl.USE_DIRECT_VIDEO display mode and png encoding for the snap shot. Here's the caveat: with MMAPI, you'll never get the same resolution as the native camera app. But that was OK, I was just gonna use it for moblogging.

2. Open a simple socket connection to myemail.t-mobile.com, port 25 and Send the picture that you captured using basic SMTP commands. T-mobile uses secure SMTP - so you need to pass in your creditials - no ssl though(btw 6600 do support ssl). Here goes the commands
a) EHLO
b) AUTH PLAIN {Base64 encoding of "\000" + user + "\000" + password}
c) MAIL FROM: < {your email addr} >
d) RCPT TO: < {flickr email addr} >
e) DATA
f) MIME-Version: 1.0
g) From: < {your email addr} >
h) To: < {flickr email addr}>
i) Subject: {some subject line}
j) Content-Type: multipart/mixed; boundary=" {some unique string} "
k) \r\n-- {my unique string}
l) Content-Type:image/png; name=image1.png");
m) Content-Disposition: attachment;filename="image1.png"
n) Content-transfer-encoding: base64
o) \r\n\r\n
p) {Base64 encoding of the image} - just google MIMEBase64 in case you need an impl.
q) \r\n-- {my unique string}
r) \r\n\r\n-- {my unique string} --\r\n
s) .
t) QUIT

3) Add some screens for configuration - email, server, port etc (throw in some RMS code also if you have the time), an Image thumbnail so you can select and preview before you post.

Thats it.. Done! Your very own moblog software is up n running in no time!

Wednesday, January 19, 2005

Tar Ant Task problem



I was using Tar task in one of my build scripts and ran into this error:

[tar] Nothing to do: XXX_XXX_1_0_0.tar is up to date.

This was weird because I got this error when I ran the script for the very first time. It turned out that I had the wrong entry for the "includes" attribute and so bascially tar couldnt find anything to tar up. Talk about misleading error messages!

Tuesday, January 11, 2005

Bluetooth internet with Nokia 6600 and t-zones

I got it working finally! I can now browse internet on my laptop using t-zones from my 6600. Well.. instructions are simple and is listed at a lot of places in the net. Here's is what I did

1. Subscribed to $4.99 t-zones connection from t-mobile. You get limited internet access - via the t-zones proxy - this way. You get to browse both WAP and regular HTML sites from the handset. I have accessed POP3 and SMTP also - not tried any other ports so far.

2. Configured DUN - dial up networking - from Laptop to 6600 over bluetooth. I use Blekin Bluetooth USB adapter - btw I had to update my windows bluetooth drivers with the ones from WIDCOMM. Enabled bluetooth and paired the phone. Set the Paired device (My Laptop) as authorised in the phone - so I dont need to enter PIN every time I connect.

3. Added the following connection string for the modem - In XP, control panel -> modems -> "Bluetooth Modem" (the one that I am using for my DUN) -> properties -> advaned ->Enter-> AT+cgdcont=1,"IP","wap.voicestream.com","",0,0

4. Changed the browser proxy (IE) for my modem connection - NOT the LAN one - as follows
Tools-> InternetOptions->connections -> Bluetooth Modem -> Settings-> Enable Proxy check box -> 216.155.165.50 port 8080.

5. Entered the dial up number for connection as *99# and blank for userid and password.

6. Also I uncheckd the "wait for dial tone" somewhere in the modem configuration.

Thats it. I'm up and running with my wireless internet connection. I felt the browsing speed and reliability is more or less the same as that of a regular dial up.