Code example for DataInputStream

Methods: readLine

0
 
	public String readData() {
		String result = "";
		try { 
			InputStream input = bluetoothSocket.getInputStream();
			DataInputStream dinput = new DataInputStream(input);
			result = new String(dinput.readLine());
			if (!(result == "" || result == null || result.contains(",") == false)) {
				return result;
			} 
		} catch (IOException e) {
			// TODO Auto-generated catch block 
			Log.e("Bluetooth Input Stream Creation",
					"Could not open input stream to device: " 
							+ bluetoothDevice.getName());
		} 
		return result;
	} 
 
	private void showNotification() { 
		// In this sample, we'll use the same text for the ticker and the