J2ME & Sony Ericsson

This page contains general useful, public information about developing on the Sony Ericsson phones with Java 2, Microedition (J2ME).  You will find this information a useful supplemental to Sony’s Developer Website…

Link to Sony’s Developer Website

Connection Proxy

Connection Proxy is a software utility that comes with the Sony Ericsson SDK 2.5.0.2 for the Java(TM) ME Platform.  It is used to connect your PC to a Sony phone.

This section covers tips and common issues that pop up in Connection Proxy so you can have a way of dealing with them.

When Connection Proxy Won’t Connect….

No need to be embarrassed.  It happens to all of us at one time or another.  It’s a natural part of life.  You wait with anticipation while Connection Proxy gets all fired up and ready to go.  That unmistakable “Stauts: Connecting …” message winks at you telling you it’s eager to hook up.

Then it happens.  Connection Proxy just simply stops making connections and leave you there unsatisfied.  And worse, it seems to send conflicting messages about what’s wrong.   Does she it give you a bogus message to divert your attention to what’s really going on?  Of is there something need to know about?  Does it have a headache?  Did it get bad news?  Is it telling you things just to pacify your ego?

Rest assured it happens to everyone.  But, the good news is there’s help.  Start with a checklist:

Push the Right Buttons

The phone has to have Java Developer Mode turned on.  This means you have to know how to press the right buttons on your phone.  Try

center button

center button

left

left

center button

center button

left

left

left

left

center button

center button

right

right

Graphics provided by The Gnome Project.

Start the Relationship Over

A hint on the Sony Developer Connection (go to the webpage) about T610 and Z600 phones suggests to cycle the phone power.  This worked for me on the Z770i wouldn’t connect up as well.  Read as, turn off the phone, shut down Device Explorer and Connection Proxy if they’re on, and then try again.

Be Patient and Do Things Right

One of the things I do that seems to cut down errors is to be patient with the software and methodical in how I actually connect the phone physically to the computer. This seems to solve a lot of problems.  When disconnecting the phone, for example, don’t just unplug the chord from the USB port.  Shut down Device Explorer and then disconnect the Connection Proxy first.  Then unplug the phone from the computer.

Kick Her It To The Curb and Upgrade

Make sure you’re using the latest version of Connection Proxy and Device Explorer.  If you’re not then this might be your problem.  Installing the latest version actually solved a lot of connection problems for me, especially when developing on the JP-8 phones.  Check out this link for a list JP-8 phones.

Device Explorer

The Device Explorer is a software utility comes with the Sony Ericsson SDK 2.5.0.2 for the Java(TM) ME Platform.  It is used to manage MIDP applications on your Sony phone.  Use it to install, delete, and debug the applications you write for the phone.

Device Explorer relies on the Connection Proxy utility (see above) to communicate with your phone.  In other words, you have to start Connection Proxy and get a valid connection to your phone before Device Explorer will work.

Errors

Device Explorer generates a number of errors.  And, not surprisingly, some of them are not well documented.  So, all the ones I’ve run into are here.  Both the text is shown with the graphic so this webpage can be searched.

OAFcode=44 EXEcode=1.

Error Text:

Install failed.
Internal method error: point-2 OAFcode=44 EXEcode=18
Application Management, Execution Environment error.
Execution Environment, authentication failure.

Reason: The phone date and time are not set properly.

This error shows up when you try to install a signed MIDlet suite onto the phone and the date and time are not set.   The MIDlet will upload to the phone and everything looks like it’s going fine, but then suddenly, this error pops up just as the loading completes.  This error is shown because the phone got the MIDlet, but is complaining because it thinks the date and time of the certificate in the MIDlet is not valid.  Why would the phone think that?  It’s easy: the date and time of the phone are not set properly.

So I would expect to see this error whenever you install a signed MIDlet that has an expired certificate.

Error shown when the certificate valid date does not agree with the phone's date and time.

Error shown when the certificate valid date does not agree with the phone

Security and Signing

