Sign in to follow this  
walle

Transfering my game to the phone

Recommended Posts

Hello. Just got started on j2me, and now I've made a pong game. I've tested it in two emulators...but now I want to test it on my java powered phone...how do I get the jad file there? Been searching the web for a while now, maybe not soo good at it =) Ok, I can't connect my phone to the computer because I don't have the drivers(that you have to buy from the manufactor) but Iv'e heard something about making a wap page and download the jad file from that...but how do you do that? Thanks.

Share this post


Link to post
Share on other sites
Ok, I'm going to test it on a nokia (not my phone) I have a motorola c550, and I've looked at their page. But I want to make the game downloadable later on anyway, so maybe I'll refrase my question...
How do I make a wap page that I can download my game's jad file from? =)

Share this post


Link to post
Share on other sites
If you are running an Apache server, create a new file called .htaccess and put it in the same folder as your .jad and your .jar files. It needs to contain these lines:
AddType text/vnd.sun.j2me.app-descriptor jad
AddType application/java-archive jar
If the file already exists, just add those lines to it. Now, all you need to do is point your phone's browser at the .jad file and it should download the .jar properly.

Share this post


Link to post
Share on other sites
Works on two emulators actually =)

The .jad file format is unknown to one phone, so I downloaded the .jar file instead...got an error that said that I couldnt create classes on the phone or something(don't have the phone here now) and on another one I couldn't download it, just stood something about MIDP 1.0 and so...

=)

Share this post


Link to post
Share on other sites
Quote:
Original post by walle
The .jad file format is unknown to one phone, so I downloaded the .jar file instead...
The .jad file is just a pointer to the .jar file, containing a few bits and pieces of information (file size, author, that sort of thing) so provided that points to the correct .jar file all should be good!

What happens if you point your phone at http://benryves.com/wap/Crates3D.jad? That's a simple MIDP 1.0 no-bells-and-whistles game so should run on anything, and the .jad seems to be set up correctly (works on my 3510i).

Share this post


Link to post
Share on other sites
Yes it downloads correctly(yours) but mine doesn't =(
And I even tried taking your .jad file and replacing your data with mine...(jar file author and vendor...and I removed the description...but no...
Someone said that you should have an absolute path to your .jar file like: www/games/pong.jar in my webserver....
Well, here is the error message I got when I downloaded only the .jar file:
Cannot create class in system package

Great game Ben actually played it a bit before I tried fixing my troubles =)

Share this post


Link to post
Share on other sites
Heh, thanks, I can't claim credit on the concept, it's just a conversion.
This tool can check to see if your webserver is set up correctly. My .jad file returns Content-Type: text/vnd.sun.j2me.app-descriptor and the .jar returns Content-Type: application/java-archive, which are both correct. The main problems I've had with getting phone games to download are incorrect headers being sent.
As for that oddity when it comes to running the game - are you using features the phone doesn't support? Are you using, for example, MIDP 2.0 code and trying to run it on a MIDP 1.0 device? As for these emulators, are they for the correct model of phone?

Share this post


Link to post
Share on other sites
Didn't want to start a new thread with my troubles =)

Here they are: I'm trying to download this file It's the .jad file for my game(a pong clone) but when I try to download this to my motorola c550 I download it, then try to install it, then I get this error message: Failed, Invalid file.

I have the two lines in my .htaccess file and I only use midp 1.0 and the phone supports it...any ideas?

The adress to the file is www.walrus.talkhost.info/pong.jad if anyone care to make a go for it, The game isn't complete, but playable =)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this