×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    5

    Exclamation Opening html files inside J2ME application

    Dear all,

    I'm trying to open an html file (index.html) using the following code:

    ...
    try {
    browser = new Browser(getShell(), SWT.NONE);
    } catch (SWTError e) {
    e.printStackTrace();
    }

    if (browser != null) {
    StringBuffer buf = new StringBuffer();
    try {
    InputStream inputStreamTxt = null;
    String text = L10N.msg("Help");
    if(text.trim().toLowerCase().equals(HELP)){
    inputStreamTxt = this.getClass().getResourceAsStream("/financialCalc/help/index_en.html");
    }else{
    inputStreamTxt = this.getClass().getResourceAsStream("/financialCalc/help/index.html");
    }

    int c;
    while ((c = inputStreamTxt.read()) != -1) {
    buf.append((char) c);
    }
    inputStreamTxt.close();

    } catch (IOException e) {
    e.printStackTrace();
    }

    browser.setText(buf.toString());
    ...

    However, the image used inside the html file is not being displayed when openning the browser inside the application in the cell phone. I've tried some possibilities:

    * Copying the image to the "Images" folder to the memory card and access it using <img src="file:///Images/image001.jpg" />
    * I've tried to put the image in the "res" folder of the application and access it using <img src="image001.jpg" /> or even using <img src="./image001.jpg" />
    * I've tried to put the image in the same folder of the html file and access it using <img src="image001.jpg" /> or even using <img src="./image001.jpg" />
    * I've tried to put the image in a specific folder for the html (e.g, index_files) and access it using <img src="image001.jpg" /> or <img src="./image001.jpg" />

    Do you have any idea where is the problem?

    Best regards,

    David

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,560

    Re: Opening html files inside J2ME application


Similar Threads

  1. Flash inside HTML for a widget?????
    By rj12info in forum Symbian
    Replies: 7
    Last Post: 2009-07-09, 13:34
  2. HTML inside a MIDlet
    By HasithaRandika in forum Mobile Java General
    Replies: 4
    Last Post: 2009-02-17, 10:26
  3. Launch Realplayer from inside a J2ME Application
    By Genkido in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2009-01-30, 14:35
  4. play a flash swf movie from inside j2me application
    By rhalfi in forum Mobile Java General
    Replies: 1
    Last Post: 2006-12-21, 15:29
  5. Opening a web page through my J2ME application.
    By ashishga in forum Mobile Java Networking & Messaging & Security
    Replies: 5
    Last Post: 2006-02-10, 11:11

Posting Permissions

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