[java] J2ME Questions (IO stuff)

Started by
6 comments, last by Eskhan 20 years, 1 month ago
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
--------------------Though this program be madness, yet there is a method in't
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
Ok, thank you for your help, I will look into that

--------------------
Though this program be madness, yet there is a method in''t
--------------------Though this program be madness, yet there is a method in't
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
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
--------------------Though this program be madness, yet there is a method in't
What kind of game are you working on??

And yeah gamedev is probably the best place to go for an quick answer..
how to link the written j2me coding with actual java activated cell phone
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.

This topic is closed to new replies.

Advertisement