wood burning stoves
The moose likes Java Micro Edition and the fly likes urgent help requierd in J2ME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "urgent help requierd in J2ME" Watch "urgent help requierd in J2ME" New topic

urgent help requierd in J2ME

Salman Faraz

Joined: Feb 14, 2005
Posts: 28
Respected Friends,
I want to make an application in J2ME for Sony Ericson K700i mobile phone which is connected to the serial port of the PC,this application would be running inside the cellular mobile phone,when I will run this application all the files in the "File Manager" folder of mobile with .txt extensions would be copied to the PC to some paticular folder passing through the serial port to which the mobile is connected,I am facing some problems while devloping this application,my questions are as follows:

1) Is it possible to transfer a file on the serial port,off course we can transfer interger type data to the serail port but integer is a primitive data type and while transferring files we will actually pass the object related to that file to the serial port of the PC,is this really possible?
2) Sony Ericson K700i does'nt implements JSR 75(PDA Optional Packages for the J2METM Platform,which is used to access PIM data and file systems) which means that we can not access the file system of this mobile so is it really possible to access the files stored in this mobile through my application?
3) Once the file is transferred to the serial port than will its contents of the file ramains in its original state or will be transferred to some kind of bianry data and we have to bring it in the original state.On the PC end will I need to write some other application which continiously monitores the serial port and will receive this file.

I would be waiting for your precious replies.

Thanking You,
Salman Faraz.
Shawn Fitzgerald

Joined: May 07, 2004
Posts: 25

Got some bad news for you.

You can't send the objects because the serializable interface is not supported on J2ME MIDP1 or MIDP2 spec. The only way you could send the data is via a byte[] or some other primitive type.

Since you said the K700i doesn't support the jsr-75 file system access APIs, then you can't get to anything but your midlets datastore (RMS). MIDlets are only allowed to access their data or data that is shared from another midlet, or provided through an external library call (such as jsr-75 provides for)

So point #3 is a non-issue because you can't get to the data to send it out to the port.

This is where most people take issue with J2ME, there are a lot of rules that you are not allowed to break. Where as with J2SE you can break just about any rule give a little time and a few libraries or JNI calls.
No such luck with J2ME, it's designed to be secure, and never give permissions to do much without permission from the service provided and the user.

Wish the info was better. Can you use a different phone? I know there are some that support that feature of reading from the filesystem. But you will still need to transfer the data in a binary form and not as an object.


DFW J2ME Sig co-leader<br />Author: <a href="http://www.cafepress.com/sms_midp2" target="_blank" rel="nofollow">SMS for MIP2.0</a>
I agree. Here's the link: http://aspose.com/file-tools
subject: urgent help requierd in J2ME
It's not a secret anymore!