title: How to stream phone screen hidden from user?
body: <p>Using this library <a href="https://github.com/pedroSG94/rtmp-rtsp-stream-client-java" rel="nofollow noreferrer">https://github.com/pedroSG94/rtmp-rtsp-stream-client-java</a> I can easely stream phone camera hidden from user but I can't stream phone display hidden from user because it requires user confirmation for screen streaming.</p>
  
  <p>Here is the axample of screen streaming <a href="https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/app/src/main/java/com/pedro/rtpstreamer/displayexample/DisplayRtspActivity.java" rel="nofollow noreferrer">https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/app/src/main/java/com/pedro/rtpstreamer/displayexample/DisplayRtspActivity.java</a></p>
  
  <blockquote>
    <p><strong>rtspDisplay.sendIntent()</strong> - use <strong>MediaProjectionManager.createScreenCaptureIntent()</strong> method which is requered for screen capture 
    <a href="https://developer.android.com/reference/android/media/projection/MediaProjectionManager.html#createScreenCaptureIntent()" rel="nofollow noreferrer">https://developer.android.com/reference/android/media/projection/MediaProjectionManager.html#createScreenCaptureIntent()</a></p>
  </blockquote>
  
  <pre><code>...
  startActivityForResult(rtspDisplay.sendIntent(), REQUEST_CODE_STREAM);
  ...
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == REQUEST_CODE_STREAM
          || requestCode == REQUEST_CODE_RECORD &amp;&amp; resultCode == Activity.RESULT_OK) {
        if (rtspDisplay.prepareAudio() &amp;&amp; rtspDisplay.prepareVideo()) {
          initNotification();
          rtspDisplay.setIntentResult(resultCode, data);
          if (requestCode == REQUEST_CODE_STREAM) {
            rtspDisplay.startStream(etUrl.getText().toString());
          } else {
            try {
              rtspDisplay.startRecord(folder.getAbsolutePath() + "/" + currentDateAndTime + ".mp4");
            } catch (IOException e) {
              rtspDisplay.stopRecord();
              bRecord.setText(R.string.start_record);
              Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
            }
          }
        } else {
          Toast.makeText(this, "Error preparing stream, This device cant do it", Toast.LENGTH_SHORT)
              .show();
        }
      } else {
        Toast.makeText(this, "No permissions available", Toast.LENGTH_SHORT).show();
      }
    }
  </code></pre>
  
  <p>How I can stream phone screen hidden from user using any other libraries or using Root?
  I am new to android development...</p>
  
  <p>Any advices are welcome!</p>