« elsif | Main | MovableType 3.2 BETA install woes »

July 27, 2005

Creating and deploying HelloWorld MIDlet to Sony Ericsson mobile phone

So I got a new toy, Sony Ericsson K750i. What a beauty, check the review here and here.

Anyway this post is not about the K750i, but about how to create and deploy your first MIDlet app to Sony Ericsson mobile. Being new to any mobile development trying to figure this one out is pretty frustrating. It seems like there isn't any good tutorial about how to simply do this. I over 2 hours trying to figure out everything from scratch. Mind you I haven't touched Java for almost 2 years now :)



* First download JDK 1.4: http://java.sun.com/j2se/1.4.2/download.html

* Download Sony Ericsson J2ME 2.2.1 SDK: http://developer.sonyericsson.com/site/global/docstools/java/p_java.jsp

* Now follow this tutorial: http://developers.sun.com/techtopics/mobility/midp/articles/wtoolkit/
Only in that tutorial open the KToolbar from Sony Ericsson menu. Most likely you'll use the WTK 2. Sony Ericsson J2ME SDK has been modified to suit their phone. Not entirely sure what the modification is, but anyway I decided to use their SDK rather than Sun's SDK.

* It's working on the emulator? Good. Now there's only one more problem. How to deploy the app to your mobile phone? I couldn't believe it but this took my ages to find out. There's a couple option, you can upload the jad and jar file to a web server and download it to your mobile phone. I was about to do this until I realise that you need to set your webserver to recognise the jad and jar file correctly. So this isn't really an option for me (web hosting problem). See instruction here: http://www.devx.com/Java/Article/10688/0/page/2

I kept looking and I found that Motorola has a special app to let you upload your jar and jad file to your mobile phone. I spent a few minutes looking for similar app for Sony Ericsson and couldn't find any. There's a KB article at developers.sonyericsson.com but that didn't help. That's about uploading your jad/jar file using Bluetooth/IRDA/COM which kinda sucks. How many people actually will use those to upload their jar/jad? That's dumb really and terribly misleading.

I did a search on their forum and found this message: http://developer.sonyericsson.com/show_thread.do?forumId=10&threadid=19570

And more here

Doh' it turned out to be THAT easy to deploy it. Simply upload the jar AND jad file to the "Other" directory on your mobile phone (use the Sony Ericsson's file manager to do this), use your mobile phone to browse to the jad file and select "Install". That's it!

* Oh and by default KToolbar won't create the jar file for you. So to do this check in the directory where you created your first HelloSuite project (mine is at: D:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\HelloSuite) you'll find that the JAD file is there, but not the JAR file. Now you have to create the JAR file that contains the MANIFEST.MF file created by KToolbar. This is important as per Dim's post in the forum that it won't work without it. Use this command:

d:\j2sdk1.4.2_08\bin\jar.exe cmf MANIFEST.MF HelloSuite.jar -C ..\classes .

And off you go....




Oh and it turned out that the person who posted the question is Dim Colebatch, an ex-colleague of mine from NUIX days. Well at least I'm pretty sure it's the same person .. same name, same field (Java, Linux) and same way to sign his stuff:

cheers
dim

Yeah I'm pretty sure it's him :)


Posted by vhadiant at July 27, 2005 10:27 PM





Trackback Pings

TrackBack URL for this entry:
http://www.hadianto.net/mov32/mt-tb.cgi/79

Comments

Post a comment





Remember Me?

(you may use HTML tags for style)