Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Generic Object Exchange cơ bản hình ảnh hồ sơ cơ bản in ấn hồ sơ Danh bạ điện thoại truy cập hồ sơ File Transfer hồ sơ đồng bộ hóa hồ sơ Bluetooth trình độ chuyên môn là quá trình cấp giấy chứng nhận cần thiết cho bất kỳ sản phẩm sử dụng công nghệ không dây Bluetooth. Quá trình đủ điều kiện đảm bảo mà những sản phẩm thực hiện theo quy định | Programming with the API 75 Remove the TextFields from the Form connForm.delete O connForm.delete 0 return temp.toString Establishes a connection to the server. @param connString the connection string to connect to the server @return true if the connection was established false if the connection failed private boolean connectToServer String connString try Establish a connection to the server conn StreamConnection Connector.open connString Retrieve the input and output streams to communicate with input conn.openInputStream output conn.openOutputStream return true catch IOException e connForm.append Connect failed IOException connForm.append e.getMessage connForm.append n return false Retrieves the Bluetooth address and channel ID from the Form. This method then establishes a connection to the server. 76 Chapter Four RFCOMM public void run String connString getConnectionString connForm.append Connecting to Server n if connectToServer connString connForm.append Done Remove the Connect Command and add the Send Command to this Form connForm.removeCommand connectCommand Command sendCommand new Command Send Command.SCREEN 1 connForm.addCommand sendCommand Add a TextField to the Form to retrieve the text to send to the server from the user connForm.append new TextField Text to send null 20 TextField.ANY Most of the previous code handles user interaction. The only code that uses JABWT is the connectToServer method. The connectTo-Server method establishes the connection and retrieves the input and output streams. The getConnectionString method makes the connectToServer method work because it specifies the btspp connection scheme which specifies that the SPP and RFCOMM should be used to connect to the server. The next step is to add code that sends a message to the server and reads the reply. To minimize the amount of work done within the MIDP CommandListener event handler all of the communication with the server is done in a separate thread. To perform the processing in a .