Recording App

Example:

                                    
// add following permission in AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.STORAGE" />


// main_activity.java
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".recordingapp.RecordingAppFragment"
    android:padding="16dp">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="none">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:layout_gravity="center">

            <Button
                android:id="@+id/startrecord"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Start Recording"
                android:textSize="16sp"
                android:textColor="#FFFFFF"
                android:padding="16dp"
                android:background="@color/colorPrimaryDark" />

            <Button
                android:layout_below="@id/startrecord"
                android:id="@+id/stopRecording"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Stop Recording"
                android:textSize="16sp"
                android:textColor="#FFFFFF"
                android:padding="16dp"
                android:background="@color/colorPrimaryDark"
                android:layout_marginTop="10dp" />

            <Button
                android:layout_below="@id/stopRecording"
                android:id="@+id/playRecording"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Play Recording"
                android:textSize="16sp"
                android:textColor="#FFFFFF"
                android:padding="16dp"
                android:background="@color/colorPrimaryDark"
                android:layout_marginTop="10dp" />

            <Button
                android:layout_below="@id/playRecording"
                android:id="@+id/stop_playing_record"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Stop Playing Record"
                android:textSize="16sp"
                android:textColor="#FFFFFF"
                android:padding="16dp"
                android:background="@color/colorPrimaryDark"
                android:layout_marginTop="10dp" />

        </RelativeLayout>
    </ScrollView>

</RelativeLayout>