10
R ichard's Mobile Blog What is autumn but a sign that the other half of the world has borrowed spring? 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… L ink to Sony’s Developer Website ( hĴp://developer.sonyericsson.com ) 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 ( hĴps://developer.sonyericsson.com/site/global/docstools/java/p_java.jsp ). 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 aĴention 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: J2ME & Sony Ericsson | Richard's Mobile Blog http://rschilling.wordpress.com/mobile-development/java-microedition-d... 1 of 10 4/20/2014 8:30 AM

J2ME & Sony Ericsson Richard's Mobile

  • Upload
    lm2k

  • View
    9

  • Download
    1

Embed Size (px)

DESCRIPTION

J2ME & Sony Ericsson Richard's Mobile

Citation preview

Page 1: J2ME & Sony Ericsson Richard's Mobile

Richard's Mobile BlogWhat is autumn but a sign that the other half of the world

has borrowed spring?

J2ME & Sony Ericsson

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

Link to Sony’s Developer Website(h)p://developer.sonyericsson.com)

Connection Proxy

Connection Proxy is a software utility that comes with the Sony Ericsson SDK 2.5.0.2 for the Java(TM) MEPlatform (h)ps://developer.sonyericsson.com/site/global/docstools/java/p_java.jsp). It is used to connectyour PC to a Sony phone.

This section covers tips and common issues that pop up in Connection Proxy so you can have a way ofdealing 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. Youwait 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 thereunsatisfied. And worse, it seems to send conflicting messages about what’s wrong. Does she it give youa bogus message to divert your a)ention to what’s really going on? Of is there something need to knowabout? 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:

J2ME & Sony Ericsson | Richard's Mobile Blog http://rschilling.wordpress.com/mobile-development/java-microedition-d...

1 of 10 4/20/2014 8:30 AM

Page 2: J2ME & Sony Ericsson Richard's Mobile

(h)p://rschilling.files.wordpress.com/2008/09/stock_fullscreen.png)center bu)on

(h)p://rschilling.files.wordpress.com/2008/09/gtk-go-back-ltr.png)left

(h)p://rschilling.files.wordpress.com/2008/09/stock_fullscreen.png)center bu)on

(h)p://rschilling.files.wordpress.com/2008/09/gtk-go-back-ltr.png)left

(h)p://rschilling.files.wordpress.com/2008/09/gtk-go-back-ltr.png)left

(h)p://rschilling.files.wordpress.com/2008/09/stock_fullscreen.png)center bu)on

(h)p://rschilling.files.wordpress.com/2008/09/go-next.png)right

Push the Right Buttons

The phone has to have Java Developer Mode turned on. This means you have to know how to press theright bu)ons on your phone. Try

Graphics provided by TheGnome Project(h)p://www.gnome.org).

Start the Relationship Over

A hint on the Sony Developer Connection (go to the webpage (h)ps://developer.sonyericsson.com/docs/DOC-197)) about T610 and Z600 phones suggests to cycle the phone power. This worked for me onthe Z770i wouldn’t connect up as well. Read as, turn off the phone, shut down Device Explorer andConnection Proxy if they’re on, and then try again.

J2ME & Sony Ericsson | Richard's Mobile Blog http://rschilling.wordpress.com/mobile-development/java-microedition-d...

2 of 10 4/20/2014 8:30 AM

Page 3: J2ME & Sony Ericsson Richard's Mobile

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 inhow I actually connect the phone physically to the computer. This seems to solve a lot of problems. Whendisconnecting the phone, for example, don’t just unplug the chord from the USB port. Shut down DeviceExplorer 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 thenthis might be your problem. Installing the latest version actually solved a lot of connection problems forme, especially when developing on the JP-8 phones. Check out this link(h)ps://developer.sonyericsson.com/device/searchDevice.do?defaultSearch=true&a)ributes=7096f489-22d6-4f12-89d2-b0ee1860b338&a)ributes=99f72d05-cee3-4af6-b41c-f90L06de352&a)ributes=604d0M-3d33-46ec-85d2-917368f41d6e&a)ributes=d15dce77-2bd6-4947-b02b-ab4db3ebf09d&a)ributes=32b8dcd0-7d3b-4d7d-a1d2-21796f359c59) 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) MEPlatform (h)ps://developer.sonyericsson.com/site/global/docstools/java/p_java.jsp). It is used to manageMIDP applications on your Sony phone. Use it to install, delete, and debug the applications you write forthe phone.

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

Errors

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

OAFcode=44 EXEcode=1.

J2ME & Sony Ericsson | Richard's Mobile Blog http://rschilling.wordpress.com/mobile-development/java-microedition-d...

3 of 10 4/20/2014 8:30 AM

Page 4: J2ME & Sony Ericsson Richard's Mobile

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 timeare not set. The MIDlet will upload to the phone and everything looks like it’s going fine, but thensuddenly, this error pops up just as the loading completes. This error is shown because the phone got theMIDlet, 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.

(h)p://rschilling.files.wordpress.com/2008/09/device-explorer-44-182.png)

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: h)ps://developer.sonyericsson.com/docs/DOC-1049 (h)ps://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,

