try { InputStream is = data.getInputStream(); OutputStream os = data.getOutputStream(); // Process the data socket here } catch (Exception e) {}