title: How to record a video directly on Helix Server from my Android device?
body: <p>I am new to server side development. I want to work on an application and I need to record a video on Helix Server from my Android device through my application. I have installed the Helix Server on a Windows Server PC.</p>
  
  <p>In the Android application, I am trying to upload a recorded video on the Helix Server. I have implemented my application for recording the video on SD card but I would like to record and save that video on Helix Server directly. I have implemented my Android application as follows:</p>
  
  <pre><code>public class NewRecordingVideo extends Activity implements SurfaceHolder.Callback {
      private MediaRecorder recorder;
      boolean flag = false;
      boolean startedRecording = false;
      boolean stoppedRecording = false;
      SurfaceHolder mHolder;
      SurfaceView videoSView;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          requestWindowFeature(Window.FEATURE_NO_TITLE);
          setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
          setContentView(R.layout.activity_main);
          recorder = new MediaRecorder();
          recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
          recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_RECOGNITION);
          recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
          recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
          recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
          videoSView = ((SurfaceView)findViewById(R.id.surfaceView1));
          mHolder=videoSView.getHolder();
          mHolder.addCallback(this);
          mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
  
          ((Button)findViewById(R.id.startBtn)).setOnClickListener(
              new OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
                  if(startedRecording == false) {
                      recorder.start();
                      startedRecording = true;
  
                      Toast.makeText(NewRecordingVideo.this,
                          "Your video is recording", Toast.LENGTH_LONG).show();
  
                   } else if (startedRecording == true &amp;&amp; stoppedRecording == false) {
                       recorder.stop();
                       recorder.release();
                       recorder = null;
                       stoppedRecording = true;
                   }
               }
           });
  
          ((Button)findViewById(R.id.stopBtn)).setOnClickListener(
              new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  recorder.stop();
                  recorder.release();
                  recorder = null;
                  stoppedRecording = true;
  
                  Toast.makeText(NewRecordingVideo.this,
                      "Your video recorded ", Toast.LENGTH_LONG).show();
                  finish();
              }
          }); 
      }
  
      public Surface getSurface() {
          return mHolder.getSurface();
      }
  
      @Override
      public void surfaceChanged(SurfaceHolder holder, int format,
          int width, int height) {
  
          // TODO Auto-generated method stub  
      }
  
      @Override
      public void surfaceCreated(SurfaceHolder holder) {
  
          try {
  
              Socket socket = new Socket("IP address", 8008);
              ParcelFileDescriptor pfd = ParcelFileDescriptor.fromSocket(socket);
              Log.v("find about connection","====&gt;"+socket.isConnected());
              recorder.setOutputFile("/sdcard/recording.3gp");
  
              // Here I would like to record my video (recording.3gp) on helix server directly    
              recorder.setPreviewDisplay(mHolder.getSurface());
              recorder.prepare();
  
          } catch (Exception e) {
              String message = e.getMessage();
              recorder.release();
              recorder = null;
          }
      }
  
      @Override
      public void surfaceDestroyed(SurfaceHolder holder) {
          if (recorder != null) {
              recorder.release();
              recorder = null;
          }
      }
  }
  </code></pre>
  
  <p>From the code above: How can I save my video recording file on Helix server directly?
  Should I do any implementation on server side development?</p>