Open a Wi-Fi HTTP connection
The interface=wifi parameter applies only to TCP/UDP connections. To establish a Wi-Fi® connection and use a Wi-Fi API in a BlackBerry® device application, the wireless service provider must support Wi-Fi
access.
- Import the following classes:
- java.lang.String
- javax.microedition.io.Connector
- Import the javax.microedition.io.HttpConnection
interface.
- Invoke Connector.open(), specify http as the protocol, and append the interface=wifi parameter to the end of the URL string value.
- Cast the returned object as an HttpConnection or a StreamConnection object.
HttpConnection conn = null;
String URL = "http://www.myServer.com/myContent;deviceside=true;interface=wifi";
conn = (HttpConnection)Connector.open(URL);
Index
Was this information helpful? Send us your comments.