{"_id":"57d51af8b0249a0e002bb9b6","project":"54861bb654b3ce0b00367292","category":{"_id":"57d51ad68191880e008bb51b","project":"54861bb654b3ce0b00367292","__v":0,"version":"57b96d6b1d08500e00bf81d1","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-09-11T08:50:30.403Z","from_sync":false,"order":3,"slug":"android-essentials-kit","title":"Android / Essentials KIt"},"parentDoc":null,"user":"548d74b716fc980b00e2a786","__v":0,"version":{"_id":"57b96d6b1d08500e00bf81d1","__v":7,"project":"54861bb654b3ce0b00367292","createdAt":"2016-08-21T08:59:23.326Z","releaseDate":"2016-08-21T08:59:23.326Z","categories":["57b96d6b1d08500e00bf81d2","57b96d6b1d08500e00bf81d3","57b96d6b1d08500e00bf81d4","57b96d6b1d08500e00bf81d5","57b96d6b1d08500e00bf81d6","57b96d6b1d08500e00bf81d7","57b96d6b1d08500e00bf81d8","57b96d6b1d08500e00bf81d9","57b96d6b1d08500e00bf81da","57b96d6b1d08500e00bf81db","57b96d6b1d08500e00bf81dc","57b97748306b9b0e001dd53f","57d12c6c1227b40e0044908a","57d51ad68191880e008bb51b","57d52b5cf350090e00fe073e","57d5468a17b492170053a3f0","57df9df05927cb0e002bce1e"],"is_deprecated":true,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"4.0.0","version":"4.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-11T08:51:04.250Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"never","params":[],"url":""},"isReference":false,"order":0,"body":"**1. Download & Add the SDK**\n1.1. Sign up to our service at https://mc.elasticode.com/signUp.php \n1.2. Download our latest SDK here: https://mc.elasticode.com/SDK.php\n1.3. Import `elasticode.aar` into your project\n\n\n**2. Permissions to add into AndroidManifest.xml:**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<uses-permission android:name=\\\"android.permission.ACCESS_NETWORK_STATE\\\" />\\n<uses-permission android:name=\\\"android.permission.INTERNET\\\" />\\n<uses-permission android:name=\\\"android.permission.WRITE_EXTERNAL_STORAGE\\\"/>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n**3. Start using Elasticode**\n\n3.1 Obtain instance of Elasticode singlethon with:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Elasticode elasticode = Elasticode.getInstance(this, API_KEY, elasticodeObserver);\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n3.2 When using [launchMode](https://developer.android.com/guide/topics/manifest/activity-element.html#lmode) is `singleInstance` or `singleTask`, Override the `onNewIntent` method to update the activity\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \":::at:::Override\\nprotected void onNewIntent(Intent intent) {\\n\\tsuper.onNewIntent(intent);\\n  elasticode.setNewIntent(intent);\\n}\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n**4. Finally, When you’re done with all other possible configurations, you must call** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"elasticode.ready();\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"That's it!\"\n}\n[/block]\nYou are now good to run our <a href=\"http://helpdesk.elasticode.com/categories/1206-dynamic-onboarding\" target=\"_blank\">Dynamic onboarding</a> & <a href=\"http://helpdesk.elasticode.com/categories/1379-what-s-new\" target=\"_blank\">What's new</a>  services\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Actions & Analytics\",\n  \"body\": \"If you would like to provide more actions for buttons in your experiences or connect your experience to 3rd party analytics services, read about our [Extra setup](doc:extra-setup-actions-1)  (Optional)\"\n}\n[/block]","excerpt":"","slug":"setup-1","type":"basic","title":"Setup"}
**1. Download & Add the SDK** 1.1. Sign up to our service at https://mc.elasticode.com/signUp.php 1.2. Download our latest SDK here: https://mc.elasticode.com/SDK.php 1.3. Import `elasticode.aar` into your project **2. Permissions to add into AndroidManifest.xml:** [block:code] { "codes": [ { "code": "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n<uses-permission android:name=\"android.permission.INTERNET\" />\n<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", "language": "xml" } ] } [/block] **3. Start using Elasticode** 3.1 Obtain instance of Elasticode singlethon with: [block:code] { "codes": [ { "code": "Elasticode elasticode = Elasticode.getInstance(this, API_KEY, elasticodeObserver);", "language": "java" } ] } [/block] 3.2 When using [launchMode](https://developer.android.com/guide/topics/manifest/activity-element.html#lmode) is `singleInstance` or `singleTask`, Override the `onNewIntent` method to update the activity [block:code] { "codes": [ { "code": "@Override\nprotected void onNewIntent(Intent intent) {\n\tsuper.onNewIntent(intent);\n elasticode.setNewIntent(intent);\n}", "language": "java" } ] } [/block] **4. Finally, When you’re done with all other possible configurations, you must call** [block:code] { "codes": [ { "code": "elasticode.ready();", "language": "java" } ] } [/block] [block:api-header] { "type": "basic", "title": "That's it!" } [/block] You are now good to run our <a href="http://helpdesk.elasticode.com/categories/1206-dynamic-onboarding" target="_blank">Dynamic onboarding</a> & <a href="http://helpdesk.elasticode.com/categories/1379-what-s-new" target="_blank">What's new</a> services [block:callout] { "type": "success", "title": "Actions & Analytics", "body": "If you would like to provide more actions for buttons in your experiences or connect your experience to 3rd party analytics services, read about our [Extra setup](doc:extra-setup-actions-1) (Optional)" } [/block]