{"_id":"55781fe45129590d003ff50e","category":{"_id":"55781fe35129590d003ff4fc","pages":["55781fe45129590d003ff50d","55781fe45129590d003ff50e","55781fe45129590d003ff50f","55781fe45129590d003ff510","55781fe45129590d003ff511","55781fe45129590d003ff512","55781fe45129590d003ff513","55781fe45129590d003ff514","55781fe45129590d003ff515","55781fe45129590d003ff516","55f692b4fe4cce21005c78b0","55f7e91e60cc850d008a7a45","56333cab9c607719001b85e4","564462ed9ce94c0d00068ce9","564f54fa48a1df1700836653","565ee9e7413e06170093dde0","5661a8fdb401c70d00dde6fa","5671348860c8e70d006c96a1","568ce9707d3bf02300aa7734"],"version":"55781fe25129590d003ff4f7","__v":10,"project":"54aa7f773b56130b0056c86e","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-01-05T12:44:00.338Z","from_sync":false,"order":4,"slug":"android-sdk","title":"Android SDK"},"user":"54aa7f3f9bb00c0b00cb899b","project":"54aa7f773b56130b0056c86e","version":{"_id":"55781fe25129590d003ff4f7","project":"54aa7f773b56130b0056c86e","forked_from":"54aa7f773b56130b0056c871","__v":6,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z","categories":["55781fe35129590d003ff4f8","55781fe35129590d003ff4f9","55781fe35129590d003ff4fa","55781fe35129590d003ff4fb","55781fe35129590d003ff4fc","55781fe35129590d003ff4fd","55781fe35129590d003ff4fe","564bbc7e8841060d00abb2ee","565b66c446118c0d00dcb0bb","56898269f8dc340d00308c13","582318b23b961a0f009516a1","594a848c9f4771001a43c959"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Developers","version_clean":"2.0.0","version":"2.0"},"__v":61,"githubsync":"","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-01-05T12:56:01.793Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Pulsate Android SDK is a static library. It's a bridge between your customers' mobile devices and the Pulsate server. **The SDK Supports Android API 14 - 27**.\nIt's very easy to use, and takes about 5 minutes to install.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 1: Setup Android Studio\"\n}\n[/block]\n**Make sure you are using latest version of Android Studio.**\n\n1. Make sure your project uses jcenter as a dependency repository (default on latest version of the Android Gradle plugin). \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"buildscript {\\n    repositories {\\n        jcenter()\\n    }\\n}\\n\\nallprojects {\\n    repositories {\\n        jcenter()\\n    }\\n}\",\n      \"language\": \"text\",\n      \"name\": \"build.gradle\"\n    }\n  ]\n}\n[/block]\n2. Add *compile 'com.pulsatehq.sdk:PulsateSdk:version'* to the dependencies of your project. Change version to the actual version of the SDK that you want to use. All versions can be found here -  https://pulsate.readme.io/docs/android-release-notes\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"dependencies {\\n\\tcompile 'com.pulsatehq.sdk:PulsateSdk:2.13.9'\\n}\\n\",\n      \"language\": \"text\",\n      \"name\": \"build.gradle\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Updating the SDK\",\n  \"body\": \"The newest version of the SDK can be found here - https://pulsate.readme.io/docs/android-release-notes\\n\\nTo update to the newest version of the SDK all you need to do is update the version tag in \\\"*compile 'com.pulsatehq.sdk:PulsateSdk:version'*\\\" to the newest version found in the link above. Example -  \\\"*compile 'com.pulsatehq.sdk:PulsateSdk:2.13.9'*\\\"\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 2: Configure Gradle\"\n}\n[/block]\nSet *compileSdkVersion* to *27*, *buildToolsVersion* to *“27.0.3”*, *minSdkVersion* to *14* and *targetSdkVersion* to *27*. The SDK also uses Java 8 and Data Binding in it's layouts so Data Binding must be enabled.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"android {\\n\\t\\t\\t\\tcompileSdkVersion 27\\n    \\t\\tbuildToolsVersion '27.0.3'\\n\\n        defaultConfig {\\n                minSdkVersion 14\\n                targetSdkVersion 27\\n        }\\n        dataBinding {\\n        \\t\\t\\t\\tenabled true\\n    \\t\\t}\\n        compileOptions {\\n        \\t\\t\\t\\tsourceCompatibility JavaVersion.VERSION_1_8\\n        \\t\\t\\t\\ttargetCompatibility JavaVersion.VERSION_1_8\\n    \\t\\t}\\n        ...\\n}\",\n      \"language\": \"text\",\n      \"name\": \"build.gradle\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"body\": \"If you use *play-services* you must use the *10.2.1* version of the library.\\nPlease note that end users must have version 10.2.1 of Google Play Services or above on their Android Device for Pulsate to operate.\",\n  \"title\": \"Google Play Services\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Android Support Libraries\",\n  \"body\": \"If you use *com.android.support* libraries (for example \\\"*com.android.support:appcompat-v7*\\\" or \\\"*com.android.support:recyclerview-v7*\\\") you must use the *27.1.1* version of the library.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 3: Configure AndroidManifest.xml\"\n}\n[/block]\nWith the 2.12.0 release you no longer need to configure the AndroidManifest.xml file if you do not change the Android Manifest Merger. If you do change the Android Manifest Merger, you must then follow this step.\n\nThe Pulsate SDK requires that you add these permissions to your application manifest:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<uses-permission android:name=\\\"android.permission.INTERNET\\\" />\\n<uses-permission android:name=\\\"android.permission.ACCESS_NETWORK_STATE\\\" />\\n<uses-permission android:name=\\\"android.permission.ACCESS_FINE_LOCATION\\\" />\\n<uses-permission android:name=\\\"android.permission.ACCESS_COARSE_LOCATION\\\" />\\n<uses-permission android:name=\\\"android.permission.WAKE_LOCK\\\" />\\n<uses-permission android:name=\\\"com.google.android.c2dm.permission.RECEIVE\\\" />\\n<uses-permission android:name=\\\"android.permission.VIBRATE\\\" />\\n<uses-permission android:name=\\\"android.permission.BLUETOOTH\\\" />\\n<uses-permission android:name=\\\"android.permission.BLUETOOTH_ADMIN\\\" />\\n\\n<!-- change com.example.demo to your app package name -->\\n<uses-permission android:name=\\\"com.example.demo.permission.C2D_MESSAGE\\\" />\\n\\n<!-- change com.example.demo to your app package name -->\\n<permission android:name=\\\"com.example.demo.permission.C2D_MESSAGE\\\"\\n                android:protectionLevel=\\\"signature\\\" />\",\n      \"language\": \"xml\",\n      \"name\": \"AndroidManifest.xml\"\n    }\n  ]\n}\n[/block]\n**All of these permissions are required by the Pulsate SDK.**\n\n**android.permission.INTERNET and android.permission.ACCESS_NETWORK_STATE** - are used to communicate with our server and show in app messages when there is no internet conenction.\n\n**android.permission.ACCESS_FINE_LOCATION and android.permission.ACCESS_COARSE_LOCATION** - are used for geofencing and geolocation.\n\n**android.permission.WAKE_LOCK** - is used to partially wake up the device when push notifications are received.\n\n**com.google.android.c2dm.permission.RECEIVE, com.example.demo.permission.C2D_MESSAGE**  - is used to receive Push Notifications\n\n**android.permission.VIBRATE** - is used to allow access to the phone vibration pattern.\n\n**android.permission.BLUETOOTH and\nandroid.permission.BLUETOOTH_ADMIN** - is used to scan for iBeacons\n\nTo replace the default icon and name you need to add to your application manifest header *\"xmlns:tools=\"http://schemas.android.com/tools\"*:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<manifest xmlns:android=\\\"http://schemas.android.com/apk/res/android\\\"\\n    xmlns:tools=\\\"http://schemas.android.com/tools\\\"\\n    package=\\\"com.my.package\\\">\",\n      \"language\": \"xml\",\n      \"name\": \"AndroidManifest.xml\"\n    }\n  ]\n}\n[/block]\nYou also need to add *\"tools:replace=\"android:name, icon\"* to your application:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<application\\n        ...\\n        tools:replace=\\\"android:name, icon\\\">\",\n      \"language\": \"xml\",\n      \"name\": \"AndroidManifest.xml\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Android Manifest Merger\",\n  \"body\": \"If for any reason you need to use *tools:node=\\\"replace\\\"* please read the section below.\"\n}\n[/block]\nIf you use *tools:node=\"replace\"* or any other mode that might cause the manifests to not merge, you must add the code below to your AndroidManifest.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \" <activity\\n     android:name=\\\"com.pulsatehq.internal.inbox.InboxActivity\\\"\\n     android:exported=\\\"true\\\"\\n     android:label=\\\"Feed\\\"\\n     android:screenOrientation=\\\"portrait\\\"\\n     android:theme=\\\":::at:::style/PulsateInboxTheme\\\" />\\n\\n<activity\\n     android:name=\\\"com.pulsatehq.internal.gps.geofence.PulsateMapActivity\\\"\\n     android:exported=\\\"true\\\"\\n     android:label=\\\"Map\\\"\\n     android:screenOrientation=\\\"portrait\\\"\\n     android:theme=\\\"@style/PulsateInboxTheme\\\" />\\n\\n<activity\\n     android:name=\\\"com.pulsatehq.internal.util.PulsateHelperActivity\\\"\\n     android:exported=\\\"true\\\"\\n     android:launchMode=\\\"singleTop\\\"\\n     android:screenOrientation=\\\"portrait\\\"\\n     android:theme=\\\"@style/PulsateInboxTheme\\\" />\\n\\n<service\\n     android:name=\\\".internal.util.PulsateHelperService\\\"\\n     android:enabled=\\\"true\\\"\\n     android:exported=\\\"false\\\" />\\n\\n<receiver \\n    android:name=\\\"com.pulsatehq.internal.gps.geofence.GeofenceTransitionsReceiver\\\"\\n    android:permission=\\\"pulsate.permission.GEOFENCE_TRANSITION\\\"\\n    android:enabled=\\\"true\\\"\\n    android:exported=\\\"false\\\">\\n</receiver>\\n\\n<receiver\\n    android:name=\\\"com.google.android.gms.gcm.GcmReceiver\\\"\\n    android:exported=\\\"true\\\"\\n    android:permission=\\\"com.google.android.c2dm.permission.SEND\\\">\\n    <intent-filter>\\n        <action android:name=\\\"com.google.android.c2dm.intent.REGISTRATION\\\" />\\n        <action android:name=\\\"com.google.android.c2dm.intent.RECEIVE\\\" />\\n    </intent-filter>\\n</receiver>\\n\\n<service\\n    android:name=\\\"com.pulsatehq.internal.gcm.PulsateGcmListenerService\\\"\\n    android:enabled=\\\"true\\\"\\n    android:exported=\\\"false\\\">\\n    <intent-filter>\\n                <action android:name=\\\"com.google.android.c2dm.intent.RECEIVE\\\" />\\n    </intent-filter>\\n</service>\\n\\n<service\\n    android:name=\\\"com.pulsatehq.internal.gcm.PulsateInstanceIDListenerService\\\"\\n    android:enabled=\\\"true\\\"\\n    android:exported=\\\"false\\\">\\n    <intent-filter>\\n        <action android:name=\\\"com.google.android.gms.iid.InstanceID\\\" />\\n    </intent-filter>\\n</service>\\n\\n<service\\n    android:name=\\\"com.pulsatehq.internal.gcm.PulsateGcmRegistrationService\\\"\\n    android:enabled=\\\"true\\\"\\n    android:exported=\\\"false\\\"/>\\n\\n<receiver\\n    android:name=\\\"com.pulsatehq.internal.gcm.NotificationDismissedBroadcastReceiver\\\"\\n    android:enabled=\\\"true\\\"\\n    android:exported=\\\"false\\\"/>\",\n      \"language\": \"xml\",\n      \"name\": \"AndroidManifest.xml\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"4. Set Authorization Data - App ID, App Key, GCM ID\"\n}\n[/block]\nThere are two ways to setup Authorization Data - App ID, App Key, GCM ID.\nThe first way is to set them up in your Android Manifest as meta-data. The second way is by calling the \"*setAuthorizationData*\" method directly from the Pulsate Manager class in Java. \n\nTo setup the Authorization Data in your Android Manifest as meta-data you need to add the following code:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<application>\\n...\\n<!-- You can either set the needed data here or you can use pulsateManager.setAuthorizationData to set it later-->\\n<meta-data \\n    android:name=\\\"PulsateAppId\\\"\\n    android:value=\\\"xxxxxxxxxxxxxxxxxxxxxxxx\\\"/>\\n<meta-data \\n    android:name=\\\"PulsateAppKey\\\"\\n    android:value=\\\"xxxxxxxxxxxxxxxxxxxxxxxx\\\"/>\\n<!-- This is optional - end -->\\n<meta-data \\n    android:name=\\\"GCMApplicationId\\\"\\n    android:value=\\\"\\\\ xxxxxxxxxxxxxxxxxxxxxxxx\\\"/>\\n<meta-data \\n    android:name=\\\"com.google.android.gms.version\\\"\\n    android:value=\\\"@integer/google_play_services_version\\\" />\\n\\n</application>\",\n      \"language\": \"xml\",\n      \"name\": \"AndroidManifest.xml\"\n    }\n  ]\n}\n[/block]\n*PulsateAppId* and *PulsateAppKey* are used to associate the Pulsate SDK with your Pulsate Web Application which you have created using our Pulsate Web Console. *PulsateAppId* and *PulsateAppKey* can be found in your application configuration panel.\n \nTo find them open admin panel, and then go to *Settings -> App Settings* screen in the Pulsate web console. *GCMApplicationId* is used to send push notifications, later in this tutorial you will find out how to create your Google Cloud Messaging account.\n\n**Make sure ‘\\ ‘ (backslash and space) is followed by your GCMApplicationId, i.e.:** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<meta-data android:name=\\\"GCMApplicationId\\\" android:value=\\\"\\\\ 123456789000\\\"/>\",\n      \"language\": \"xml\",\n      \"name\": \"AndroidManifest.xml\"\n    }\n  ]\n}\n[/block]\nIf you do not want to set these keys in your Android Manifest, you can pass these keys using the Pulsate Manager in Java code instead.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"5. MultiDex\"\n}\n[/block]\nAs the Android platform has continued to grow, so has the size of Android apps. When your application and the libraries it references reach a certain size, you encounter build errors that indicate your app has reached a limit of the Android app build architecture.\n\nWe recommend all our users to add the following code in their projects to fix this problem.\nIn your gradle file under \"*defaultConfig*\" add the following line:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"defaultConfig {\\n    multiDexEnabled = true\\n    //Your defaultConfig code\\n}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nAlso in your gradle file under \"*dependencies*\" add:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"dependencies {\\n    //Your dependencies\\n    compile 'com.android.support:multidex:1.0.2'\\n}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nThe last thing to do is open your App class and add the following method:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \" @Override\\nprotected void attachBaseContext(Context base) {\\n    super.attachBaseContext(base);\\n    MultiDex.install(base);\\n}\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nYour app will now support MultiDexing.","excerpt":"","slug":"installing-sdk-android-studio","type":"basic","title":"Installing SDK - Android Studio"}

Installing SDK - Android Studio


Pulsate Android SDK is a static library. It's a bridge between your customers' mobile devices and the Pulsate server. **The SDK Supports Android API 14 - 27**. It's very easy to use, and takes about 5 minutes to install. [block:api-header] { "type": "basic", "title": "Step 1: Setup Android Studio" } [/block] **Make sure you are using latest version of Android Studio.** 1. Make sure your project uses jcenter as a dependency repository (default on latest version of the Android Gradle plugin). [block:code] { "codes": [ { "code": "buildscript {\n repositories {\n jcenter()\n }\n}\n\nallprojects {\n repositories {\n jcenter()\n }\n}", "language": "text", "name": "build.gradle" } ] } [/block] 2. Add *compile 'com.pulsatehq.sdk:PulsateSdk:version'* to the dependencies of your project. Change version to the actual version of the SDK that you want to use. All versions can be found here - https://pulsate.readme.io/docs/android-release-notes [block:code] { "codes": [ { "code": "dependencies {\n\tcompile 'com.pulsatehq.sdk:PulsateSdk:2.13.9'\n}\n", "language": "text", "name": "build.gradle" } ] } [/block] [block:callout] { "type": "info", "title": "Updating the SDK", "body": "The newest version of the SDK can be found here - https://pulsate.readme.io/docs/android-release-notes\n\nTo update to the newest version of the SDK all you need to do is update the version tag in \"*compile 'com.pulsatehq.sdk:PulsateSdk:version'*\" to the newest version found in the link above. Example - \"*compile 'com.pulsatehq.sdk:PulsateSdk:2.13.9'*\"" } [/block] [block:api-header] { "type": "basic", "title": "Step 2: Configure Gradle" } [/block] Set *compileSdkVersion* to *27*, *buildToolsVersion* to *“27.0.3”*, *minSdkVersion* to *14* and *targetSdkVersion* to *27*. The SDK also uses Java 8 and Data Binding in it's layouts so Data Binding must be enabled. [block:code] { "codes": [ { "code": "android {\n\t\t\t\tcompileSdkVersion 27\n \t\tbuildToolsVersion '27.0.3'\n\n defaultConfig {\n minSdkVersion 14\n targetSdkVersion 27\n }\n dataBinding {\n \t\t\t\tenabled true\n \t\t}\n compileOptions {\n \t\t\t\tsourceCompatibility JavaVersion.VERSION_1_8\n \t\t\t\ttargetCompatibility JavaVersion.VERSION_1_8\n \t\t}\n ...\n}", "language": "text", "name": "build.gradle" } ] } [/block] [block:callout] { "type": "danger", "body": "If you use *play-services* you must use the *10.2.1* version of the library.\nPlease note that end users must have version 10.2.1 of Google Play Services or above on their Android Device for Pulsate to operate.", "title": "Google Play Services" } [/block] [block:callout] { "type": "danger", "title": "Android Support Libraries", "body": "If you use *com.android.support* libraries (for example \"*com.android.support:appcompat-v7*\" or \"*com.android.support:recyclerview-v7*\") you must use the *27.1.1* version of the library." } [/block] [block:api-header] { "type": "basic", "title": "Step 3: Configure AndroidManifest.xml" } [/block] With the 2.12.0 release you no longer need to configure the AndroidManifest.xml file if you do not change the Android Manifest Merger. If you do change the Android Manifest Merger, you must then follow this step. The Pulsate SDK requires that you add these permissions to your application manifest: [block:code] { "codes": [ { "code": "<uses-permission android:name=\"android.permission.INTERNET\" />\n<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />\n<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />\n<uses-permission android:name=\"android.permission.WAKE_LOCK\" />\n<uses-permission android:name=\"com.google.android.c2dm.permission.RECEIVE\" />\n<uses-permission android:name=\"android.permission.VIBRATE\" />\n<uses-permission android:name=\"android.permission.BLUETOOTH\" />\n<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" />\n\n<!-- change com.example.demo to your app package name -->\n<uses-permission android:name=\"com.example.demo.permission.C2D_MESSAGE\" />\n\n<!-- change com.example.demo to your app package name -->\n<permission android:name=\"com.example.demo.permission.C2D_MESSAGE\"\n android:protectionLevel=\"signature\" />", "language": "xml", "name": "AndroidManifest.xml" } ] } [/block] **All of these permissions are required by the Pulsate SDK.** **android.permission.INTERNET and android.permission.ACCESS_NETWORK_STATE** - are used to communicate with our server and show in app messages when there is no internet conenction. **android.permission.ACCESS_FINE_LOCATION and android.permission.ACCESS_COARSE_LOCATION** - are used for geofencing and geolocation. **android.permission.WAKE_LOCK** - is used to partially wake up the device when push notifications are received. **com.google.android.c2dm.permission.RECEIVE, com.example.demo.permission.C2D_MESSAGE** - is used to receive Push Notifications **android.permission.VIBRATE** - is used to allow access to the phone vibration pattern. **android.permission.BLUETOOTH and android.permission.BLUETOOTH_ADMIN** - is used to scan for iBeacons To replace the default icon and name you need to add to your application manifest header *"xmlns:tools="http://schemas.android.com/tools"*: [block:code] { "codes": [ { "code": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n package=\"com.my.package\">", "language": "xml", "name": "AndroidManifest.xml" } ] } [/block] You also need to add *"tools:replace="android:name, icon"* to your application: [block:code] { "codes": [ { "code": "<application\n ...\n tools:replace=\"android:name, icon\">", "language": "xml", "name": "AndroidManifest.xml" } ] } [/block] [block:callout] { "type": "danger", "title": "Android Manifest Merger", "body": "If for any reason you need to use *tools:node=\"replace\"* please read the section below." } [/block] If you use *tools:node="replace"* or any other mode that might cause the manifests to not merge, you must add the code below to your AndroidManifest. [block:code] { "codes": [ { "code": " <activity\n android:name=\"com.pulsatehq.internal.inbox.InboxActivity\"\n android:exported=\"true\"\n android:label=\"Feed\"\n android:screenOrientation=\"portrait\"\n android:theme=\"@style/PulsateInboxTheme\" />\n\n<activity\n android:name=\"com.pulsatehq.internal.gps.geofence.PulsateMapActivity\"\n android:exported=\"true\"\n android:label=\"Map\"\n android:screenOrientation=\"portrait\"\n android:theme=\"@style/PulsateInboxTheme\" />\n\n<activity\n android:name=\"com.pulsatehq.internal.util.PulsateHelperActivity\"\n android:exported=\"true\"\n android:launchMode=\"singleTop\"\n android:screenOrientation=\"portrait\"\n android:theme=\"@style/PulsateInboxTheme\" />\n\n<service\n android:name=\".internal.util.PulsateHelperService\"\n android:enabled=\"true\"\n android:exported=\"false\" />\n\n<receiver \n android:name=\"com.pulsatehq.internal.gps.geofence.GeofenceTransitionsReceiver\"\n android:permission=\"pulsate.permission.GEOFENCE_TRANSITION\"\n android:enabled=\"true\"\n android:exported=\"false\">\n</receiver>\n\n<receiver\n android:name=\"com.google.android.gms.gcm.GcmReceiver\"\n android:exported=\"true\"\n android:permission=\"com.google.android.c2dm.permission.SEND\">\n <intent-filter>\n <action android:name=\"com.google.android.c2dm.intent.REGISTRATION\" />\n <action android:name=\"com.google.android.c2dm.intent.RECEIVE\" />\n </intent-filter>\n</receiver>\n\n<service\n android:name=\"com.pulsatehq.internal.gcm.PulsateGcmListenerService\"\n android:enabled=\"true\"\n android:exported=\"false\">\n <intent-filter>\n <action android:name=\"com.google.android.c2dm.intent.RECEIVE\" />\n </intent-filter>\n</service>\n\n<service\n android:name=\"com.pulsatehq.internal.gcm.PulsateInstanceIDListenerService\"\n android:enabled=\"true\"\n android:exported=\"false\">\n <intent-filter>\n <action android:name=\"com.google.android.gms.iid.InstanceID\" />\n </intent-filter>\n</service>\n\n<service\n android:name=\"com.pulsatehq.internal.gcm.PulsateGcmRegistrationService\"\n android:enabled=\"true\"\n android:exported=\"false\"/>\n\n<receiver\n android:name=\"com.pulsatehq.internal.gcm.NotificationDismissedBroadcastReceiver\"\n android:enabled=\"true\"\n android:exported=\"false\"/>", "language": "xml", "name": "AndroidManifest.xml" } ] } [/block] [block:api-header] { "title": "4. Set Authorization Data - App ID, App Key, GCM ID" } [/block] There are two ways to setup Authorization Data - App ID, App Key, GCM ID. The first way is to set them up in your Android Manifest as meta-data. The second way is by calling the "*setAuthorizationData*" method directly from the Pulsate Manager class in Java. To setup the Authorization Data in your Android Manifest as meta-data you need to add the following code: [block:code] { "codes": [ { "code": "<application>\n...\n<!-- You can either set the needed data here or you can use pulsateManager.setAuthorizationData to set it later-->\n<meta-data \n android:name=\"PulsateAppId\"\n android:value=\"xxxxxxxxxxxxxxxxxxxxxxxx\"/>\n<meta-data \n android:name=\"PulsateAppKey\"\n android:value=\"xxxxxxxxxxxxxxxxxxxxxxxx\"/>\n<!-- This is optional - end -->\n<meta-data \n android:name=\"GCMApplicationId\"\n android:value=\"\\ xxxxxxxxxxxxxxxxxxxxxxxx\"/>\n<meta-data \n android:name=\"com.google.android.gms.version\"\n android:value=\"@integer/google_play_services_version\" />\n\n</application>", "language": "xml", "name": "AndroidManifest.xml" } ] } [/block] *PulsateAppId* and *PulsateAppKey* are used to associate the Pulsate SDK with your Pulsate Web Application which you have created using our Pulsate Web Console. *PulsateAppId* and *PulsateAppKey* can be found in your application configuration panel. To find them open admin panel, and then go to *Settings -> App Settings* screen in the Pulsate web console. *GCMApplicationId* is used to send push notifications, later in this tutorial you will find out how to create your Google Cloud Messaging account. **Make sure ‘\ ‘ (backslash and space) is followed by your GCMApplicationId, i.e.:** [block:code] { "codes": [ { "code": "<meta-data android:name=\"GCMApplicationId\" android:value=\"\\ 123456789000\"/>", "language": "xml", "name": "AndroidManifest.xml" } ] } [/block] If you do not want to set these keys in your Android Manifest, you can pass these keys using the Pulsate Manager in Java code instead. [block:api-header] { "type": "basic", "title": "5. MultiDex" } [/block] As the Android platform has continued to grow, so has the size of Android apps. When your application and the libraries it references reach a certain size, you encounter build errors that indicate your app has reached a limit of the Android app build architecture. We recommend all our users to add the following code in their projects to fix this problem. In your gradle file under "*defaultConfig*" add the following line: [block:code] { "codes": [ { "code": "defaultConfig {\n multiDexEnabled = true\n //Your defaultConfig code\n}", "language": "text" } ] } [/block] Also in your gradle file under "*dependencies*" add: [block:code] { "codes": [ { "code": "dependencies {\n //Your dependencies\n compile 'com.android.support:multidex:1.0.2'\n}", "language": "text" } ] } [/block] The last thing to do is open your App class and add the following method: [block:code] { "codes": [ { "code": " @Override\nprotected void attachBaseContext(Context base) {\n super.attachBaseContext(base);\n MultiDex.install(base);\n}", "language": "java" } ] } [/block] Your app will now support MultiDexing.