J2ME & Sony Ericsson | Richard's Mobile Blog http://rschilling.wordpress.com/mobile-development/java-microedition-d...

4 of 10 4/20/2014 8:30 AM

Page 5: J2ME & Sony Ericsson Richard's Mobile

it’s in the project properties, under Application Descriptor. There’s a tab on that form called “APIPermissions.”

The a)ribute in the .jad MANIFEST file will look something like this:

MIDlet-Permissions: javax.microedition.io.PushRegistry, javax.microedition.io.Connecto

To find a list of permission se)ings in Sony Ericsson phones look here >>>(h)p://developer.sonyericsson.com/getDocument.do?docId=99421)

The official table of permissions

Net Access javax.microedition.io.Connector.h)pjavax.microedition.io.Connector.h)psjavax.microedition.io.Connector.cbsjavax.microedition.io.Connector.datagramjavax.microedition.io.Connector.datagramreceiverjavax.microedition.io.Connector.socketjavax.microedition.io.Connector.ssljavax.microedition.io.Connector.serversocket

Messaging javax.microedition.io.Connector.smsjavax.microedition.io.Connector.mmsjavax.wireless.messaging.cbs.receivejavax.wireless.messaging.mms.receivejavax.wireless.messaging.mms.sendjavax.wireless.messaging.sms.receivejavax.wireless.messaging.sms.send

Application Auto Invocation javax.microedition.io.PushRegistryjavax.microedition.content.ContentHandler

Local Connectivity javax.microedition.io.Connector.commjavax.microedition.io.Connector.bluetooth.clientjavax.microedition.io.Connector.bluetooth.serverjavax.microedition.io.Connector.obex.clientjavax.microedition.io.Connector.obex.client.tcpjavax.microedition.io.Connector.obex.serverjavax.microedition.io.Connector.obex.server.tcp

Multimedia Recording javax.microedition.media.control.RecordControljavax.microedition.media.control.VideoControl.getSnapshotjavax.microedition.amms.control.camera.enableShu)erFeedbackjavax.microedition.amms.control.tuner.setPreset

J2ME & Sony Ericsson | Richard's Mobile Blog http://rschilling.wordpress.com/mobile-development/java-microedition-d...

5 of 10 4/20/2014 8:30 AM

Page 6: J2ME & Sony Ericsson Richard's Mobile

Read User Data Access javax.microedition.io.Connector.file.readjavax.microedition.pim.ContactList.readjavax.microedition.pim.EventList.readjavax.microedition.pim.ToDoList.read

Write User Data Access javax.microedition.io.Connector.file.writejavax.microedition.pim.ContactList.writejavax.microedition.pim.EventList.writejavax.microedition.pim.ToDoList.write

Location javax.microedition.location.Locationjavax.microedition.location.Orientationjavax.microedition.location.ProximityListener

Landmark javax.microedition.location.LandmarkStore.categoryjavax.microedition.location.LandmarkStore.managementjavax.microedition.location.LandmarkStore.readjavax.microedition.location.LandmarkStore.write

Smart card javax.microedition.apdu.aidjavax.microedition.apdu.satjavax.microedition.jcrmi

Authentication javax.microedition.securityservice.CMSMessageSignatureService

Call Control javax.microedition.io.Connector.sipjavax.microedition.io.Connector.sips

Other javax.microedition.payment.process

15 Comments

15 thoughts on “J2ME & Sony Ericsson”

asima says:

March 11, 2014 at 10:01 AMSuperb..!!!!sony mobiles

Reply

1.

Man Of Snow says:

August 17, 2011 at 9:19 AMHi, 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 errormessage saying “for JP-8 handsets network interfaces should be used. NOT com ports.” I’m using thelatest version!

Reply

rschilling says:

August 17, 2011 at 7:39 PM

