Code example for FileInputStream

Methods: getFD

0
      mFileOut.close();
      mFileOut = null;
       
	  // Use a filedescriptor instead of direct file 
	  // This will enable easy transition to sockets later 
	  FileInputStream fileIn = new FileInputStream(mFileName);
	  mFD = fileIn.getFD();
	   
      mPlayer = new MediaPlayer();
      mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
      mPlayer.setDataSource(mFD);
      mPlayer.prepare(); // might take long! (for buffering, etc)
      mPlayer.start();
  } 
     
    /** Get the refs to the ui elements on the page */ 
    public void setupUIReferences() { 
      mTalkButton = (Button)this.findViewById(R.id.talkButton);
      mGuysButton = (Button)this.findViewById(R.id.guysButton);
      }