{"_id":"594c9259ae68a2001533f4b4","project":"5540ce1b31827a0d007ab1cc","version":{"_id":"5540ce1c31827a0d007ab1cf","project":"5540ce1b31827a0d007ab1cc","__v":31,"createdAt":"2015-04-29T12:27:08.390Z","releaseDate":"2015-04-29T12:27:08.390Z","categories":["5540ce1c31827a0d007ab1d0","5540d91bbb9e762d00f594ad","5540e5f131827a0d007ab212","5540e5febb9e762d00f594d3","5540e61331827a0d007ab213","5540e6195cf9682100d61afa","5540e62631827a0d007ab214","5540e63031827a0d007ab215","5540e63531827a0d007ab216","5540e63e5cf9682100d61afc","5540e6445cf9682100d61afd","5540e64a5cf9682100d61afe","55a4ff5b2e70c0250038050f","55acb28318eefd0d0071d504","55ae1abe8576b92300291c80","55ae453ef302af23000ac109","55af586d555b900d0036d296","55af91dac8a85321007a53c3","55b9fee204775a2f00628071","55b9ff0e04775a2f00628072","55b9ff4604775a2f00628073","55b9ff5fd72d1e1900276a38","55b9ff7f04775a2f00628074","55b9ff90eb08801900f833e5","55b9ffa5d72d1e1900276a39","55b9ffca04775a2f00628075","55b9fffdd72d1e1900276a3a","56bc2f033ee9e70d008b46af","56c2f6efbbf9ec2d00e0fe4f","57595bbb18760817001e8bbe","57d8d9793916800e003dde53"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"5540e5f131827a0d007ab212","__v":15,"project":"5540ce1b31827a0d007ab1cc","pages":["5540e66b31827a0d007ab217","5540e67731827a0d007ab219","55ac917b5863b817008ae3b4","55acaa4c6b4ff90d00784a92","55acb96418eefd0d0071d553","55acc8aa18eefd0d0071d596","55accd2818eefd0d0071d5a8","55acd06518eefd0d0071d5b6","55acddd7fb7b3c19003739cc","55ace14bfb7b3c19003739d3","55ace3a9fb7b3c19003739d7","55acea24f93f0c0d005b880f","55acf15bf93f0c0d005b8821","55acf3cd18eefd0d0071d5fb","55d1f1c0486de50d00326f17"],"version":"5540ce1c31827a0d007ab1cf","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-29T14:08:49.271Z","from_sync":false,"order":4,"slug":"android","title":"Android"},"user":"55b8b82fdec1c9210013cfa1","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-06-23T04:00:25.479Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"[**Download SDK**](https://github.com/Pushwoosh/pushwoosh-android-sdk)\n[**Sample Project**](https://github.com/Pushwoosh/pushwoosh-android-sdk/tree/master/Samples/Android-Simple)\n[**SDK API Docs**](https://rawgit.com/Pushwoosh/pushwoosh-android-sdk/master/Documentation/index.html)\n\nTo integrate Pushwoosh into your Android application follow these simple steps:\n\n**1.** Add **pushwoosh**, **android support v4** and **google play services** library dependencies into your application build.gradle:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"compile 'com.pushwoosh:pushwoosh:+'\\ncompile 'com.android.support:support-v4:+'\\ncompile 'com.google.android.gms:play-services-gcm:+'\",\n      \"language\": \"groovy\",\n      \"name\": \"build.gradle\"\n    }\n  ]\n}\n[/block]\nReplace \"+\" with the current version of Pushwoosh, Android Support and Google Play Services libraries.\n\n**2.** Add following metadata in AndroidManifest.xml:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<meta-data android:name=\\\"com.pushwoosh.appid\\\" android:value=\\\"XXXXX-XXXXX\\\" />\\n<meta-data android:name=\\\"com.pushwoosh.senderid\\\" android:value=\\\"A123456789012\\\" />\",\n      \"language\": \"xml\",\n      \"name\": \"AndroidManifest.xml\"\n    }\n  ]\n}\n[/block]\nWhere:\n*com.pushwoosh.appid* is your Pushwoosh Application Code\n*com.pushwoosh.senderid* is the *Project Number* you received from Google ([Locate your Project Number](http://docs.pushwoosh.com/docs/android-faq#how-to-locate-my-google-project-number)), prefixed with A.\n\n**3.** Register for push notifications:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Pushwoosh.getInstance().registerForPushNotifications();\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n**4.** In AndroidManifest.xml specify notification resources for small icon and notification icon background color:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<meta-data\\n            android:name=\\\"com.pushwoosh.notification_icon\\\"\\n            android:value=\\\":::at:::drawable/notification_icon_resource_name\\\" />\\n<meta-data\\n            android:name=\\\"com.pushwoosh.notification_icon_color\\\"\\n            android:value=\\\"@color/notification_icon_color\\\" />\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\nNotification small icon should be 24x24dp and alpha-only. The system ignores all non-alpha channels in action icons and in the notification small icon.","excerpt":"","slug":"android-sdk","type":"basic","title":"Android SDK"}
[**Download SDK**](https://github.com/Pushwoosh/pushwoosh-android-sdk) [**Sample Project**](https://github.com/Pushwoosh/pushwoosh-android-sdk/tree/master/Samples/Android-Simple) [**SDK API Docs**](https://rawgit.com/Pushwoosh/pushwoosh-android-sdk/master/Documentation/index.html) To integrate Pushwoosh into your Android application follow these simple steps: **1.** Add **pushwoosh**, **android support v4** and **google play services** library dependencies into your application build.gradle: [block:code] { "codes": [ { "code": "compile 'com.pushwoosh:pushwoosh:+'\ncompile 'com.android.support:support-v4:+'\ncompile 'com.google.android.gms:play-services-gcm:+'", "language": "groovy", "name": "build.gradle" } ] } [/block] Replace "+" with the current version of Pushwoosh, Android Support and Google Play Services libraries. **2.** Add following metadata in AndroidManifest.xml: [block:code] { "codes": [ { "code": "<meta-data android:name=\"com.pushwoosh.appid\" android:value=\"XXXXX-XXXXX\" />\n<meta-data android:name=\"com.pushwoosh.senderid\" android:value=\"A123456789012\" />", "language": "xml", "name": "AndroidManifest.xml" } ] } [/block] Where: *com.pushwoosh.appid* is your Pushwoosh Application Code *com.pushwoosh.senderid* is the *Project Number* you received from Google ([Locate your Project Number](http://docs.pushwoosh.com/docs/android-faq#how-to-locate-my-google-project-number)), prefixed with A. **3.** Register for push notifications: [block:code] { "codes": [ { "code": "Pushwoosh.getInstance().registerForPushNotifications();", "language": "java" } ] } [/block] **4.** In AndroidManifest.xml specify notification resources for small icon and notification icon background color: [block:code] { "codes": [ { "code": "<meta-data\n android:name=\"com.pushwoosh.notification_icon\"\n android:value=\"@drawable/notification_icon_resource_name\" />\n<meta-data\n android:name=\"com.pushwoosh.notification_icon_color\"\n android:value=\"@color/notification_icon_color\" />", "language": "xml" } ] } [/block] Notification small icon should be 24x24dp and alpha-only. The system ignores all non-alpha channels in action icons and in the notification small icon.