Open a Wi-Fi socket 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.StreamConnection interface.
-
Invoke
Connector.open(), specify
socket as the protocol, and append the
deviceside=true parameter and the
interface=wifi parameter to the end of the URL
string value.
private static String URL = "socket://local_machine_IP:4444;deviceside=true;interface=wifi";
StreamConnection conn = null;
conn = (StreamConnection)Connector.open(URL);
Was this information helpful? Send us your comments.