It will run on emulater but not on real phone

hi - please help…

I have developed a small game for Sony Ericsson p900 on the j2me wireless toolkit 2.1 using the SE p900 emulator.

The game runs fine when I run it on the emulator - but when I download the game .jad and .jar file to my SE p900 - i get an unrecognisable file error.

please please help - I don’t understand why it should run ok on the emulator and not on the real thing

does the midlet have to be signed first??? or should it run anyway.

please help - and thanks

rmdire

Emulator!=Real device.

Follow that rule and you wont ever be suprised again.

It sounds like you are using OTA, and have not set up the mine type correctly/change the .jad to use the full (not releative) URL.

erm - not sure what you mean as the .jad and .jar are in the same folder - heres what my .jad looks like

MIDlet-1: GlifeMob, GlifeMob.png, GalaxyLifeMIDlet
MIDlet-Jar-Size: 26503
MIDlet-Jar-URL: GlifeMob.jar
MIDlet-Name: GlifeMob
MIDlet-Vendor: unknown
MIDlet-Permissions: javax.microedition.io.Connector.http,javax.microedition.io.Connector.socket,javax.microedition.io.Connector.https,javax.microedition.io.Connector.datagram,javax.microedition.io.Connector.serversocket,javax.microedition.io.Connector.datagramreceiver,javax.microedition.io.Connector.comm,javax.microedition.io.PushRegistry
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.0
MicroEdition-Profile: MIDP-2.0

and all i did was put them on a html page on my site
then i went online with the SE p900 and hit the .jad link

  • it downloaded the .jar file and when it went to run the .jar - it gave the unknown file error

By using the full path he means:


MIDlet-Jar-URL: http://mysite.com/myfolder/GlifeMob.jar

But I think the MIME type issue is the real problem. You have to make sure that the website hosting your jar and jad has the following MIME types configured:
For jars: application/java-archive
For jads: text/vnd.sun.j2me.app-descriptor

shmoove

You can use the Sony Ericsson Java SDK - Device Explorer to debug the application directly on your phone, this helped me alot.

Ah - well heres a thing - I put one of the j2me demo s on the site - ye know - the network demo one.
both the jad and the jar file.

both of which work on the emulator - I downloaded these to the phone

and hey presto - they work.

so what am I doing wrong with my .jad and .jars

I have compared the .jad files and the only difference (apart from file size etc.- which I checked) is that the demo one has been signed by SUN.

I have checked the jar file and all seems ok there.

anymore ideas??

rmdire :’(

Its much cheaper and faster to transfer your applications to the phone via IRDA or Datalink cable. You should get one of those.

I now get the following file error:

invalid java version

however i`m using jdk1.4.2_03

and j2me Version 2.1 (11-Dec-2003 11:05)

the SEp900 SDK :Sony Ericsson P900 J2ME SDK 2004-03-23

any ideas???

Cheers

rmdire

How are you compiling the midlet? The P900 supports MIDP 2.0 so unless you use something else than MIDP 1.0/2.0 it should work.

Hi

Im compiling using the KTool bar build and
I create my jar using the following:

@echo off
rem
rem This batch file builds and preverifies the code .
rem it then packages them in a JAR file appropriately.
rem
if “%OS%” == “Windows_NT” setlocal
set DEMO=GlifeMob
set LIB_DIR=…\lib
set CLDCAPI=%LIB_DIR%\cldcapi10.jar
set MIDPAPI=%LIB_DIR%\midpapi20.jar
set PREVERIFY=…\bin\preverify

set JAVA_FILES=
set JAVA_FILES=%JAVA_FILES% …\src*.java

set JAVAC=javac
set JAR=jar

if not “%JAVA_HOME%” == “” (
set JAVAC=%JAVA_HOME%\bin\javac
set JAR=%JAVA_HOME%\bin\jar
)

if not exist .%DEMO%.jad (
echo *** Run this batch file from its location directory only. ***
goto end
)

echo *** Creating directories ***
if not exist …\tmpclasses md …\tmpclasses
if not exist …\classes md …\classes

echo *** Compiling source files ***
%JAVAC% -bootclasspath %CLDCAPI%;%MIDPAPI% -d …\tmpclasses -classpath …\tmpclasses %JAVA_FILES%

echo *** Preverifying class files ***

rem WARNING: When running under windows 9x the JAR may be incomplete
rem due to a bug in windows 98. Simply place a pause statement between
rem the preverify and JAR stages and wait 5 seconds before continuing
rem the build.

%PREVERIFY% -classpath %CLDCAPI%;%MIDPAPI%;…\tmpclasses -d …\classes …\tmpclasses

echo *** Jaring preverified class files ***
%JAR% cmf MANIFEST.MF %DEMO%.jar -C …\classes .

if exist …\res (
echo *** Jaring resource files ***
%JAR% uf %DEMO%.jar -C …\res .
)

echo ***
echo *** Don’t forget to update the JAR file size in the JAD file!!! ***
echo ***

:end
if “%OS%” == “Windows_NT” endlocal

rem do a “pause” always
pause

any ideas??

eeeeeeeee gaaaad sakes

i FOUND OUT THE PROBLEM
for any of you people who are new to j2ME (like me) and all its antics
make sure you set the TARGET PLATFORM option to CUSTOM - if you don’t know where that is - open the KToolbar - load in your project - then click the settings button and there it is - select custom from the list

Oh and while your at it make sure to select the optional xtras if they are needed.

gaaad - I feel thicker than a whale kebab!

rmdire

i am having the same problem porting to a device, i have read the above information but am still having problems, why oh why, the frustration!

any more clues?

url of the game is
http://www.pistachiomonkey.com/mm/

many thanks if you can help me?

cheers

sorted my problem and thought i would complete this thread and post my latter findings.

prefreably dont uses spaces in the name of your jar as it can be confusing with the whole %20 http substitution in the jad

and um just make sure your jad is perfectly correct, the smallest byte of inaccuracy will fail the authentication process,

happy porting, it trully is a bit of a nightmare!

eZ