{"id":5657,"date":"2022-02-02T13:23:33","date_gmt":"2022-02-02T05:23:33","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=5657"},"modified":"2025-04-04T21:23:53","modified_gmt":"2025-04-04T13:23:53","slug":"how-to-use","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/android-toolkit\/how-to-use\/","title":{"rendered":"How to use Android SDK?"},"content":{"rendered":"\n<h4>Table of Contents<\/h4>\n\n\n\n<a name=\"how-to\"><\/a>\n\n\n\n<ul><li><a href=\"#how-to-aar\">By using Android Archive Library (.aar)<\/a><\/li><li><a href=\"#define-permissions\">Define Permissions<\/a><\/li><li><a href=\"#define-features\">Define Features<\/a><\/li><li><a href=\"#error-exceptions\">Error &amp; Exceptions Handling<\/a><\/li><\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-vivid-red-color has-text-color\"><strong>Note: Installation instruction given below are applicable from Android SDK v2.3.3.<\/strong><\/p>\n\n\n\n<a name=\"how-to-aar\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>By using Android Archive Library (.aar) <\/h2>\n\n\n\n<ul><li><strong>Get Android SDK: <\/strong><a href=\"\/developer\/wp-content\/uploads\/video-sdk\/android\/EnxRtcAndroid-release_2.3.24.aar.zip\">Download Android SDK<\/a>. Extract it. You get .aar file for Android SDK.<\/li><li><strong>Get WebRTC SDK: <\/strong><a href=\"\/developer\/wp-content\/uploads\/webrtc-stack\/android\/Enx_WebRTC_Android.zip\">Download WebRTC SDK<\/a>. Extract it. You get .aar file for WebRTC SDK.<\/li><\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Process# 1<\/strong> <\/p>\n\n\n\n<ul><li><strong>Add to lib: <\/strong>Add both downloaded .aar files under <code>lib<\/code> folder.<\/li><li><strong>Edit App&#8217;s gradle: <\/strong> Go to your application&#8217;s <code>build.gradle<\/code> file and add the following code in the <code>dependencies<\/code> section:  <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">implementation fileTree(dir: \"libs\", include: [\"*.aar\"])\nimplementation('io.socket:socket.io-client:1.0.0') {\n     \t\/\/ Exclude org.json provided by Android     \n\texclude group: 'org.json', module: 'json'\n}\n\nimplementation 'android.arch.lifecycle:extensions:1.1.1'\n<\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Process# 2<\/strong><\/p>\n\n\n\n<p>This is alternate to Process#1. <\/p>\n\n\n\n<ul><li>Go to Project root and create a new directory.<\/li><li>Put the following content into the <code>build.gradle<\/code> file within the new directory:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">configurations.maybeCreate(\"default\") \nartifacts.add(\"default\", file('[nameOfTheAar].aar')) <\/pre>\n\n\n\n<ul><li>Place both downloaded <code>.aar<\/code> files into this new directoy next to the <code>build.gradle<\/code> file.<\/li><li>Add the newly created directory to the <code>settings.gradle<\/code> file:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">include(\":path\/new-directory\") <\/pre>\n\n\n\n<ul><li>Include the newly created library into your application.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">implementation project(\":path\/new-directory\", configuration = \"default\") <\/pre>\n\n\n\n<p><strong>Note:<\/strong> Process# 2 is a better approach than Process# 1 as it creates a module to add .aar files.<\/p>\n\n\n\n<a name=\"define-permissions\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Define Device Permissions<\/h2>\n\n\n\n<p>Define Permissions in <code>AndroidManifest.xml<\/code> as shown: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;uses-permission android:name=\"android.permission.CAMERA\"\/&gt;  \n&lt;uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"\/&gt;\n&lt;uses-permission android:name=\"android.permission.RECORD_AUDIO\"\/&gt;\n&lt;uses-permission android:name=\"android.permission.INTERNET\" \/&gt;\n&lt;uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"\/&gt; \n&lt;uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"\/&gt;\n&lt;uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"\/&gt;\n&lt;uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"\/&gt; \n&lt;uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"\/&gt;\n&lt;uses-permission android:name=\"android.permission.BLUETOOTH\"\/&gt;\n&lt;uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"\/&gt;<\/pre>\n\n\n\n<a name=\"define-features\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Define Features<\/h2>\n\n\n\n<p>Define features in <code>AndroidManifest.xml<\/code> as shown:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;uses-feature android:name=\"android.hardware.camera\"\/&gt; \n&lt;uses-feature android:name=\"android.hardware.camera.autofocus\"\/&gt;  \n&lt;uses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\"\/&gt;     <\/pre>\n\n\n\n<a name=\"error-exceptions\"><\/a>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Error &amp; Exceptions Handling<\/h2>\n\n\n\n<p>When Android SDK API call fails, it returns a JSON object through Callback as shown:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{\n\t\"errorCode\": Number,\n\t\"msg\": \"String\",\n\t\"desc\": \"String\"\n}<\/pre>\n\n\n\n<ul><li><code>errorCode<\/code>&nbsp;\u2013 Number. Error Code.<\/li><li>msg&nbsp;\u2013 String. Error Message.<\/li><li>desc&nbsp;\u2013 String. Optional. A descriptive explanation of the error.<\/li><\/ul>\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\"><\/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=\"..\/get-devices\/\">Get Media Device Access<\/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>Table of Contents By using Android Archive Library (.aar) Define Permissions Define Features Error &amp; Exceptions Handling Note: Installation instruction given below are applicable from Android SDK v2.3.3. By using Android Archive Library (.aar) Get Android SDK: Download Android SDK. Extract it. You get .aar file for Android SDK. Get WebRTC SDK: Download WebRTC SDK. Extract it. You get .aar file for WebRTC SDK. Process# 1 Add to lib: Add&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":"Table of Contents By using Android Archive Library (.aar) Define Permissions Define Features Error &amp; Exceptions Handling Note: Installation instruction given below are applicable from Android SDK v2.3.3. By using Android Archive Library (.aar) Get Android SDK: Download Android SDK. Extract it. You get .aar file for Android SDK. Get WebRTC SDK: Download WebRTC SDK.&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/5657"}],"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=5657"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/5657\/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=5657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}