{"id":4269,"date":"2021-11-15T13:26:22","date_gmt":"2021-11-15T05:26:22","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4269"},"modified":"2022-04-08T18:15:56","modified_gmt":"2022-04-08T10:15:56","slug":"get-devices","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/android-toolkit\/get-devices\/","title":{"rendered":"Get Media Devices: Android SDK &#8211; Video API"},"content":{"rendered":"\n<ul><li><a href=\"#get-devices\">Get list of Audio Devices<\/a><\/li><li><a href=\"#get-selected-devices\">Get selected Audio Device by User<\/a><\/li><li><a href=\"#handle-audio-device-updates\">Handle Device Updates<\/a><\/li><\/ul>\n\n\n\n<a name=\"get-devices\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Get a list of Audio Devices<\/h2>\n\n\n\n<p>You can initiate a Stream&nbsp;using&nbsp;either the browser\u2019s default Audio Device or&nbsp;by&nbsp;specifying&nbsp;the ID of&nbsp;the Audio Device connected to the device running the client application which requires you to get the Device IDs of all the connected devices. &nbsp;&nbsp;<\/p>\n\n\n\n<p>The <code>EnxRoom.getDevices()<\/code> method provides a list of all the Microphones connected to your Device. You can also use this method to build UI Element allowing users to choose an Audio Device from the list.<\/p>\n\n\n\n<p><strong>Class<\/strong>: <code>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Method<\/strong>: <code>public List &lt;String&gt; getDevices() <\/code>&#8211; No parameter required.<\/p>\n\n\n\n<p><strong>Returns<\/strong>: List of Devices.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">List deviceList = enxRoom.getDevices();\n\n\/\/ Returns [SPEAKER_PHONE,&nbsp;WIRED_HEADSET,&nbsp;EARPIECE,&nbsp;BLUETOOTH,&nbsp;NONE ] <\/pre>\n\n\n\n<a name=\"get-selected-devices\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Get selected Audio Device by User<\/h2>\n\n\n\n<p>The <code>EnxRoom.getSelectedDevice()<\/code> method provides the currently selected\/in-use Audio Device for the Stream. <\/p>\n\n\n\n<p><strong>Class<\/strong>: <code>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Method<\/strong>: <code>public String getSelectedDevice() <\/code>&#8211; No parameter required.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">String selectedDevice = room.getSelectedDevice();<\/pre>\n\n\n\n<a name=\"handle-audio-device-updates\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Handle Audio Device Updates<\/h2>\n\n\n\n<p>The notification on any addition or modification in the Audio Devices such as earphones or headphones connected to the Mobile device is provided through the following Callbacks: <\/p>\n\n\n\n<p><strong>Callbacks<\/strong>:<\/p>\n\n\n\n<ul><li><code>onNotifyDeviceUpdate <\/code>&#8211; Acknowledgment to the user when a switch to alternate media devices is made at run-time.<\/li><li><code>onDeviceAdded <\/code>&#8211; Notification to the user when a new Audio Device is connected.<\/li><li><code>onDeviceRemoved <\/code>&#8211; Notification to the user when an Audio Device is disconnected.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">public void onDeviceAdded(String message) {\n\t\/\/ New Device added\n}\n\npublic void onDeviceRemoved(String message) {\n\t\/\/ Device removed\n}\n\npublic void onNotifyDeviceUpdate (String message) {\n\t\/\/ Device switched\n}<\/pre>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<p>\u2190 <a href=\"..\/how-to-use\/\">How to use Android SDK<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-center\"><a href=\"..\/\">Index<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-right\"><a href=\"..\/local-stream\/\">Create Local Stream<\/a> \u2192<a href=\"\/developer\/how-to-use\/\"><\/a><\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Get list of Audio Devices Get selected Audio Device by User Handle Device Updates Get a list of Audio Devices You can initiate a Stream&nbsp;using&nbsp;either the browser\u2019s default Audio Device or&nbsp;by&nbsp;specifying&nbsp;the ID of&nbsp;the Audio Device connected to the device running the client application which requires you to get the Device IDs of all the connected devices. &nbsp;&nbsp; The EnxRoom.getDevices() method provides a list of all the Microphones connected to your&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3740,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ub_ctt_via":""},"featured_image_src":null,"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"featured":false,"featured-large":false},"uagb_author_info":{"display_name":"vcxdevwpadmin","author_link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/author\/vcxdevwpadmin\/"},"uagb_comment_info":0,"uagb_excerpt":"Get list of Audio Devices Get selected Audio Device by User Handle Device Updates Get a list of Audio Devices You can initiate a Stream&nbsp;using&nbsp;either the browser\u2019s default Audio Device or&nbsp;by&nbsp;specifying&nbsp;the ID of&nbsp;the Audio Device connected to the device running the client application which requires you to get the Device IDs of all the connected&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4269"}],"collection":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/comments?post=4269"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4269\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3740"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}