The
Toast
displays the name of the audio file created and played by the app.
We can call the
setDataSource
method of a
MediaPlayer
only once;
subsequent calls do nothing.
We therefore create a new
MediaPlayer
before each call to
setDataSource
.
See
Audio
Capture.
To do: the
RelativeLayout
can be a
LinearLayout
with
android:gravity="center"
.
CaptureActivity.java
main.xml
creates two
ToggleButton
s,
record and play.AndroidManifest.xml
contains
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
cd Desktop adb shell ls -l /mnt/sdcard/capture.3gp ----rwxr-x system sdcard_rw 5912 2011-06-28 21:01 capture.3gp
adb pull /mnt/sdcard/capture.3gp 58 KB/s (5912 bytes in 0.098s)
dir capture.3gp 06/28/2011 09:01 PM 5,912 capture.3gp