{"id":19923122,"url":"https://github.com/mapp-digital/mapp-engage-android-sample","last_synced_at":"2026-06-14T07:33:07.237Z","repository":{"id":239968859,"uuid":"800542295","full_name":"mapp-digital/mapp-engage-android-sample","owner":"mapp-digital","description":"Sample application to demonstrate how to integrate Mapp Engage SDK into the native Android application.","archived":false,"fork":false,"pushed_at":"2025-10-09T13:23:18.000Z","size":17712,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-29T06:37:01.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mapp-digital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-14T14:31:30.000Z","updated_at":"2025-10-09T13:23:21.000Z","dependencies_parsed_at":"2024-05-16T05:30:19.997Z","dependency_job_id":"f70d55c8-f96d-4e25-986c-173e9f61ce26","html_url":"https://github.com/mapp-digital/mapp-engage-android-sample","commit_stats":null,"previous_names":["mapp-digital/mapp-engage-android-sample"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mapp-digital/mapp-engage-android-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapp-digital%2Fmapp-engage-android-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapp-digital%2Fmapp-engage-android-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapp-digital%2Fmapp-engage-android-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapp-digital%2Fmapp-engage-android-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapp-digital","download_url":"https://codeload.github.com/mapp-digital/mapp-engage-android-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapp-digital%2Fmapp-engage-android-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34313515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T22:13:07.131Z","updated_at":"2026-06-14T07:33:07.218Z","avatar_url":"https://github.com/mapp-digital.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"This document explains how to add the Android Mapp SDK code to your application code.\n\n**The latest Mapp Engage SDK version** ![Maven Central Version](https://img.shields.io/maven-central/v/com.mapp.sdk/mapp-android?label=Mapp%20Engage)\n\n\u003ch2\u003eSource code integration\u003c/h2\u003e\n\nMake sure your `app/build.gradle` file include the `applicationId` attribute in `defaultConfig` block. \nInclude the following dependencies to your app's `gradle.build` dependencies section :\n\n```\napply plugin: 'com.android.application'\napply plugin: 'com.google.gms.google-services'\n\nandroid {\n    compileSdkVersion 34 // or above\n    buildToolsVersion '34.0.0' // or above\n    defaultConfig {\n        applicationId \"com.yourapppackage.app\" //make sure you have this\n        minSdkVersion 19\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'\n        }\n    }\n\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_17\n        targetCompatibility JavaVersion.VERSION_17\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    implementation 'androidx.appcompat:appcompat:1.6.1'\n    .\n    .\n    .\n    implementation platform('com.google.firebase:firebase-bom:32.8.1')\n    implementation('com.google.firebase:firebase-messaging')\n    implementation 'com.google.firebase:firebase-analytics'\n    implementation 'com.google.firebase:firebase-crashlytics'\n\n    implementation('com.mapp.sdk:mapp-android:X.X.X') //the latest Mapp Engage SDK version\n}\n```\n\nCreate class which extends `android.app.Application`. And add the following code snippet:\n\n```\npublic class MappApp extends Application {\n\n    private AppoxeeOptions opt;\n\n    private Appoxee.OnInitCompletedListener initFinishedListener = new Appoxee.OnInitCompletedListener() {\n        @Override\n        public void onInitCompleted(boolean successful, Exception failReason) {\n            Log.i(\"APX\", \"init completed listener - Application class\");\n\t\t\tAppoxee.instance().setPushEnabled(true);\n        }\n    };\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n\n        opt = new AppoxeeOptions();\n        opt.sdkKey = SDK_KEY;\n        opt.appID = APP_ID;\n        opt.tenantID = \"TENANT_ID;\n        opt.notificationMode = NotificationMode.BACKGROUND_AND_FOREGROUND;\n        opt.server = AppoxeeOptions.Server.EMC;\n\n\n\t\tAppoxee.engage(this, opt);\n        Appoxee.instance().setReceiver(MyPushBroadcastReceiver.class);   \n        Appoxee.instance().addInitListener(initFinishedListener);\n        Appoxee.setOrientation(this, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n    }\n}\n```\n\n`SDK_KEY`, `APP_ID` are present in your CEP dashboard. \n\n`NotificationMode` is an enum and you can choose one of three options:\n\n`BACKGROUND_ONLY` - notification will show only when the app is closed or in idle mode.\n\n`BACKGROUND_AND_FOREGROUND` - notification will show every time when a push notification comes.\n\n`SILENT_ONLY` - notification never shows on the device.\n\nIf you don't choose one of these options, by default is `BACKGROUND_ONLY`.  \n\n`AppoxeeOptions.Server` is enum and you can choose one of four options:\n\n```\nL3\n\nL3_US\n\nEMC\n\nEMC_US\n\nCROC\n\nTEST\n```\n\nAccount manager will provide you info which one you should use in your application (L3, EMC or CROC). \n\nIf you don't choose one of these options, by default is a TEST. \nOur developers use TEST for development purpose and you shouldn't use this one.\n\n\nAdd application in `AndroidManifest.xml` file\n\n```\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cmanifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"mapp.android.demo\"\u003e\n\n    \u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n\n    \u003capplication\n        android:name=\".MappApp\"\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:roundIcon=\"@mipmap/ic_launcher_round\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\"\u003e\n        \u003cactivity android:name=\".MainActivity\"\u003e\n            \u003cintent-filter\u003e\n                \u003caction android:name=\"android.intent.action.MAIN\" /\u003e\n\n                \u003ccategory android:name=\"android.intent.category.LAUNCHER\" /\u003e\n            \u003c/intent-filter\u003e\n        \u003c/activity\u003e\n    \u003c/application\u003e\n\u003c/manifest\u003e\n```\n\nFor receiving push events like push received, push opened, push dismissed you need to create on the receiver, which extends `PushDataReceiver`.\n\n```\npublic class MyPushBroadcastReceiver extends PushDataReceiver {\n    @Override\n    public void onPushReceived(PushData pushData) {\n        Log.d(\"APX\", \"Push received \" + pushData);\n    }\n\n    @Override\n    public void onPushOpened(PushData pushData) {\n        Log.d(\"APX\", \"Push opened \" + pushData);\n    }\n\n    @Override\n    public void onPushDismissed(PushData pushData) {\n        Log.d(\"APX\", \"Push dismissed \" + pushData);\n    }\n\n    @Override\n    public void onSilentPush(PushData pushData) {\n        Log.d(\"APX\", \"Push Silent \" + pushData);\n    }\n}\n```\n\nIn `AplicationManifest` within application tag you should add:\n\n```\n\u003creceiver\n    android:name=\".MyPushBroadcastReceiver\"\n    android:enabled=\"true\"\n    android:exported=\"false\"\u003e\n    \u003cintent-filter\u003e\n        \u003caction android:name=\"com.appoxee.PUSH_OPENED\" /\u003e\n        \u003caction android:name=\"com.appoxee.PUSH_RECEIVED\" /\u003e\n        \u003caction android:name=\"com.appoxee.PUSH_DISMISSED\" /\u003e\n\n\t\t\u003ccategory android:name=\"${applicationId}\" /\u003e\n    \u003c/intent-filter\u003e\n\u003c/receiver\u003e\n```\n\nFor custom layout notifications, add this code in Application class, before calling `Appoxee.engage` method\n\n```\nCustomXmlLayoutNotificationCreator.Builder builder = new CustomXmlLayoutNotificationCreator.Builder(this);\n builder.setLayoutResource(R.layout.custom_notification_layout)  //your custom notification layout\n         .setIconResourceId(R.id.appoxee_default_push_icon)\n         .setTextResourceId(R.id.appoxee_default_push_message)\n         .setTitleResourceId(R.id.appoxee_default_push_subject)\n         .setTimeResourceId(R.id.appoxee_default_push_hour);\n opt.customNotificationCreator = new CustomXmlLayoutNotificationCreator(builder);\n\n Appoxee.engage(this, opt);\n```\n\n\u003ch2\u003ePOST NOTIFICATIONS Runtime permission (Android 13+)\u003c/h2\u003e\n\n\u003eFrom Android 13 (Tiramisu, SDK 33), for displaying notifications, application should request  POST_NOTIFICATIONS permission. More on this can be found on the official Google's documentation.\n\nFirst, add in `ApplicationManifest.xml` required permission:\n\n```\n\u003cmanifest ...\u003e\n    \u003cuses-permission android:name=\"android.permission.POST_NOTIFICATIONS\"/\u003e\n    \u003capplication ...\u003e\n        ...\n    \u003c/application\u003e\n\u003c/manifest\u003e\n```\n\nMapp Engage SDK provides proper method for requesting permission in runtime. \n\nExplain to a user why permission is needed and request permission during some logical use case. \n\nPermission can be requested from Activity or Fragment with the following method:\n\n```\nAppoxee.instance().requestNotificationsPermission(this, results -\u003e {\n    if (results.containsKey(Manifest.permission.POST_NOTIFICATIONS) \u0026\u0026 \n\t\t\tresults.get(Manifest.permission.POST_NOTIFICATIONS) == PermissionsManager.PERMISSION_GRANTED) {\n        \tToast.makeText(MainActivity.this,\"POST NOTIFICATIONS GRANTED!\", Toast.LENGTH_SHORT).show();\n       \t}\n    }\n);\n```\n\nAdd a callback when appoxee finished all initialization, the callback will be called when Appoxee is up and ready, or if server hand-shaking is failed.\n\n```\nAppoxee.instance().addInitListener(new Appoxee.OnInitCompletedListener() {\n    @Override\n    public void onInitCompleted(boolean successful, Exception failReason) {\n        \n    }\n});\n```\n\nAnother way to check the initialization finish or not is to use the following method:\n\n```\nAppoxee.instance().isReady();\n```\n\n\u003ch3\u003eNotification icon\u003c/h3\u003e\n\nDefault Notification icon and color (optional). You can specify a custom default icon and a custom default color. You can choose one option of offered: \n\n**First option**\n\nAdd meta-data tags in the `AndroidManifest.xml` file to define attributes:\n`com.mapp.default_notification_icon` and `com.mapp.default_notification_color`.\n\n```\n\u003cmanifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\u003e\n    \u003capplication ...\u003e\n          \u003cactivity...\u003e\n            ...\n          \u003c/activity\u003e\n          ...\n          \n          \u003cmeta-data android:name=\"com.mapp.default_notification_icon\"\n                     android:resource=\"@drawable/notification_icon\" /\u003e\n          \u003cmeta-data android:name=\"com.mapp.default_notification_color\"\n                     android:resource=\"@color/blue\" /\u003e\n    \u003c/application\u003e\n```\n\n**Second option is to add two icons in the drawable folder(s) with the following names:**\n\n```\napx_small_icon\napx_large_icon\n```\n\n\u003ch3\u003eEnable additional Push Messaging service.\u003c/h3\u003e\n\nCreate class e.g. `MyMessagingService` and extend it from `MappMessagingService`, or if you already have created that class, change its parent class from `FirebaseMessagingService → MappMessagingService`.\n\n```\npublic class MyMessageService extends MappMessagingService {\n\n}\n```\n\nAdd following into `AndroidManifest.xml` inside of the `\u003capplication\u003e\u003c/application\u003e` tags.\n\n```\n\u003cservice android:name=\"com.appoxee.push.fcm.MappMessagingService\"\n            android:exported=\"true\"\n            tools:node=\"remove\"\u003e\n            \u003cintent-filter\u003e\n                \u003caction android:name=\"com.google.firebase.MESSAGING_EVENT\" /\u003e\n            \u003c/intent-filter\u003e\n        \u003c/service\u003e\n\n        \u003cservice android:name=\".MyMessageService\"\n            android:exported=\"false\"\u003e\n            \u003cintent-filter\u003e\n                \u003caction android:name=\"com.google.firebase.MESSAGING_EVENT\" /\u003e\n            \u003c/intent-filter\u003e\n        \u003c/service\u003e\n```\n\nThen, in your extended class `MyMessagingService` override methods `onMessageReceived` and `onNewToken`, and add required calls like this:\n\n```\npublic class MyMessageService extends MappMessagingService {\n\n    @Override\n    public void onMessageReceived(RemoteMessage remoteMessage) {\n        if(remoteMessage.getData().containsKey(\"p\")) {\n            // handle Mapp push messages\n            super.onMessageReceived(remoteMessage);\n        }else{\n            // handle your own push messages\n        }\n    }\n\n    @Override\n    public void onNewToken(String s) {\n        super.onNewToken(s);\n\t\t// subscribe on your own service with firebase token\n    }\n}\n```\n\n\u003ch2\u003eProguard rules\u003c/h2\u003e\n\nWhen application applies `minifyEnabled` **true** to a `build.gradle`, then the following `proguard-rules` must be applied so that SDK functions properly.\n\n```\n-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,EnclosingMethod,*Annotation*\n\n-keep public class com.appoxee.** { *; }\n-keep class com.google.gson.reflect.TypeToken\n-keep class * extends com.google.gson.reflect.TypeToken\n-keep public class * implements java.lang.reflect.Type\n-keep class * implements com.appoxee.internal.network.Networkable { *; }\n-keep class * implements com.appoxee.internal.commandstore.Model { *; }\n-keep class * implements com.appoxee.internal.network.request.NetworkRequestFactory { *; }\n-keep class * implements com.appoxee.internal.badge.Badger { *; }\n-keep class com.appoxee.internal.geo.** { *; }\n-keep class * extends com.appoxee.internal.command.Command { *; }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapp-digital%2Fmapp-engage-android-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapp-digital%2Fmapp-engage-android-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapp-digital%2Fmapp-engage-android-sample/lists"}