You Are Here:

Community: Developer Discussion Boards

#1 Old Angry How to send/receive objects over bluetooth??? - 2008-12-19, 06:25

Join Date: Oct 2008
Posts: 9
weiru85
Offline
Registered User
I have created a J2ME client on a mobile phone and a server on a laptop. Connection has been established between phone and laptop through Bluetooth. Can anyone provide me with solutions on how to write objects over a stream? I am new in this. MIDP api does not have an ObjectOuputStream class unlike J2SE. So far i can only send primitive data types and String types.

For example, I have created a new class called Cat

Cat cat = new Cat();

I want to send this cat object from my mobile phone to my laptop or vice versa. is this possible? can anyone show me how to do so?
Reply With Quote

#2 Old Re: How to send/receive objects over bluetooth??? - 2008-12-20, 01:52

Join Date: Dec 2008
Posts: 104
Unit1ed
Offline
Regular Contributor
I don't think it is possible. Convert your object to byte array and then send it.
Reply With Quote

#3 Old Re: How to send/receive objects over bluetooth??? - 2009-01-08, 05:40

Join Date: Oct 2008
Posts: 26
markwilson
Offline
Registered User
hi weiru85,

may i know how u done this , coz i m also doing same thing send and receive object
via j2me , but i m using Netbeans ide for that ,

plz help me
Thank You,
Reply With Quote

#4 Old Re: How to send/receive objects over bluetooth??? - 2009-01-15, 03:21

Join Date: Oct 2008
Posts: 9
weiru85
Offline
Registered User
Quote:
Originally Posted by markwilson View Post
hi weiru85,

may i know how u done this , coz i m also doing same thing send and receive object
via j2me , but i m using Netbeans ide for that ,

plz help me
Thank You,
Sorry for the late reply.

i believe that you are new in this too. I recommend you to read up on socket communication in J2ME. For a self-created object, i write each field of an object to the output stream and read in back on the input stream on the other end and instantiate the object on the receiver's end.

For a beginner like me, thats how i do it. I have no experience in Class Loading, which is possible but not recommeded for Java in mobile devices as it breaches security. Furthermore, There is not ObjectOutputStream class in MIDP to convert your object to bytes.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Make The S60 Emulator See My USB Bluetooth Dongle ? Mo7ammed_01 Symbian Tools & SDKs 1 2006-07-25 01:14
best bluetooth dongle+ bluetooth programming ali_hammad Bluetooth Technology 3 2006-06-12 21:12
Successfully Connected Using Bluetooth with Pc Suite zrilo Bluetooth Technology 0 2006-04-09 05:21
Nokia 8910 not working with USB Bluetooth Cards olivieradler General Discussion 0 2005-10-05 11:49
Bluetooth statuspane icon antijn Bluetooth Technology 2 2004-10-30 10:23

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia