You Are Here:

Community: Developer Discussion Boards

#1 Old E70 Obex Problem - 2008-12-09, 19:01

Join Date: Dec 2008
Posts: 1
MK2008E70
Offline
Registered User
Hello there,
i have a problem using OBEX in my Midlet. Device Discovery and Service Discovery work perfect, also i can send Data.

BUT
I also want to send Data in an open Connection like the following one. But the Problem is, the Server (My PC) only read the ByteString when i close the OutputStream (out.close)

Maybe anybody can help me?

OPEN Connection
Code:
public  int openConnection(String Type, Display d){
     try {
            this.display=d;
            localDevice = LocalDevice.getLocalDevice();
            conn = (ClientSession) Connector.open(ConnectionUrl);
            header = conn.createHeaderSet();
            header.setHeader(HeaderSet.COUNT, new Long(1));
            header.setHeader(HeaderSet.NAME, localDevice.getBluetoothAddress());
            header.setHeader(0x30, "New OBEX Connection");
            header.setHeader(HeaderSet.DESCRIPTION, Type); //
            response = conn.connect(header);
           
            op = conn.put(header);
            out = op.openOutputStream();
        } catch (IOException ex) {
            return 3;
        }
        return 4;
    }

Send Data
Code:
public  void sendMyData(String Message){
        try {
            
            byte[] data = Message.getBytes();
           
            out.write(data);
            out.flush();

//          out.close()      <--only works when i uncomment this
 
        } catch (IOException ex) {
            display.setCurrent(new Alert("Error",ex.toString(),null,AlertType.INFO));
        }

Ok when i send a message which is larger than 1kb my Server recognizes the Message without the "out.close" method. Is there a way i can send a quit Message e.g. out.write(0x40)??
Last edited by MK2008E70 : 2008-12-09 at 20:24.
Reply With Quote

#2 Old Re: E70 Obex Problem - 2008-12-10, 13:41

Join Date: Dec 2008
Posts: 2
xmen12345
Offline
Registered User
any one knows to catch IMEI of mobile using J@ME
Reply With Quote

#3 Old Re: E70 Obex Problem - 2008-12-11, 08:59

Join Date: Mar 2008
Posts: 577
mahbub_s60's Avatar
mahbub_s60
Offline
Forum Nokia Expert
Follow this link if you need IMEI


Quote:
Originally Posted by xmen12345 View Post
any one knows to catch IMEI of mobile using J@ME


-Mahbub
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
Problem in file exchange over Bluetooth in OBEX frame work binary123 Mobile Java General 11 2009-11-20 09:48
Problem Sending more than one OBEX image jogissa Bluetooth Technology 0 2007-09-21 11:10
About 6230 Bt Problem eerkek Bluetooth Technology 17 2005-02-08 13:33
OBEX Get() problem ????? pankajmahto General Symbian C++ 2 2004-11-17 06:33
OBEX service searcher problem sguillem Bluetooth Technology 2 2003-04-14 14:10

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