{"_id":"566c97739aa84517001b4fc4","user":"54449dc49be40214000dedda","version":{"_id":"566c97729aa84517001b4fbb","__v":1,"project":"544494099be40214000dedb6","createdAt":"2015-12-12T21:53:54.721Z","releaseDate":"2015-12-12T21:53:54.721Z","categories":["566c97739aa84517001b4fbc","566c97739aa84517001b4fbd","566c97739aa84517001b4fbe","566c97739aa84517001b4fbf"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"2.1.0","version":"2.1"},"__v":0,"category":{"_id":"566c97739aa84517001b4fbd","pages":["566c97739aa84517001b4fc0","566c97739aa84517001b4fc1","566c97739aa84517001b4fc2","566c97739aa84517001b4fc3","566c97739aa84517001b4fc4","566c97739aa84517001b4fc5","566c97739aa84517001b4fc6","566c97739aa84517001b4fc7","566c97739aa84517001b4fc8","566c97739aa84517001b4fc9"],"project":"544494099be40214000dedb6","version":"566c97729aa84517001b4fbb","__v":1,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-20T05:03:22.419Z","from_sync":false,"order":1,"slug":"how-to","title":"How to"},"project":"544494099be40214000dedb6","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-23T08:56:05.391Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Download Pushmote Android SDK\"\n}\n[/block]\nDownload and unzip the Pushmote Android SDK.\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Download Link\",\n  \"body\": \"[https://github.com/Pushmote/Android-SDK](https://github.com/Pushmote/Android-SDK)\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. Copy SDKs into your project folder\"\n}\n[/block]\nDrag and drop the EstimoteSDK and PushmoteSDK folders into your project.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/G6F40UhrTuGuIB1LwmuE_copy_android_sdk.png\",\n        \"copy_android_sdk.png\",\n        \"1154\",\n        \"561\",\n        \"#344766\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"3. Add libraries to your build.gradle file\"\n}\n[/block]\nOpen your build.gradle file and add estimote-sdk-preview and pushmote-sdk as a dependency.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"dependencies {\\n    compile(name:'estimote-sdk-preview', ext:'aar')\\n    compile(name:'pushmote-sdk', ext:'aar')\\n    compile 'com.squareup.retrofit:retrofit:1.9.0'\\n}\\n\\n\\nrepositories {\\n    mavenCentral()\\n    flatDir {\\n        dirs '../EstimoteSDK'\\n        dirs '../PushmoteSDK'\\n    }\\n}\",\n      \"language\": \"scala\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"4. Add onCreate, onStart and onStop methods in your Activity\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"  \\t:::at:::Override\\n    protected void onCreate(Bundle savedInstanceState) {\\n        super.onCreate(savedInstanceState);\\n        setContentView(R.layout.activity_main);\\n        Pushmote.start(Pushmote.HWProvider.ESTIMOTE, this, \\\"APP_KEY\\\");\\n    }\\n\\n\\t\\[email protected]\\n    protected void onStart() {\\n        super.onStart();\\n        Pushmote.bringToForeground();\\n    }\\n\\n    @Override\\n    protected void onStop() {\\n        super.onStop();\\n        Pushmote.sendToBackground();\\n    }\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Bravo!\"\n}\n[/block]\nThat's all! You successfully imported the Pushmote SDK into your Android Mobile application.","excerpt":"","slug":"import-pushmote-android-sdk","type":"basic","title":"Import Pushmote Android SDK"}

Import Pushmote Android SDK


[block:api-header] { "type": "basic", "title": "1. Download Pushmote Android SDK" } [/block] Download and unzip the Pushmote Android SDK. [block:callout] { "type": "success", "title": "Download Link", "body": "[https://github.com/Pushmote/Android-SDK](https://github.com/Pushmote/Android-SDK)" } [/block] [block:api-header] { "type": "basic", "title": "2. Copy SDKs into your project folder" } [/block] Drag and drop the EstimoteSDK and PushmoteSDK folders into your project. [block:image] { "images": [ { "image": [ "https://files.readme.io/G6F40UhrTuGuIB1LwmuE_copy_android_sdk.png", "copy_android_sdk.png", "1154", "561", "#344766", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "3. Add libraries to your build.gradle file" } [/block] Open your build.gradle file and add estimote-sdk-preview and pushmote-sdk as a dependency. [block:code] { "codes": [ { "code": "dependencies {\n compile(name:'estimote-sdk-preview', ext:'aar')\n compile(name:'pushmote-sdk', ext:'aar')\n compile 'com.squareup.retrofit:retrofit:1.9.0'\n}\n\n\nrepositories {\n mavenCentral()\n flatDir {\n dirs '../EstimoteSDK'\n dirs '../PushmoteSDK'\n }\n}", "language": "scala" } ] } [/block] [block:api-header] { "type": "basic", "title": "4. Add onCreate, onStart and onStop methods in your Activity" } [/block] [block:code] { "codes": [ { "code": " \[email protected]\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n Pushmote.start(Pushmote.HWProvider.ESTIMOTE, this, \"APP_KEY\");\n }\n\n\t\[email protected]\n protected void onStart() {\n super.onStart();\n Pushmote.bringToForeground();\n }\n\n @Override\n protected void onStop() {\n super.onStop();\n Pushmote.sendToBackground();\n }", "language": "java" } ] } [/block] [block:api-header] { "type": "basic", "title": "Bravo!" } [/block] That's all! You successfully imported the Pushmote SDK into your Android Mobile application.