I'm designing a bluetooth application that can browse the file system of a remote PC running Windows. I'm using the J2ME API and the Wireless Toolkit and the program should run on a symbian series 60 (on a nokia N-gage).
My initial approach is as follows: Have a program running on the PC (bluetooth USB dongle) listening for connections from the client program on the N-gage. When the client request the file
system, a list object should be sent with the file/dir names and corresponding icon.
The problem I have is with sending the object. Is there a way to send List objects (List object from lcdui package) to/from devices using the Java Bluetooth API (not OBEX)??
To my knowledge serialization is not allowed in J2ME, at least in MIDP1.0 (I'm not sure about 2.0). One solution would be to create your own "light-weight" version of serialization in order to be able to send the lists. One approach would be to send all the list objects String values over bluetooth and on the recepient side try to recreate the list.
Yeah I was thinking of sending the string through and forming the list on the client's side. But the reason I wanted to be able to send a list is so that I could include the icon for each file association. I need the string of the name and the associated type icon so that the client knows what's a file and what's a folder. Do you think it would be efficient to send the strings and images separately and then put them together when they're received? I just thought sending them together as a list would be better. Any ideas would be cool.
To send the one image for each list item isn't recommendable from a bancwidth point of view. A better solution would be to send the file and directory image ONCE and to use a flag to indicate if a list object is a directory or a fiel. The recepient can then use the images to recreate the list in a correct manner.
The best would be to implement a class that extends the List class and to define a serializable and deserializable method for it. this however is a little bit more tricky. By doing so you could "serialize" the whole list and send it over bluetooht to the recepient, which than can instantiate an object by using the deserialize method. This however is a little bit more tricky.
i am doing similar thing in which i want dirctory list from the root of mobiledevice at my server side which is made in j2se.
so i want to know how to push object and set header or other related properties to get rootlist from mobile to server side.