Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

[java] J2ME Questions (IO stuff)

This topic is 5180 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was thinking of developing a j2me game for a cell phone now that i have read up on midp. I was thinking of writing a level editor with j2se so that I can create the levels on my computer instead of on the cellphone, now what i wonder is; if I make the levels with a program written in standard java for a pc platform, will I be able to load those files with j2me? If so, any suggestions how i would go about it would also be appreciated. -------------------- Though this program be madness, yet there is a method in''t

Share this post


Link to post
Share on other sites
Advertisement
Well, MIDP doesn''t have any standard way to access the phone''s native file system, so you''ll have to pack the level files you create in your jar. Then you can just use the Class.getResourceAsStream() method, to get an InputStream to the file. Using that InputStream you read the file as an array of bytes (or you could wrap the InputStream in a DataInputStream and have a few utility methods for reading the basic types). I imagine since you''ll write the level editor you''ll know the format of your level files and have no problem parsing them from there.

shmoove

Share this post


Link to post
Share on other sites
Ok, thank you for your help, I will look into that

--------------------
Though this program be madness, yet there is a method in''t

Share this post


Link to post
Share on other sites
http://www.gamedev.net/community/forums/topic.asp?topic_id=192051

Here check it out!

Some nice code there from Skizz and others!!

We have just completed a level editor made jusing swing and saves the files as binary and added the the jar!

Not too difficult!




http://www.druiddevelopment.com

Share this post


Link to post
Share on other sites
I looked at Skizz''s code and it looks really easy. I was kinda worried that it wasn''t possible, because no one responded when I asked about this on the forums on java.sun.com, just shows that you might as well ask in gamedev from the start

--------------------
Though this program be madness, yet there is a method in''t

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
how to link the written j2me coding with actual java activated cell phone

Share this post


Link to post
Share on other sites
Are you asking how do you get your Java game onto the phone??

Depends on the phone.

Infra Red port or Over The Air are the 2 methods most commonly used!

Brian.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!