{"id":1010,"date":"2017-01-05T04:25:32","date_gmt":"2017-01-05T04:25:32","guid":{"rendered":"http:\/\/abhiandroid.com\/androidstudio\/?p=1010"},"modified":"2018-06-05T07:13:28","modified_gmt":"2018-06-05T07:13:28","slug":"add-audio-android-studio","status":"publish","type":"post","link":"https:\/\/abhiandroid.com\/androidstudio\/add-audio-android-studio.html","title":{"rendered":"How To Add Audio To App In Android Studio"},"content":{"rendered":"<p>Adding audio clip to android application is a simple task as it also add some further functionality. Here is a step by step on how to play music when App will start.<\/p>\n<hr \/>\n<h4><strong>Adding Audio to app in Android Studio:<\/strong><\/h4>\n<p><span style=\"color: #008000;\"><strong>Step 1:<\/strong><\/span> Open the android studio with the project in which you want to add-on audio clip\/media file.<br \/>\n<strong><span style=\"color: #008000;\">Step 2<\/span><\/strong>: Create a <a href=\"\/androidstudio\/create-raw-folder-android-studio.html\">raw folder<\/a>.<br \/>\n<span style=\"color: #008000;\"><strong>Step 3:<\/strong> <\/span>Add media file to raw folder by simply copy and paste that to raw folder.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1017\" src=\"\/androidstudio\/wp-content\/uploads\/2016\/12\/Adding-Media-In-Android-Studio.jpg\" alt=\"adding-media-in-android-studio\" width=\"324\" height=\"340\" srcset=\"https:\/\/abhiandroid.com\/androidstudio\/wp-content\/uploads\/2016\/12\/Adding-Media-In-Android-Studio.jpg 324w, https:\/\/abhiandroid.com\/androidstudio\/wp-content\/uploads\/2016\/12\/Adding-Media-In-Android-Studio-286x300.jpg 286w\" sizes=\"auto, (max-width: 324px) 100vw, 324px\" \/><br \/>\n<span style=\"color: #008000;\"><strong>Step 4:<\/strong><\/span>\u00a0Here we added a media file &#8220;<span style=\"color: #008000;\">ring.mp3<\/span>&#8221; . Now open the Java File of desired activity, here we are adding audio in MainActivity.<br \/>\n<span style=\"color: #008000;\"><strong>Step 5:<\/strong><\/span>\u00a0Further add this code<\/p>\n<pre>MediaPlayer ring= MediaPlayer.create(MainActivity.this,R.raw.ring);\r\n        ring.start();\r\n<\/pre>\n<p><span style=\"color: #008000;\"><strong>Step 6:<\/strong><\/span> Now run the App and your music will play when App will start.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Adding audio clip to android application is a simple task as it also add some further functionality. Here is a step by step on how to play music when App will start. Adding Audio to app in Android Studio: Step 1: Open the android studio with the project in which you want to add-on audio &hellip; <a href=\"https:\/\/abhiandroid.com\/androidstudio\/add-audio-android-studio.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">How To Add Audio To App In Android Studio<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63,1,62],"tags":[],"class_list":["post-1010","post","type-post","status-publish","format-standard","hentry","category-android-studio","category-archieve","category-tips"],"psp_head":"<title>How To Add Audio To App In Android Studio \u2013 Abhi Android<\/title>\r\n<meta name=\"description\" content=\"Adding audio clip to android application is a simple task as it also add some further functionality. Here is a step by step on how to play music when App will start.\" \/>\r\n<meta name=\"robots\" content=\"index,follow\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/abhiandroid.com\/androidstudio\/add-audio-android-studio.html\" \/>\r\n","_links":{"self":[{"href":"https:\/\/abhiandroid.com\/androidstudio\/wp-json\/wp\/v2\/posts\/1010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/abhiandroid.com\/androidstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/abhiandroid.com\/androidstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/abhiandroid.com\/androidstudio\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/abhiandroid.com\/androidstudio\/wp-json\/wp\/v2\/comments?post=1010"}],"version-history":[{"count":1,"href":"https:\/\/abhiandroid.com\/androidstudio\/wp-json\/wp\/v2\/posts\/1010\/revisions"}],"predecessor-version":[{"id":1453,"href":"https:\/\/abhiandroid.com\/androidstudio\/wp-json\/wp\/v2\/posts\/1010\/revisions\/1453"}],"wp:attachment":[{"href":"https:\/\/abhiandroid.com\/androidstudio\/wp-json\/wp\/v2\/media?parent=1010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/abhiandroid.com\/androidstudio\/wp-json\/wp\/v2\/categories?post=1010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/abhiandroid.com\/androidstudio\/wp-json\/wp\/v2\/tags?post=1010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}