Always ask your mother for permission.  You know the rules.   If she’s not available, then get a certificate. That way no one gets into trouble.

Sony’s information on MIDlet Permissions from their forum: https://developer.sonyericsson.com/docs/DOC-1049.

A list of permissions used for different APIs in Java ME.

Add appropriate permissions to the Jad and MANIFEST file before the application is signed. In Netbeans, it’s in the project properties, under Application Descriptor.  There’s a tab on that form called “API Permissions.”

The attribute in the .jad MANIFEST file will look something like this:

MIDlet-Permissions: javax.microedition.io.PushRegistry, javax.microedition.io.Connector.sms

To find a list of permission settings in Sony Ericsson phones look here >>>

The official table of permissions

Net Access javax.microedition.io.Connector.http
javax.microedition.io.Connector.https
javax.microedition.io.Connector.cbs
javax.microedition.io.Connector.datagram
javax.microedition.io.Connector.datagramreceiver
javax.microedition.io.Connector.socket
javax.microedition.io.Connector.ssl
javax.microedition.io.Connector.serversocket
Messaging javax.microedition.io.Connector.sms
javax.microedition.io.Connector.mms
javax.wireless.messaging.cbs.receive
javax.wireless.messaging.mms.receive
javax.wireless.messaging.mms.send
javax.wireless.messaging.sms.receive
javax.wireless.messaging.sms.send
Application Auto Invocation javax.microedition.io.PushRegistry
javax.microedition.content.ContentHandler
Local Connectivity javax.microedition.io.Connector.comm
javax.microedition.io.Connector.bluetooth.client
javax.microedition.io.Connector.bluetooth.server
javax.microedition.io.Connector.obex.client
javax.microedition.io.Connector.obex.client.tcp
javax.microedition.io.Connector.obex.server
javax.microedition.io.Connector.obex.server.tcp
Multimedia Recording javax.microedition.media.control.RecordControl
javax.microedition.media.control.VideoControl.getSnapshot
javax.microedition.amms.control.camera.enableShutterFeedback
javax.microedition.amms.control.tuner.setPreset
Read User Data Access javax.microedition.io.Connector.file.read
javax.microedition.pim.ContactList.read
javax.microedition.pim.EventList.read
javax.microedition.pim.ToDoList.read
Write User Data Access javax.microedition.io.Connector.file.write
javax.microedition.pim.ContactList.write
javax.microedition.pim.EventList.write
javax.microedition.pim.ToDoList.write
Location javax.microedition.location.Location
javax.microedition.location.Orientation
javax.microedition.location.ProximityListener
Landmark javax.microedition.location.LandmarkStore.category
javax.microedition.location.LandmarkStore.management
javax.microedition.location.LandmarkStore.read
javax.microedition.location.LandmarkStore.write
Smart card javax.microedition.apdu.aid
javax.microedition.apdu.sat
javax.microedition.jcrmi
Authentication javax.microedition.securityservice.CMSMessageSignatureService
Call Control javax.microedition.io.Connector.sip
javax.microedition.io.Connector.sips
Other javax.microedition.payment.process
Advertisements

