錄音相關權限
主程序代碼:
package com.yqy.yqy_record;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaRecorder;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.ListView;
import android.widget.SimpleAdapter;
public class MainActivity extends Activity {
private Button btn;
private ListView lv;
private SimpleAdapter adapter;
private MediaRecorder recorder;
private static final String RECORD_DIR = "temp_record";
// 獲得存儲在外部的路徑
private File dir = new File(Environment.getExternalStorageDirectory(),
RECORD_DIR);
private List