×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    23

    Question Facing problem in transferring image using bluetooth

    Hi,

    I am trying to transfer the image using obex profile so select uuid = 0x1105 & attribute = int[]{0x0001, 0x0003, 0x0008, 0x000C, 0x0100, 0x000F, 0x1101, 0x1000, 0x1001, 0x1002, 0x1115, 0x1116, 0x1117};, on selecting the target device able to get url = ”btgoep://002109D7F9D:9;authenticate=false;encrypt=false;master=true”

    But on opening the bt connection it throw Javax.bluetooth.BluetoothConnectionException: Symbain error = -5
    ….
    public void run() {
    InputStream inputStream = null;
    byte[] data=null;

    StringBuffer str = new StringBuffer();
    try {
    int i = 0;
    inputStream = getClass().getResourceAsStream("/icon.png");
    while ((i = inputStream.read()) != -1) {
    str.append((char) i);
    }
    data = str.toString().getBytes();
    Connection conn = Connector.open(btURL); //throw exception here
    ClientSession clientSession = (ClientSession)conn;
    HeaderSet header = clientSession.createHeaderSet();
    header.setHeader(HeaderSet.NAME,"test.png");
    header.setHeader(HeaderSet.TYPE,"image/png");
    header.setHeader(HeaderSet.LENGTH,new Long(data.length));
    HeaderSet headerset = clientSession.connect(header);
    Operation operation = clientSession.put(header);
    OutputStream outStream = operation.openDataOutputStream();
    outStream.write(data);
    outStream.close();
    operation.close();
    clientSession.disconnect(null);
    conn.close();

    } catch (Exception ex) {
    ex.printStackTrace();
    append(" Exception ::=>" + ex + " clientSession ::=>");
    display.setCurrent(this);
    }

    }
    ….
    Last edited by Pravin008; 2010-03-19 at 12:30.

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2003
    Posts
    4,105
    (not related) Is there a (very good) reason to request remote service profile attributes? I recommend to use null instead.
    (not related) Is there a (very, very good) reason to request that many? I recommend to limit youself to five.
    Is there a reason, why your local device should be the master, always?

  3. #3
    Registered User
    Join Date
    Jul 2009
    Posts
    23

    Re: Facing problem in transferring image using bluetooth

    Sorry for late reply ...
    Problem with master = true thanks traud

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2003
    Posts
    4,105

    Smile

    Glad my question(s) helped. Thank you for the feedback. It is always difficult to know, if something was intended or happened just by incident. I am sure in the future, someone else has a similar problem and making your question useful.

Similar Threads

  1. Problem with bluetooth interface with nokia 2700
    By shyam_tenet in forum General Development Questions
    Replies: 1
    Last Post: 2010-01-19, 13:10
  2. [moved] J2me polish background image problem
    By poojs in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2009-05-25, 11:42
  3. J2ME Bluetooth Problem (JSR82)
    By azman4243 in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2008-10-07, 19:15
  4. Image attribute in Bluetooth ServiceRecord
    By lampz in forum Mobile Java Networking & Messaging & Security
    Replies: 7
    Last Post: 2008-02-18, 20:30
  5. Problem in Sending an image with bluetooth
    By minasamy in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2007-05-06, 23:21

Posting Permissions

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