I have an application which downloads a html page. This application works fine on the simulator. But when I download the program to my smart phone, the appliactions does not work fine.

I ensured, that internet is working on my smart phone. I can start my webbrowser and then he asks me which access point I want to use. Afterwards I can surf in the internet.

But if I run my application, the smart phone asks me if this appliactions is allowed to use a connection (of course I accept), but then the smart phone do not ask me which access point it should use.

The program throws an Exception with the messsage "-1" at following position.
Code:
	    try{
		    c = (HttpConnection)Connector.open(url);
		    c.setRequestMethod(HttpConnection.GET);
		    c.getFile();
	    }
	    catch(IOException e)
	    {
	    	display("Error while opening Connector"+e.getMessage());
	    	return null;
	    }
	    try{
		    is = c.openDataInputStream(); // here the exception occures
	            len =c.getLength() ;
	    }
	    catch(IOException e)
	    {
	    	display("Error while opening InputStream"+e.getMessage());
                          
	    	return null;
	    }
I do not know why the connection does not work?
Some ideas ??