Close Menu
Techs Slash

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Designing for Milliseconds: The Precision Tech Behind Aviator 

    April 6, 2026

    The One App You Only Open When Something Is Already Happening

    April 6, 2026

    375 Suppressor Guide: Enhancing Performance of the 375 Raptor Platform

    April 6, 2026
    Facebook X (Twitter) Instagram
    Techs Slash
    • Home
    • News
      • Tech
      • Crypto News
      • Cryptocurrency
    • Entertainment
      • Actors
      • ANGEL NUMBER
      • Baby Names
      • Beauty
      • beauty-fashion
      • facebook Bio
      • Fitness
      • Dubai Tour
    • Business
      • Business Names
    • Review
      • Software
      • Smartphones & Apps
    • CONTRIBUTION
    Facebook X (Twitter) Instagram
    Techs Slash
    Home»imran»Build an Audio or Sound Recorder Android App in Android Studio Using Java
    imran

    Build an Audio or Sound Recorder Android App in Android Studio Using Java

    Ranveer KumarBy Ranveer KumarOctober 19, 2022No Comments2 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email

    Warning: Trying to access array offset on value of type bool in /home/cadesimu/techsslash.com/wp-content/themes/smart-mag/partials/single/featured.php on line 78
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Construct a Sound or Sound Recorder Android Application in Android Studio Utilizing Java Article has numerous implications. We will know this subject plainly through this article. We want to believe that you like this article.

    Build an Audio or Sound Recorder Android App in Android Studio Using Java

    package com.example.myaudiorecorder.myaudiorecorder;
    
    import android.Manifest;
    import android.content.pm.PackageManager;
    import android.media.MediaRecorder;
    import android.os.Environment;
    import android.support.v4.app.ActivityCompat;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.view.View;
    
    import java.io.File;
    
    public class MainActivity extends AppCompatActivity {
    
    MediaRecorder mediaRecorder;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    
    ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, PackageManager.PERMISSION_GRANTED);
    ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.RECORD_AUDIO}, PackageManager.PERMISSION_GRANTED);
    
    mediaRecorder = new MediaRecorder();
    }
    
    public void startRecording(View view){
    
    try {
    
    mediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
    mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
    
    File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
    File file = new File(path, “/YouTubeAudio.3gp”);
    
    mediaRecorder.setOutputFile(file);
    mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    
    mediaRecorder.prepare();
    mediaRecorder.start();
    
    }
    catch (Exception e){
    e.printStackTrace();
    }
    }
    
    public void stopRecording(View view){
    
    mediaRecorder.stop();
    mediaRecorder.release();
    
    }
    
    }
    <?xml version=”1.0″ encoding=”utf-8″?>
    <manifest xmlns:android=”http://schemas.android.com/apk/res/android”
    package=”com.example.myaudiorecorder.myaudiorecorder”>
    
    <uses-permission android:name=”android.permission.RECORD_AUDIO”/>
    <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE”/>
    
    <application
    android:allowBackup=”true”
    android:icon=”@mipmap/ic_launcher”
    android:label=”@string/app_name”
    android:roundIcon=”@mipmap/ic_launcher_round”
    android:supportsRtl=”true”
    android:theme=”@style/AppTheme”>
    <activity android:name=”.MainActivity”>
    <intent-filter>
    <action android:name=”android.intent.action.MAIN” />
    
    <category android:name=”android.intent.category.LAUNCHER” />
    </intent-filter>
    </activity>
    </application>
    
    </manifest>
    <?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=”com.example.myaudiorecorder.myaudiorecorder.MainActivity”>
    
    <Button
    android:id=”@+id/button”
    android:layout_width=”wrap_content”
    android:layout_height=”wrap_content”
    android:layout_alignParentStart=”true”
    android:layout_alignParentTop=”true”
    android:layout_marginStart=”129dp”
    android:layout_marginTop=”93dp”
    android:onClick=”startRecording”
    android:text=”@string/start” />
    
    <Button
    android:id=”@+id/button2″
    android:layout_width=”wrap_content”
    android:layout_height=”wrap_content”
    android:layout_alignStart=”@+id/button”
    android:layout_below=”@+id/button”
    android:layout_marginTop=”146dp”
    android:onClick=”stopRecording”
    android:text=”@string/stop” />
    </RelativeLayout>

    Final Words

    Fabricate a Sound or Sound Recorder Android Application in Android Studio Utilizing Java We got to know our subject plainly. Furthermore, assuming that you feel somewhat uncertain about this article you can tell us your questions by means of remark.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Ranveer Kumar
    • Website

    Related Posts

    Why Saibo898 Is Becoming a Top Choice for Online Casino Players

    March 12, 2026

    SEO vs. PPC: Which is Best for Your Orlando Business?

    June 10, 2025

    Enhancing Efficiency with the Memory Traceable Monitoring Thermometer

    January 21, 2025
    Leave A Reply Cancel Reply

    Top Posts

    Sapne Me Nahane Ka Matlab

    March 18, 2024

    Sapne Me Nagn Stri Dekhna

    March 18, 2024

    Self Reliance: Release Date, Cast, Plot, Trailer, and More Information

    March 18, 2024

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    ABOUT TECHSSLASH

    Welcome to Techsslash! We're dedicated to providing you with the best of technology, finance, gaming, entertainment, lifestyle, health, and fitness news, all delivered with dependability.

    Our passion for tech and daily news drives us to create a booming online website where you can stay informed and entertained.

    Enjoy our content as much as we enjoy offering it to you

    Most Popular

    Sapne Me Nahane Ka Matlab

    March 18, 2024

    Sapne Me Nagn Stri Dekhna

    March 18, 2024

    Self Reliance: Release Date, Cast, Plot, Trailer, and More Information

    March 18, 2024
    CONTACT DETAILS

    Phone: +92-302-743-9438
    Email: contact@serpinsight.com

    Our Recommendation

    Here are some helpfull links for our user. hopefully you liked it.

    kakekmerah4d

    Techs Slash
    Facebook X (Twitter) Instagram Pinterest
    • Home
    • About us
    • contact us
    • Affiliate Disclosure
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • Write for us
    • Daman Game
    © 2026 Techsslash. All Rights Reserved

    Type above and press Enter to search. Press Esc to cancel.