Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  It will run on emulater but not on real phone  (Read 2549 times)
0 Members and 1 Guest are viewing this topic.
Offline rmdire

Junior Member





« Posted 2004-05-04 15:58:47 »

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
Online Abuse

JGO Knight


Medals: 12


falling into the abyss of reality


« Reply #1 - Posted 2004-05-04 17:32:44 »

Emulator!=Real device.

Follow that rule and you wont ever be suprised again.

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline mlk

Junior Member




Muppet!


« Reply #2 - Posted 2004-05-05 03:57:10 »

Quote

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.

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.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline rmdire

Junior Member





« Reply #3 - Posted 2004-05-05 06:30:18 »

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

Offline shmoove

Junior Member




Doh!


« Reply #4 - Posted 2004-05-05 08:38:33 »

By using the full path he means:
1  
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
Offline darcone

Junior Member




Size matters


« Reply #5 - Posted 2004-05-05 08:45:00 »

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

Junior Member





« Reply #6 - Posted 2004-05-05 09:12:14 »

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  Cry
Offline darcone

Junior Member




Size matters


« Reply #7 - Posted 2004-05-05 12:09:23 »

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

Junior Member





« Reply #8 - Posted 2004-05-05 13:17:17 »

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
Offline darcone

Junior Member




Size matters


« Reply #9 - Posted 2004-05-06 04:23:06 »

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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline rmdire

Junior Member





« Reply #10 - Posted 2004-05-06 06:27:55 »

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??
Offline rmdire

Junior Member





« Reply #11 - Posted 2004-05-06 14:43:48 »

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


Offline pistachiomonkey

Senior Newbie




Java games rock!


« Reply #12 - Posted 2005-03-11 09:42:39 »

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
Offline pistachiomonkey

Senior Newbie




Java games rock!


« Reply #13 - Posted 2005-04-04 12:44:36 »

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
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (8 views)
2014-09-21 00:34:41

moogie (7 views)
2014-09-21 00:26:15

UprightPath (22 views)
2014-09-20 20:14:06

BurntPizza (27 views)
2014-09-19 03:14:18

Dwinin (40 views)
2014-09-12 09:08:26

Norakomi (70 views)
2014-09-10 13:57:51

TehJavaDev (96 views)
2014-09-10 06:39:09

Tekkerue (49 views)
2014-09-09 02:24:56

mitcheeb (70 views)
2014-09-08 06:06:29

BurntPizza (52 views)
2014-09-07 01:13:42
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!