×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    4

    Images through HTTP Connection

    I am trying to get an image through HTTP Connection to my mobile phone. I used emulator from Sun and it is working. When i tried on mobile phone(3650) it will not show anything.
    I tried also on Nokia's Developer Suite for J2ME. At the point of connection i have the following exception:

    Exception: java/lang/ClassNotFoundException
    at com.sun.midp.io.InternalConnector.openPrim(+159)
    at com.sun.midp.io.InternalConnector.openPrim(+159)
    at com.sun.midp.io.j2me.http.Protocol.connect(+55)
    at com.sun.midp.io.j2me.http.Protocol.openInputStream(+64)
    at com.sun.midp.io.j2me.http.Protocol.openDataInputStream(+28)
    ....

    Thank you

  2. #2
    Registered User
    Join Date
    Apr 2003
    Location
    Russia
    Posts
    34
    show your code plz

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    4
    private Image setImage()
    {
    String url = "http://myAddress/img.png";
    Image m_Image = null;
    ContentConnection connection = null;
    DataInputStream iStrm = null;

    try
    {
    connection = (ContentConnection) Connector.open(url);
    iStrm = connection.openDataInputStream();
    byte imageData[];
    int length = (int) connection.getLength();
    if (length != -1)
    {
    imageData = new byte[length];
    iStrm.readFully(imageData);
    }
    else
    {
    ByteArrayOutputStream bStrm = new ByteArrayOutputStream();

    int ch;
    while ((ch = iStrm.read()) != -1)
    {
    bStrm.write(ch);
    }

    imageData = bStrm.toByteArray();
    bStrm.close();
    }
    m_Image = Image.createImage(imageData, 0, imageData.length);
    }
    catch(Exception e)
    {
    ...........
    }
    ........................

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    7
    Did you solve this issue? If so,how? We have the same problem.

    Thank you

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    4
    Still searching for the solution. It seems that getLength does not return the correct length. I will try on other phones and maybe i will update the software on 3650.

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    5

    Cristi : U have the answer?

    I have exactly the same problem

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    4
    Solution: The problem was due to a needed update of the mobile firmware.
    Last edited by cristi_armeana; 2003-05-13 at 20:29.

  8. #8
    Registered User
    Join Date
    Mar 2003
    Posts
    7
    How to you update software on 3650? How do you find-out what version you have installed?

  9. #9
    Registered User
    Join Date
    Mar 2003
    Location
    Maastricht, The Netherlands
    Posts
    21
    To find out what your software version is on a Nokia just 'call' *#0000#

    And software upgrades are available at a Nokia servicepoint.

Posting Permissions

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