Тёмный

How to add sound to a button in android studio | Android studio tutorial 

Подписаться
Просмотров 34 тыс.
% 530

Hi guys, in this android development tutorial I explain how you can add sound effects to a button or view that you want a user to click on. I used MediaPlayer class to play the sound that I have already prepared. I only demonstrate on a Button you use any view in android to call OnClickListener and then call start() to play the sound file in raw folder.
If you find this useful please like this video and don't forget to subscribe.
Thank you for watching.
Follow me on facebook Techno-Coding-488399231922328/
#addSoundToButton #OnClickListener #androiddevelopment #android #tutorials

Наука

Опубликовано:

 

23 янв 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 38   
@snehalmishra5429
@snehalmishra5429 3 года назад
upto 4:00 - How to make a button and place it in center from 4:00 - How to add sounds in android studio
@someshsahu4638
@someshsahu4638 11 месяцев назад
nice video thank you so much 🙏🏼🙏🏼🙏🏼
@nyccomputer5949
@nyccomputer5949 Год назад
I haved 5 button with raw audio file but when i clicked on play fine but if i click another button untill finish first button there were playing both on same time I want When i click another button first button voice to stop at a time Plz help
@briancharlesco563
@briancharlesco563 2 года назад
Sir it is possible that when you clicked the button it will go to the next activity with a sound?
@avishekchakraborty8289
@avishekchakraborty8289 3 года назад
Yes it's working properly but how to stop the sound when the back button is pressed, i.e. when activity closed?
@Agru69
@Agru69 3 года назад
Sir if I write mediaPlayer.pause() below mediaPlayer.start() the audio is not stopping can you please help me ??
@akhilpadmanaban3242
@akhilpadmanaban3242 3 года назад
make another button and give on click listener to that pause button then call this pause method inside that...
@MuhammadHassan-qh3sm
@MuhammadHassan-qh3sm 3 года назад
How to add multiple Buttons and each button play different music?
@kaff864
@kaff864 4 года назад
How to play all sound file in one button click? All sound will play auto on button click?
@ABDULLAYEV_PUBGM07
@ABDULLAYEV_PUBGM07 2 года назад
thanks bro this is very nice video for me all of the android videous
@rahulkamble4617
@rahulkamble4617 4 года назад
Hey bro can u tell me how an audio can be automatically start as soon as the user opens the application , I don't want to use a button . I am a Tybscit Student need help for project purpose Please help : )
@TechnicalCoding
@TechnicalCoding 4 года назад
@overide the onstart method and paste the code inside of it. When the user enter the app that code will execute automatically.
@rahulkamble4617
@rahulkamble4617 4 года назад
@@TechnicalCoding Thankyou : )
@prottoyhasan7048
@prottoyhasan7048 4 года назад
Very Very helpful video sir. Thank you sir for this video tutorial.
@maheshmahadar4780
@maheshmahadar4780 4 года назад
my project throwing exeptions ..why bro ? .... i did it same
@raphelbenal4875
@raphelbenal4875 4 года назад
You are life saver man. I thinking of adding sounds to my app. How i can pause the music??
@TechnicalCoding
@TechnicalCoding 4 года назад
just call .pause() on the mediaplayer object when you want to pause
@simofatihi3842
@simofatihi3842 4 года назад
Can you explain i don't know how ?
@maheshmahadar4780
@maheshmahadar4780 4 года назад
@@simofatihi3842 MediaPlayer mediaPlayer = MediaPlayer mediaPlayer.pause();
@MrIMacro
@MrIMacro 3 года назад
@@maheshmahadar4780 please could you tell me where to put this code exactly?
@DouglasMorais-uz1ft
@DouglasMorais-uz1ft Год назад
Very good thank you! Helped me.
@rishikumargautam608
@rishikumargautam608 4 года назад
Showing Entry name 'META-INF/androidx.vectordrawable_vectordrawable.version' collided Error
@TechnicalCoding
@TechnicalCoding 4 года назад
i don't fully know about this error though but from the looks of it look like version conflict.
@emremuslu7763
@emremuslu7763 3 года назад
Thank you so much. Simple and works well.
@maliktanveer6172
@maliktanveer6172 4 года назад
Nice tutorials bro
@TechnicalCoding
@TechnicalCoding 4 года назад
Thanks
@jhonmiltalty7882
@jhonmiltalty7882 4 года назад
nice tutorial
@TechnicalCoding
@TechnicalCoding 4 года назад
THANKS BROTHER
@redqueengaming6
@redqueengaming6 3 года назад
so good
@scoisback
@scoisback 4 года назад
Bro thanks for video
@TechnicalCoding
@TechnicalCoding 4 года назад
welcome
@Sportsmeastro
@Sportsmeastro 3 года назад
Tanks
@iamyourdad9148
@iamyourdad9148 4 года назад
I learned Android without any teacher
@TechnicalCoding
@TechnicalCoding 4 года назад
that's really good because self learning is the best way to build a solid foundation on basic. When I started android there aren't many tutorial available in RU-vid so I joined a course. From you comment it reminds me of my early days of programming.
@GiviOfGivia
@GiviOfGivia 3 года назад
@@TechnicalCoding what a life back then ye.. thank you sir for making tutorials for us
@flavioestudio
@flavioestudio Год назад
muito bom. sou desenhista. se precisar de ajuda com desenhos, estou a disposição. thank you