1 Replies - 801 Views - Last Post: 14 June 2011 - 10:04 PM

#1 jimishsoni  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 25-March 11

need urgent help on mobile application in j2me.

Posted 30 March 2011 - 11:19 PM

guys..
while i make a jar file of this coding, after get connected to internet, it shows a error that "unhandled excaption.need to close the application?"
i not getting what to do?
please any one suggest me appropriate solution with proper coding.
yes, i also have some other files, which i m attaching with this topic.
please help me as soon as possible...the application must run. remember the application is in j2me language.



/*
 * RSSMIDlet.java
 *
 * Created on July 12, 2004, 7:40 PM
 */

package testXML;

import RSSParser.*;
import java.util.Vector;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import java.io.*;

public class RSSMIDlet
    extends MIDlet
    implements CommandListener, RSSListener {
  private Display mDisplay;
  private List mTitleList;
  private TextBox textbox;
  private Command mExitCommand;
  private Command mOpenCommand;
  HelloCanvas myCanvas;
  String[] url_array;
  String current_url;
  RSSParser parser; 
  
  private boolean mInitialized;
  private Vector mTitles, mDescriptions;
  
  public RSSMIDlet() {
    //myCanvas = new HelloCanvas(Display.getDisplay(this), this);
    mExitCommand = new Command("Quit", Command.SCREEN, 1);
    mOpenCommand = new Command("Open",Command.SCREEN,0);
    //myCanvas.addCommand(mExitCommand);
    //myCanvas.setCommandListener(this);
    mInitialized = false;
    //parser = new RSSParser();
    //Arguments are Caption, Text inside, co-ordinates
    textbox = new TextBox("Hello World", "http://students.iiit.ac.in/~rumeet/browser/index.xhtml", 100, 0);
    
    textbox.addCommand(mExitCommand);
    textbox.addCommand(mOpenCommand);
    textbox.setCommandListener(this);
  }
    
  public void startApp() 
  {
    if (mDisplay == null)
      mDisplay = Display.getDisplay(this);
    
    if (mInitialized == false) {
      
      mDisplay.setCurrent(textbox);
      
      // Start parsing.
     // String url="http://localhost/browser/index.xhtml";
      //String url="http://students.iiit.ac.in/~rumeet/browser/index.xhtml";
      //parser.setRSSListener(this);
      //parser.parse(url);
      mInitialized = true;
    }
    else
      mDisplay.setCurrent(mTitleList);
  }
  
  public void pauseApp() {}
  
  public void destroyApp(boolean unconditional) {}
  
  public void commandAction(Command c, Displayable s) {
    if (c == mExitCommand)
      notifyDestroyed();
    else if(c == mOpenCommand)
    {
        myCanvas = new HelloCanvas(Display.getDisplay(this), this);
        myCanvas.addCommand(mExitCommand);
        myCanvas.setCommandListener(this);
        parser = new RSSParser();
        mDisplay.setCurrent(myCanvas);
        
        //String url="http://students.iiit.ac.in/~rumeet/browser/index.xhtml";
        
        String url = textbox.getString();
        parser.setRSSListener(this);
        parser.parse(url);    
    }
  }
  
  public void set_vector(String tagname)
  {
      myCanvas.set_vector(tagname);
  }
  
  public void set_hyperlink(String hyperlink)
  {
    myCanvas.set_hyperlink(hyperlink);
  }
  
  public void unset_vector(String tagname)
  {
      myCanvas.unset_vector(tagname);
  }
  
  public void set_tagcontent(String tagcontent)
  {
      if(tagcontent == null) {
          tagcontent = " ";
      }
      myCanvas.set_tagcontent(tagcontent);
  }
  
  public void parse_newurl(String url)
  {
      parser.setRSSListener(this);
      parser.parse(url);
      mInitialized = true;
  }
  
  public void exception(java.io.IOException ioe) {
    Alert a = new Alert("Exception", ioe.toString(),
        null, null);//if( !tagcontent_vector.isEmpty() )
    a.setTimeout(Alert.FOREVER);
    mDisplay.setCurrent(a, mTitleList);
  }
}




Is This A Good Question/Topic? 0
  • +

Replies To: need urgent help on mobile application in j2me.

#2 itengineer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 23-April 09

Re: need urgent help on mobile application in j2me.

Posted 14 June 2011 - 10:04 PM

Please paste the code for HelloCanvas. Also provide the lib for RSSParser.

Thanks
itengineer
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1