×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    3

    bluetooth File that i sent is not saved on remote device

    Hi all,
    I am trying to send file using bluetooth obex push in j2me. when i send file to my samsung star next through my appllication, connection is created and it shows that file is being transferred. however it is not saved at remote device.
    Does anyone have idea why the file is not getting saved. Is there any way to know that the file is accepted on remote device?



    clientSession = (ClientSession) Connector.open(connectionURL);
    // connect using no headers
    HeaderSet rHeaders = clientSession.connect(null);
    if (rHeaders.getResponseCode() != ResponseCodes.OBEX_HTTP_OK) {
    // the connection could not be established
    throw new Exception( "Remote client returned invalid response code: " + rHeaders.getResponseCode());
    }
    finConnection = (FileConnection) Connector.open(fileName);
    fin = finConnection.openInputStream();
    // create a new set of headers
    HeaderSet headers = clientSession .createHeaderSet();
    long totalCount = finConnection.fileSize();
    headers.setHeader(HeaderSet.LENGTH, new Long(totalCount));
    headers.setHeader(HeaderSet.TYPE, getMimeType(fileName));
    headers.setHeader(HeaderSet.NAME, displayName);
    // create an operation using the headers
    op = clientSession.put(headers);
    // on this operation, create the output stream
    out = op.openOutputStream();
    int nBytes;
    byte[] bytes = new byte[1024];
    while ((nBytes = fin.read(bytes)) != -1) {
    out.write(bytes, 0, nBytes);
    }
    out.flush();


    Please help...

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: bluetooth File that i sent is not saved on remote device

    Which UUID do you connect to?

  3. #3
    Registered User
    Join Date
    Sep 2011
    Posts
    3

    Re: bluetooth File that i sent is not saved on remote device

    I connect to UUID 0x1105.

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: bluetooth File that i sent is not saved on remote device

    Do you use the original Samsung Star, the Samsung S5230? Normally, all unknown files end up in Samsung » Menu » My files » Other files. I have no clue because I use my very own OBEX implementation. Easy to code, actually. The original javax.obex packages were too buggy in my tests. Try to send just HeaderSet.NAME and comment the .TYPE and .LENGTH ones. Otherwise use an alternative OBEX implementation …

  5. #5
    Registered User
    Join Date
    Sep 2011
    Posts
    3

    Re: bluetooth File that i sent is not saved on remote device

    thanks... i am using Samsung Star Next, but files are not saved in Menu » My files » Other files.
    I will try ur solutions.

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: bluetooth File that i sent is not saved on remote device

    Should be the same for the Samsung S5233S. This is the same way how it works when you send a file over from a Apple Mac OS X computer.

Similar Threads

  1. Replies: 1
    Last Post: 2008-03-20, 17:31
  2. File is not getting saved in device.
    By HidayathKhan in forum Mobile Java General
    Replies: 3
    Last Post: 2008-03-18, 06:53
  3. Bluetooth: getting remote device port parameters
    By jasse in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2007-11-13, 12:01
  4. how can i come to know bluetooth connection from remote device
    By santosh3311 in forum Symbian Networking & Messaging (Closed)
    Replies: 9
    Last Post: 2005-09-12, 02:46
  5. How to get remote device for Bluetooth server
    By ram_64892 in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-03-02, 18:48

Posting Permissions

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