Introduction
Xamarin is a platform to develop the cross-platform and multi-platform apps. (Ex. Windows phone, Android, iOS) in Xamarin platform, where code sharing concept is used. In Xamarin Studio, Visual Studio is also available.
Audio Record control is used to record audio, using a Mic.
Prerequisites
- Visual Studio 2015 Update 3
The steps are given below in order to record audio in an Android app, using Visual Studio 2015.
Step 1
Click File--> select New--> select Project. The project needs to be clicked, after opening all types of projects in Visual Studio
or click (Ctrl+Shift+N).

Step 2
After opening New Project, select Installed-->Templates-->Visual C#-->Android-->choose the blank App (Android).
Now, give your Android app; a name (Ex:sample) and give the path of your project. Afterwards, click OK.

Step 3
Now, go to Solution Explorer. In Solution Explorer, get all the files and sources in your project.
Select Resource-->Layout-->double click to open main.axml page. You need to select the source to write XAML code.
If you want to design, choose the designer Window and you can design your app.

Step 4
After opening main.axml, file will open the main page designer. In this page, you can design the page, as per your wish.

Now, delete the Linear Layout and default hello world button. Go to the source panel. You can see the button coding. You need to delete it.
After deleting XAML code, now delete C# button action code.
Go to the MainActivity.cs page. You need to delete the button code.
Step 5
Now, go to the toolbox Window. In the toolbox Window, get all types of the tools and control.You will go to the toolbox Window. Now, scroll down. You will see all the tools and control.
You need to drag and drop the two buttons.

Step 6
Now, go to the properties Window. You need to edit the First button's Id value and Text value (Ex:android:id="@+id/start" android:text="Start Recording").

Step 7
You need to edit the Second button's Id value and Text value (Ex:android:id="@+id/Stop" android:text="Stop Recording").

Step 8
You need to change second button enabled value (Ex: android:enabled="false").

Step 9
In this step, go to the Main.axml page Source Panel. Note the button's Id value.
Main.axml
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
- <Button android:id="@+id/start" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Start Recording" />
- <Button android:id="@+id/stop" android:layout_width="fill_parent" android:layout_height="wrap_content" android:enabled="false" android:text="Stop Recording" />
- </LinearLayout>










what whatPosted Jan 31, 2020, 11:02 PM
How do I implement this using xamarin forms?
keertana dapariPosted Apr 28, 2017, 1:46 AM
How to play this audio after recording it. Can u please tell me
Prasanna MuraliPosted Oct 22, 2016, 11:50 AM
Nice post....
Shamim UddinPosted Oct 20, 2016, 10:29 PM
Nice