title: wifi doesn't work in own apps, but works in blackberry's browser
body: <p>we have just started to write Blackberry apps and got strange situation. Our apps work with mobile internet (GPRS, 3G, EDGE) but are not working using wifi connection.</p>
  
  <p>I have tried to change all the settings. But still usually it is just "Tunnel failure" or "connection timed out" errors. The same is with HTTPDemo example.</p>
  
  <p>Could someone help and explain what it is with Blackberry and WiFi?</p>
  
  <p>StreamConnection s = null;
                     s = (StreamConnection)Connector.open(getUrl() +";interface=wifi");
                     HttpConnection httpConn = (HttpConnection)s;                        </p>
  
  <pre><code>               int status = httpConn.getResponseCode();
  
                 if (status == HttpConnection.HTTP_OK)
                 {
                     // Is this html?
                     String contentType = httpConn.getHeaderField(HEADER_CONTENTTYPE);
                     boolean htmlContent = (contentType != null &amp;&amp; contentType.startsWith(CONTENTTYPE_TEXTHTML));
  
                     InputStream input = s.openInputStream();
  
                     byte[] data = new byte[256];
                     int len = 0;
                     int size = 0;
                     StringBuffer raw = new StringBuffer();
  
                     while ( -1 != (len = input.read(data)) )
                     {
                         // Exit condition for the thread. An IOException is 
                         // thrown because of the call to  httpConn.close(), 
                         // causing the thread to terminate.
                         if ( _stop )
                         {
                             httpConn.close();
                             s.close();
                             input.close();
                         } 
                         raw.append(new String(data, 0, len));
                         size += len;    
                     }   
  
                     raw.insert(0, "bytes received]\n");
                     raw.insert(0, size);
                     raw.insert(0, '[');
                     content = raw.toString();
  
                     if ( htmlContent )
                     {
                         content = prepareData(raw.toString());                                
                     }     
                     input.close();                      
                 } 
                 else 
                 {                            
                     content = "response code = " + status;
                 }  
                 s.close();                    
             } 
             catch (IOCancelledException e) 
             {       
                 System.out.println(e.toString());                        
                 return;
             }
             catch (IOException e) 
             {       
                 errorDialog(e.toString());                        
                 return;
             } 
  </code></pre>