Code example for BluetoothSocket

Methods: getInputStream, getOutputStream

0
            InputStream tmpIn = null;
            OutputStream tmpOut = null;
 
            // Get the BluetoothSocket input and output streams 
            try { 
                tmpIn = socket.getInputStream();
                tmpOut = socket.getOutputStream();
            } catch (IOException e) {
            	RhoBluetoothManager.loge(TAG, "temp sockets not created");
            } 
 
            mmInStream = tmpIn;
            mmOutStream = tmpOut;
        } 
 
        public void run() { 
        	RhoBluetoothManager.logi(TAG, "BEGIN mConnectedThread");
            byte[] buffer = new byte[1024];
            int bytes;
 
            // Keep listening to the InputStream while connected