0
		Log.d(TAG, "bufferSize1:" + bufferSize1 + " bufferSize2:" + bufferSize2
				+ " sampleRate:" + sampleRate + " nChannelConfig:"
				+ nChannelConfig + " audioConfig:" + audioConfig);
		dataBuffer = new byte[PACKAGE_SIZE];
		recordInstance = new AudioRecord(MediaRecorder.AudioSource.MIC,
				sampleRate, nChannelConfig, audioConfig, bufferSize);
		// TODO may get null record instance 
		updateListener = new AudioRecord.OnRecordPositionUpdateListener() {
			public void onPeriodicNotification(AudioRecord recorder) {
				if (!isRecording) {
					Log.d(TAG, "not recording,discard data!");
					return; 
				} 
				int readsize = recordInstance.read(dataBuffer, 0,
						dataBuffer.length);
				sendDataMessage(dataBuffer, readsize);
			} 
 
			public void onMarkerReached(AudioRecord recorder) {
				// NOT USED 
			} 
		}; 
		recordInstance.setRecordPositionUpdateListener(updateListener);
		recordInstance.setPositionNotificationPeriod(framePeriod);
		recordInstance.startRecording();
		recordInstance.read(dataBuffer, 0, dataBuffer.length);
		isRecording = true;
		Log.d(TAG, "recorder->start");
	} 
 
	private void doStop() { 
Connect your IDE to all the code out there  Get Codota for Java