2.

J2ME & Sony Ericsson | Richard's Mobile Blog http://rschilling.wordpress.com/mobile-development/java-microedition-d...

6 of 10 4/20/2014 8:30 AM

Page 7: J2ME & Sony Ericsson Richard's Mobile

Gotcha. I guess I didn’t realize you were trying to use Bluetooth as a proxy… You’re in territory Ipersonally 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 COMports on the phone (which is like an on-board RS-232 port ). Depending on the type ofnetworking your application is trying to do, the OS may simply not be able to do networking overthat kind of port. You may have a case where your application won’t work when connected toBluetooth for network access. Just a guess though…

Reply

Steve says:

February 22, 2011 at 6:45 AMhei,i installed a j2me application on sony ericcson k850i. It is meant to restart after 1min after theexecution. But the application works fine but it is not running again. I did it usingPushRegistry.RegisterAlarm() method. Please help me fix it.

It worked fine on nokia devices.

Thank you

Reply

rschilling says:

February 25, 2011 at 5:35 PMHi Steve. Thanks for writing in. I have seen this kind of. Thing a lot. It is no surprise that yourapplication behaves differently or does not work in li)le ways from phone to phone. That is part ofthe 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 li)le test program that just has the one feature you are havingissues with. Then you can isolate specifics of the bad behavior and make changes quickly.

Reply

3.

raj says:

March 8, 2010 at 9:21 AMhey,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

Reply

rschilling says:

March 10, 2010 at 2:01 PMWhat do you mean by modding, exactly?

Reply

4.

tequilacat says:

November 9, 2009 at 3:35 PM5.

:-)

J2ME & Sony Ericsson | Richard's Mobile Blog http://rschilling.wordpress.com/mobile-development/java-microedition-d...

7 of 10 4/20/2014 8:30 AM

Page 8: J2ME & Sony Ericsson Richard's Mobile

Hi

I stumbled upon your blog from your old post on h)p://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 useNokia 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 modelslike 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. Didsomething change in backlight control as SE JavaPlatform evolves?

Looking forward to your answerAlex

Reply

Sri says:

November 4, 2009 at 5:47 AMHi ,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 loadat 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.

Reply

rschilling says:

November 25, 2009 at 8:42 PMHi 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 verymaven like answer.

6.

J2ME & Sony Ericsson | Richard's Mobile Blog http://rschilling.wordpress.com/mobile-development/java-microedition-d...

8 of 10 4/20/2014 8:30 AM

Page 9: J2ME & Sony Ericsson Richard's Mobile

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

Hope that helps.

Reply

ksian says:

October 17, 2008 at 8:38 AMdear rschilling,i already figure it out.. and able to emulate now..thanks for your reply..

Reply

7.

rschilling says:

October 16, 2008 at 5:31 PMKsian,

The answer to your question is yes!

I recommend you use the latest version of Netbeans 6., and download the Sony Ericsson SDK. Followthe 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 modelof phone doesn’t show up on the list of emulators in Netbeans, it’s not a problem. Just pick any phonethat uses the same platform as the k800 (JP8 – Java Platform 8). The emulator may look different, butthat’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 a)ention to the phone specifications more. Whichphones run on JP7, and which ones run on JP8? JP7/JP8 refer to Sony’s implementation of the JavaVirtual Machine on the Sony phones. You can find out what one the phone you’re interested in usedby looking at the phone specifications on the Sony website.

Reply

8.

ksian says:

October 16, 2008 at 6:10 AMhi, i’m quite new to j2me, and currently i am trying to porting a mobile game to sony ericsson k800, butdidn’t have the real k800 handset, so is it possible to use the sony ericsson sdk without connect to realhandset?? i want to emulate in my own pc with sony ericsson sdk.. is it possible?

Thanks..

Reply

9.

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

Pingback: Today’s Update « Richard Schilling’s Professional Weblog11.

Blog at WordPress.com. | The Splendio Theme.

J2ME & Sony Ericsson | Richard's Mobile Blog http://rschilling.wordpress.com/mobile-development/java-microedition-d...

9 of 10 4/20/2014 8:30 AM

Page 10: J2ME & Sony Ericsson Richard's Mobile

Follow

Follow “Richard's Mobile Blog”

Powered by WordPress.com

J2ME & Sony Ericsson | Richard's Mobile Blog http://rschilling.wordpress.com/mobile-development/java-microedition-d...

10 of 10 4/20/2014 8:30 AM