15 thoughts on “J2ME & Sony Ericsson

  1. Hi, thanks for the useful information, we’ll never break up! (the connection :D)

    I’m still unable to connect my JP-8 handset to connection proxy using Bluetooth! it shows me an error message saying “for JP-8 handsets network interfaces should be used. NOT com ports.” I’m using the latest version!

    • Gotcha. I guess I didn’t realize you were trying to use Bluetooth as a proxy… You’re in territory I personally haven’t charted yet. It sounds like your phone is configured to connect to a network (Internet?) using Bluetooth as a proxy, but that communication channel happens through COM ports on the phone (which is like an on-board RS-232 port 🙂 ). Depending on the type of networking your application is trying to do, the OS may simply not be able to do networking over that kind of port. You may have a case where your application won’t work when connected to Bluetooth for network access. Just a guess though…

  2. hei,
    i installed a j2me application on sony ericcson k850i. It is meant to restart after 1min after the execution. But the application works fine but it is not running again. I did it using PushRegistry.RegisterAlarm() method. Please help me fix it.

    It worked fine on nokia devices.

    Thank you

    • Hi Steve. Thanks for writing in. I have seen this kind of. Thing a lot. It is no surprise that your application behaves differently or does not work in little ways from phone to phone. That is part of the complexity we all run into.

      I can’t help you solve this problem without seeing some code. So please feel free to post some.

      In the meantine consider writing a little test program that just has the one feature you are having issues with. Then you can isolate specifics of the bad behavior and make changes quickly.

  3. hey,
    i’m basically into modding and that part of w910i and also have a few videos on youtube.

    now i find this topic too really interesting..
    It would be of great help for me if you can tall me how to start on this…

    RON

  4. Hi

    I stumbled upon your blog from your old post on http://developer.sonyericsson.com/community/thread/46135

    Seems my question fits here nicely.

    My software functions include controlling backlight. For SE phones (starting with K700, K750) I use Nokia API.

    Users report there are repeated problems on some phones (K800 , W910) while it works fine on other (P1i, K750, many other modern non-smartphones released after K750)

    To control backlight I use setLights, the function is below:

    void setBacklight(boolean on , int intensityPercentage){
    com.nokia.mid.ui.DeviceControl.setLights(0, on ? intensityPercentage:0);
    }

    Users report that on W910i instead of turning backlight ON the screen starts blinking, unlike models like k750.
    Is there some specific on K800 and similar models?

    Another problem which is not exactly pertinent to K800:
    after some idle (no keys pressed) the screen goes black. I do refresh backlight from separate thread, using setLights(0,0), setLights (0,100) – on some models it works , on other models it does not. Did something change in backlight control as SE JavaPlatform evolves?

    Looking forward to your answer
    Alex

  5. Hi ,
    I have developed a game and I have following issue.
    The game loads and plays well from the “Organizer–>File Manager–>Games” menu but does not load at all from the “Entertainment–>Games” menu.
    This issue is there when I tested on W995 but works fine on k800i.
    Can YOU help me to figure out the issue?
    Thank you.

    • Hi Sri.

      Sorry for the late response. Been really busy and haven’t had time to blog.

      But, to answer your question, I just don’t have an idea off the top of my head. That’s not a very maven like answer.

      However, you may find a clue in the on device debugging output. What does that tell you. Hook up the debugger and run the application from both places. It’s possible you’ll get a permissions error of some type? This is a phone dependent issue, so it may be just a simple case of bad phone behavior….

      Hope that helps.

  6. Ksian,

    The answer to your question is yes!

    I recommend you use the latest version of Netbeans 6., and download the Sony Ericsson SDK. Follow the instructions to install Netbeans first, and then the Sony Ericsson SDK.

    Once that is done, you can build your program, and run it in the Sony emulator. If your specific model of phone doesn’t show up on the list of emulators in Netbeans, it’s not a problem. Just pick any phone that uses the same platform as the k800 (JP8 – Java Platform 8). The emulator may look different, but that’s just cosmetic. The software will function the same as it will on the K800.

    This also means it’s important for you to pay attention to the phone specifications more. Which phones run on JP7, and which ones run on JP8? JP7/JP8 refer to Sony’s implementation of the Java Virtual Machine on the Sony phones. You can find out what one the phone you’re interested in used by looking at the phone specifications on the Sony website.

  7. hi, i’m quite new to j2me, and currently i am trying to porting a mobile game to sony ericsson k800, but didn’t have the real k800 handset, so is it possible to use the sony ericsson sdk without connect to real handset?? i want to emulate in my own pc with sony ericsson sdk.. is it possible?

    Thanks..

  8. Pingback: Today’s Update: 15 SEP 2008 « Richard Schilling’s Professional Weblog

  9. Pingback: Today’s Update « Richard Schilling’s Professional Weblog

And now it's your turn ... comment here or on Twitter (@Androider)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s