Creating Notification Messages

You can build a notification message using a template based on the header size. The Samsung Rich Notification SDK supports 5 different template types: Small Header, Medium Header, Large Header, Full Header, and QR. In the following example, the QR template has been divided into Event Example and Image Example.

  • The SrnStandardTemplate (small header size) works best with a lot of text and little to no images.
  • The SrnStandardTemplate (medium header size) works best with both image and text.
  • The SrnStandardTemplate (full header size) works best when the image is a priority and there is no text.
  • The SrnLargeHeaderTemplate (large header size) works best when the image is a priority.
  • The SrnQRTemplateTemplate (QR header size) works best with QR payment notifications.

Figure: Notification templates

Notification templates

Notification templates

The major components of each example covered in these instructions are the primary template (consisting of the title, timestamp, and body), the secondary template (which is the detailed body), the primary action, and more options.

Figure: Major example components

Major example components

To create the example templates:

  1. Create a common interface file called IExample.java for implementing the 6 example templates.
    1. Right-click the app/src/main/java/com.samsung.android.myfirstrichnotification directory, and select New > File.

      myfirstrichnotification

    2. Enter IExample.java as the file name.

      IExample

    3. Click OK.
    4. Implement the IExample.java file content:
      package com.samsung.android.myfirstrichnotification;
      
      import com.samsung.android.sdk.richnotification.SrnRichNotification;
      
      public interface IExample {
          SrnRichNotification createRichNoti();
      }
      
  2. Copy the necessary image files from the Samsung Rich Notification SDK sample:
    1. Go to the Samsung-RichnotiApp_sdk/Samples/RichNotification/res/drawable-nodpi directory.
    2. Copy all image files to the MyFirstRichNotification/app/src/main/res/drawable directory.

    Paste

  3. Create the SmallHeaderExample sample template:
    1. Right-click the app/src/main/java/com.samsung.android.myfirstrichnotification directory, and select New > Java Class.

      SmallHeaderExample

    2. Enter the details.

      SmallHeaderExample

    3. Click OK.
    4. Implement the SmallHeaderExample.java file content.

      As highlighted in the following code example, the SmallHeaderExample.java file has been implemented with 4 major components: small header template, primary template, secondary template, and action. For more information, see the Samsung Rich Notification SDK programming guide.

      • Create a Small Header RichNotification, which contains all of the information that makes up the notification itself (such as template, data to populate the template with, and actions).
      • Specify the primary and secondary templates with proper text formatting and content.
      • Add actions.

        Actions provide a mechanism that allows your Rich Notification to do something on the host or wearable device. You can specify 1 or more actions for your notification. 4 main action types are currently supported:

        • SrnHostAction: The action is handled by an Android application on the host device using Android intents.
        • SrnRemoteLaunchAction: The action is handled by a Tizen application on the wearable device.
        • SrnRemoteBuiltInAction: Special built-in system action that is handled on the wearable device. Currently only “CALL” and “SMS” are supported.
        • SrnRemoteInputAction: The action prompts the user to provide additional input, which is handled by an Android application on the host device using an Android intent. The input result can be retrieved from the Android intent’s extras with the key: “SAMSUNG_REMOTE_INPUT_RESULT”. The following input types are currently supported: “KEYBOARD”, “SINGLE_SELECT”, “MULTI_SELECT”.
      package com.samsung.android.myfirstrichnotification;
      
      import java.util.ArrayList;
      import java.util.List;
      
      import android.content.Context;
      import android.content.Intent;
      import android.graphics.Bitmap;
      import android.graphics.BitmapFactory;
      import android.graphics.Color;
      import android.net.Uri;
      import android.text.format.Time;
      
      import com.samsung.android.sdk.richnotification.SrnAction;
      import com.samsung.android.sdk.richnotification.SrnAction.CallbackIntent;
      import com.samsung.android.sdk.richnotification.SrnImageAsset;
      import com.samsung.android.sdk.richnotification.SrnRichNotification;
      import com.samsung.android.sdk.richnotification.SrnRichNotification.AlertType;
      import com.samsung.android.sdk.richnotification.actions.SrnHostAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.InputModeFactory;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.KeyboardInputMode;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.KeyboardInputMode.KeyboardType;
      import com.samsung.android.sdk.richnotification.templates.SrnPrimaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnSecondaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnStandardSecondaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnStandardTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnStandardTemplate.HeaderSizeType;
      
      public class SmallHeaderExample implements IExample {
      
          private final Context mContext;
      
          public SmallHeaderExample(Context ctx) {
              mContext = ctx;
          }
      
          @Override
          public SrnRichNotification createRichNoti() {
              SrnRichNotification noti = new SrnRichNotification(mContext);
              noti.setReadout("New Album notification from Songify",
                              "Taylor Swift New Album Red is released");
              noti.setPrimaryTemplate(getSmallHeaderTemplate());
      
              noti.setSecondaryTemplate(getSmallSecondaryTemplate());
      
              noti.setTitle("Songify");
              try {
                  noti.addActionsWithPermissionCheck(getActions());
              } catch (Exception e) {
                  e.printStackTrace();
              }
              noti.setAlertType(AlertType.VIBRATION);
      
              // Bitmap appIconBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.uber_icon);
              // SrnImageAsset appIcon = new SrnImageAsset(mContext, "app_icon", appIconBitmap);
              // noti.setIcon(appIcon);
      
              return noti;
          }
      
          public SrnPrimaryTemplate getSmallHeaderTemplate() {
              SrnStandardTemplate smallHeaderTemplate = new SrnStandardTemplate(HeaderSizeType.SMALL);
      
              smallHeaderTemplate.setSubHeader("<b> New Album Release </b>");
              smallHeaderTemplate.setBody("<b>Taylor Swift</b>'s New Album <b>Red</b> released");
              smallHeaderTemplate.setBackgroundColor(Color.rgb(0, 0, 255));
      
              return smallHeaderTemplate;
          }
      
          public SrnSecondaryTemplate getSmallSecondaryTemplate() {
              SrnStandardSecondaryTemplate smallSecTemplate = new SrnStandardSecondaryTemplate();
      
              smallSecTemplate.setTitle("<b>Album Information</b>");
              Time today = new Time(Time.getCurrentTimezone());
              today.setToNow();
      
              smallSecTemplate.setSubHeader("<b>Release Date</b>:" + today.year + "/" + today.month + "/"
                                            + today.monthDay);
      
              smallSecTemplate.setBody("<b>Tracks in Red</b>: State Of Grace, Red, Treacherous, "
                                       + "I Knew You Were Trouble, All Too Well, 22, I Almost Do, "
                                       + "We Are Never Ever Getting Back Together, Stay Stay Stay, "
                                       + "The Last Time, Holy Ground, Sad Beautiful Tragic, The Lucky One, "
                                       + "Everything Has Changed, Starlight, Begin Again, Bonus Tracks, "
                                       + "The Moment I Knew, Come Back... Be Here, Girl At Home");
      
              Bitmap qrCodeBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.red);
              SrnImageAsset qrCodeBig = new SrnImageAsset(mContext, "qr_code_big", qrCodeBitmap);
              smallSecTemplate.setImage(qrCodeBig);
      
              Bitmap commentBM = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.star_subtitle);
              SrnImageAsset commentIcon = new SrnImageAsset(mContext, "comment_icon", commentBM);
              smallSecTemplate.setSmallIcon1(commentIcon, "4/5");
      
              Bitmap likeBM = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.like);
              SrnImageAsset likeIcon = new SrnImageAsset(mContext, "like_icon", likeBM);
              smallSecTemplate.setSmallIcon2(likeIcon, "999+");
      
              return smallSecTemplate;
          }
      
          public List<SrnAction> getActions() {
              ArrayList<SrnAction> myActions = new ArrayList<SrnAction>();
      
              SrnHostAction primaryAction = new SrnHostAction("Listen On Phone");
              Bitmap listenBitmap = BitmapFactory.decodeResource(mContext.getResources(),
                                                                 R.drawable.listen);
              SrnImageAsset listenIcon = new SrnImageAsset(mContext, "web_icon", listenBitmap);
      
              String url = "http://musicmp3.ru/artist_taylor-swift__album_red.html#.U-Cj3WPzkjY";
              Intent resultIntent = new Intent(mContext, MyCallbackActivity.class);
              resultIntent.setData(Uri.parse(url));
      
              primaryAction.setIcon(listenIcon);
              primaryAction.setToast("Music will be played on Phone!");
              primaryAction.setCallbackIntent(CallbackIntent.getActivityCallback(resultIntent));
              myActions.add(primaryAction);
      
              SrnHostAction action2 = new SrnHostAction("Watch On Phone");
              String yturl = "http://www.youtube.com/watch?v=Smu1jse33bQ";
              Intent videoIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(yturl));
              videoIntent.setData(Uri.parse(url));
      
              Bitmap watctBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.watch);
              SrnImageAsset watchIcon = new SrnImageAsset(mContext, "web_icon", watctBitmap);
              action2.setIcon(watchIcon);
              action2.setToast("Youtube App will be launched on Phone!");
              action2.setCallbackIntent(CallbackIntent.getActivityCallback(videoIntent));
              myActions.add(action2);
      
              SrnRemoteInputAction keyboardAction = new SrnRemoteInputAction("Comment");
              KeyboardInputMode kInputMode = InputModeFactory.createKeyboardInputMode()
                                                             .setPrefillString("@name")
                                                             .setCharacterLimit(140)
                                                             .setKeyboardType(KeyboardType.NORMAL);
      
              keyboardAction.setRequestedInputMode(kInputMode);
      
              Intent keyboardIntent = new Intent("com.samsung.android.richnotification.sample.callback_broadcast");
              keyboardAction.setCallbackIntent(CallbackIntent.getBroadcastCallback(keyboardIntent));
      
              myActions.add(keyboardAction);
      
              return myActions;
          }
      }
      
  4. Create the MediumHeaderExample sample template:
    1. Right-click the app/src/main/java/com.samsung.adnroid.myfirstrichnotification directory, and select New > Java Class.
    2. Enter the details.

      MediumHeaderExample

    3. Click OK.
    4. Implement the MediumHeaderExample.java file content.

      As the SmallHeaderExample.java file, the MediumHeaderExample.java file has also been implemented with 4 major components: small header template, primary template, secondary template, and action.

      • Create a Medium Header RichNotification, which contains all of the information that makes up the notification itself (such as the template, data to populate the template with, and actions).
      • Specify the primary and secondary templates with proper text formatting and content.
      • Add actions.

        Actions provide a mechanism that allows your Rich Notification to do something on the host or wearable device. You can specify 1 or more actions for your notification.

      package com.samsung.android.myfirstrichnotification;
      
      import java.util.ArrayList;
      import java.util.List;
      
      import android.content.Context;
      import android.content.Intent;
      import android.graphics.Bitmap;
      import android.graphics.BitmapFactory;
      import android.graphics.Color;
      import android.net.Uri;
      import android.text.format.Time;
      
      import com.samsung.android.sdk.richnotification.SrnAction;
      import com.samsung.android.sdk.richnotification.SrnAction.CallbackIntent;
      import com.samsung.android.sdk.richnotification.SrnImageAsset;
      import com.samsung.android.sdk.richnotification.SrnRichNotification;
      import com.samsung.android.sdk.richnotification.SrnRichNotification.AlertType;
      import com.samsung.android.sdk.richnotification.actions.SrnHostAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.InputModeFactory;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.KeyboardInputMode;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.KeyboardInputMode.KeyboardType;
      import com.samsung.android.sdk.richnotification.templates.SrnPrimaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnSecondaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnStandardSecondaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnStandardTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnStandardTemplate.HeaderSizeType;
      
      public class MediumHeaderExample implements IExample {
      
          private final Context mContext;
      
          public MediumHeaderExample(Context ctx) {
              mContext = ctx;
          }
      
          @Override
          public SrnRichNotification createRichNoti() {
              SrnRichNotification noti = new SrnRichNotification(mContext);
              noti.setReadout("New Book notification from Bookify",
                              "Kate Daniels New Album Magic Breaks is released");
      
              noti.setPrimaryTemplate(getSrnMediumHeaderTemplate());
      
              noti.setSecondaryTemplate(getMediumSecondaryTemplate());
              try {
                  noti.addActionsWithPermissionCheck(getActions());
              } catch (Exception e) {
                  e.printStackTrace();
              }
              noti.setAlertType(AlertType.SOUND_AND_VIBRATION);
      
              Bitmap appIconBitmap = BitmapFactory.decodeResource(mContext.getResources(),
                                                                  R.drawable.uber_icon);
              SrnImageAsset appIcon = new SrnImageAsset(mContext, "app_icon", appIconBitmap);
              noti.setIcon(appIcon);
      
              noti.setTitle("Bookify");
      
              return noti;
          }
      
          public SrnPrimaryTemplate getSrnMediumHeaderTemplate() {
              SrnStandardTemplate mMediumHeaderTemplate = new SrnStandardTemplate(HeaderSizeType.MEDIUM);
              mMediumHeaderTemplate.setBackgroundColor(Color.rgb(0, 255, 0));
      
              mMediumHeaderTemplate.setSubHeader("<b> New Book Release </b>");
              mMediumHeaderTemplate.setBody("<b>Kate Daniel</b>'s New Book <b>Magic Breaks</b> released");
      
              return mMediumHeaderTemplate;
          }
      
          public SrnSecondaryTemplate getMediumSecondaryTemplate() {
              SrnStandardSecondaryTemplate mediumSecondaryTemplate = new SrnStandardSecondaryTemplate();
      
              mediumSecondaryTemplate.setTitle("<b>Book Information</b>");
              Time today = new Time(Time.getCurrentTimezone());
              today.setToNow();
      
              mediumSecondaryTemplate.setSubHeader("<b>Release Date</b>:" + today.year + "/"
                                                   + today.month + "/" + today.monthDay);
      
              mediumSecondaryTemplate.setBody("<b>Overview</b>: As the mate of the Beast Lord, Curran, "
                                              + "former mercenary Kate Daniels has more responsibilities than "
                                              + "it seems possible to juggle. Not only is she still struggling "
                                              + "to keep her investigative business afloat, she must now deal with "
                                              + "the affairs of the pack, including preparing her people for attack "
                                              + "from Roland, a cruel ancient being with god-like powers. "
                                              + "Since Kates connection to Roland has come out into the open, no one is safe");
      
              Bitmap qrCodeBitmap = BitmapFactory.decodeResource(mContext.getResources(),
                                                                 R.drawable.magic);
              SrnImageAsset qrCodeBig = new SrnImageAsset(mContext, "qr_code_big", qrCodeBitmap);
              mediumSecondaryTemplate.setImage(qrCodeBig);
      
              Bitmap commentBM = BitmapFactory.decodeResource(mContext.getResources(),
                                                              R.drawable.star_subtitle);
              SrnImageAsset commentIcon = new SrnImageAsset(mContext, "comment_icon", commentBM);
              mediumSecondaryTemplate.setSmallIcon1(commentIcon, "34/5");
      
              Bitmap likeBM = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.like);
              SrnImageAsset likeIcon = new SrnImageAsset(mContext, "like_icon", likeBM);
              mediumSecondaryTemplate.setSmallIcon2(likeIcon, "425");
      
              return mediumSecondaryTemplate;
          }
      
          public List<SrnAction> getActions() {
              ArrayList<SrnAction> myActions = new ArrayList<SrnAction>();
      
              SrnHostAction primaryAction = new SrnHostAction("Read On Phone");
              Bitmap webActionBM = BitmapFactory.decodeResource(mContext.getResources(),
                                                                R.drawable.voice_action);
              SrnImageAsset webActionIcon = new SrnImageAsset(mContext, "web_icon", webActionBM);
      
              Intent resultIntent = new Intent(mContext, MyCallbackActivity.class);
              resultIntent.setData(Uri.parse("http://musicmp3.ru/artist_taylor-swift__album_red.html#.U-Cj3WPzkjY"));
      
              primaryAction.setIcon(webActionIcon);
              primaryAction.setToast("Music will be played on Phone!");
              primaryAction.setCallbackIntent(CallbackIntent.getActivityCallback(resultIntent));
              myActions.add(primaryAction);
      
              SrnRemoteInputAction keyboardAction = new SrnRemoteInputAction("Comment");
      
              KeyboardInputMode kInputMode = InputModeFactory.createKeyboardInputMode().setPrefillString("@name")
                                                                                       .setCharacterLimit(140)
                                                                                       .setKeyboardType(KeyboardType.NORMAL);
      
              keyboardAction.setRequestedInputMode(kInputMode);
      
              Intent keyboardIntent = new Intent(mContext, RichNotificationActivity.class);
              keyboardAction.setCallbackIntent(CallbackIntent.getActivityCallback(keyboardIntent));
      
              myActions.add(keyboardAction);
      
              return myActions;
          }
      }
      
  5. Create the LargeHeaderExample sample template:
    1. Right-click the app/src/main/java/com.samsung.android.myfirstrichnotification directory, and select New > Java Class.
    2. Enter the details.

      LargeHeaderExample

    3. Click OK.
    4. Implement the LargeHeaderExample.java file content.

      As the SmallHeaderExample.java file, the LargeHeaderExample.java file has also been implemented with 4 major components: small header template, primary template, secondary template, and action.

      • Create a Large Header RichNotification, which contains all of the information that makes up the notification itself (such as template, data to populate the template with, and actions).
      • Specify the primary and secondary templates with proper text formatting and content.
      • Add actions.

        Actions provide a mechanism that allows your Rich Notification to do something on the host or wearable device. You can specify one or more actions for your notification.

      package com.samsung.android.myfirstrichnotification;
      
      import java.util.ArrayList;
      import java.util.List;
      
      import android.content.Context;
      import android.content.Intent;
      import android.graphics.Bitmap;
      import android.graphics.BitmapFactory;
      import android.net.Uri;
      import android.text.format.Time;
      
      import com.samsung.android.sdk.richnotification.SrnAction;
      import com.samsung.android.sdk.richnotification.SrnAction.CallbackIntent;
      import com.samsung.android.sdk.richnotification.SrnImageAsset;
      import com.samsung.android.sdk.richnotification.SrnRichNotification;
      import com.samsung.android.sdk.richnotification.SrnRichNotification.AlertType;
      import com.samsung.android.sdk.richnotification.actions.SrnHostAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteBuiltInAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.InputModeFactory;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.KeyboardInputMode;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.KeyboardInputMode.KeyboardType;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.SingleSelectInputMode;
      import com.samsung.android.sdk.richnotification.templates.SrnLargeHeaderTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnPrimaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnSecondaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnStandardSecondaryTemplate;
      
      public class LargeHeaderExample implements IExample {
          private final Context mContext;
      
          public LargeHeaderExample(Context ctx) {
              mContext = ctx;
          }
      
          @Override
          public SrnRichNotification createRichNoti() {
              SrnRichNotification noti = new SrnRichNotification(mContext);
              noti.setReadout("Facebook post", "Your friend post, nice weather in SFO");
      
              noti.setPrimaryTemplate(getSrnLargeHeaderTemplate());
      
              noti.setSecondaryTemplate(getSmallSecondaryTemplate());
              try {
                  noti.addActionsWithPermissionCheck(getActions());
              } catch (Exception e) {
                  e.printStackTrace();
              }
              noti.setAlertType(AlertType.SILENCE);
      
              Bitmap appIconBitmap = BitmapFactory.decodeResource(mContext.getResources(),
                                                                  R.drawable.uber_icon);
              SrnImageAsset appIcon = new SrnImageAsset(mContext, "app_icon", appIconBitmap);
              noti.setIcon(appIcon);
      
              noti.setTitle("Nice Weather");
      
              return noti;
          }
      
          public SrnPrimaryTemplate getSrnLargeHeaderTemplate() {
              SrnLargeHeaderTemplate mLargeHeaderTemplate = new SrnLargeHeaderTemplate();
      
              Bitmap bg = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.weather);
              SrnImageAsset ibg = new SrnImageAsset(mContext, "l_h", bg);
      
              mLargeHeaderTemplate.setBackgroundImage(ibg);
      
              return mLargeHeaderTemplate;
          }
      
          public SrnSecondaryTemplate getSmallSecondaryTemplate() {
              SrnStandardSecondaryTemplate smallSecTemplate = new SrnStandardSecondaryTemplate();
      
              smallSecTemplate.setTitle("<b>Album Information</b>");
              Time today = new Time(Time.getCurrentTimezone());
              today.setToNow();
      
              smallSecTemplate.setSubHeader("<b>Release Date</b>:" + today.year + "/" + today.month + "/"
                                            + today.monthDay);
      
              smallSecTemplate.setBody("<b>Tracks in Red</b>: State Of Grace, Red, Treacherous, "
                                       + "I Knew You Were Trouble, All Too Well, 22, I Almost Do, "
                                       + "We Are Never Ever Getting Back Together, Stay Stay Stay, "
                                       + "The Last Time, Holy Ground, Sad Beautiful Tragic, "
                                       + "The Lucky One, Everything Has Changed, Starlight, "
                                       + "Begin Again, Bonus Tracks, The Moment I Knew, Come Back... "
                                       + "Be Here, Girl At Home");
      
              Bitmap qrCodeBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.red);
              SrnImageAsset qrCodeBig = new SrnImageAsset(mContext, "qr_code_big", qrCodeBitmap);
              smallSecTemplate.setImage(qrCodeBig);
      
              Bitmap commentBM = BitmapFactory.decodeResource(mContext.getResources(),
                                                              R.drawable.star_subtitle);
              SrnImageAsset commentIcon = new SrnImageAsset(mContext, "comment_icon", commentBM);
              smallSecTemplate.setSmallIcon1(commentIcon, "4/5");
      
              Bitmap likeBM = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.like);
              SrnImageAsset likeIcon = new SrnImageAsset(mContext, "like_icon", likeBM);
              smallSecTemplate.setSmallIcon2(likeIcon, "999+");
      
              return smallSecTemplate;
          }
      
          public List<SrnAction> getActions() {
              ArrayList<SrnAction> myActions = new ArrayList<SrnAction>();
      
              SrnHostAction primaryAction = new SrnHostAction("See Forecast");
              Bitmap webActionBM = BitmapFactory.decodeResource(mContext.getResources(),
                                                                R.drawable.voice_action);
              SrnImageAsset webActionIcon = new SrnImageAsset(mContext, "web_icon", webActionBM);
      
              primaryAction.setIcon(webActionIcon);
              primaryAction.setToast("Check your phone!");
      
              Intent resultIntent = new Intent(Intent.ACTION_VIEW);
              resultIntent.setData(Uri.parse( "http://www.weather.com"));
      
              primaryAction.setCallbackIntent(CallbackIntent.getActivityCallback(resultIntent));
      
              myActions.add(primaryAction);
      
              SrnRemoteBuiltInAction builtInAction = new SrnRemoteBuiltInAction("Call");
      
              builtInAction.setType(SrnRemoteBuiltInAction.OperationType.CALL);
              builtInAction.setData(Uri.fromParts("tel", "+821095307811", null));
      
              myActions.add(builtInAction);
      
              SrnRemoteInputAction keyboardAction = new SrnRemoteInputAction("Comment");
      
              KeyboardInputMode kInputMode = InputModeFactory.createKeyboardInputMode();
              kInputMode.setPrefillString("@name");
              kInputMode.setCharacterLimit(140);
              kInputMode.setKeyboardType(KeyboardType.NORMAL);
      
              keyboardAction.setRequestedInputMode(kInputMode);
      
              Intent keyboardIntent = new Intent(mContext, SrnRichNotification.class);
              keyboardAction.setCallbackIntent(CallbackIntent.getActivityCallback(keyboardIntent));
      
              myActions.add(keyboardAction);
      
              SrnRemoteInputAction singelSelectAction = new SrnRemoteInputAction("Survey");
      
              SingleSelectInputMode sInputMode = InputModeFactory.createSingleSelectInputMode();
              sInputMode.addChoice("Love This", "color_black");
              sInputMode.addChoice("Hate it", "color_white");
              sInputMode.addChoice("Am Cool", "color_red");
      
              singelSelectAction.setRequestedInputMode(sInputMode);
              singelSelectAction.setDescription("Is this weather good?");
      
              Intent singleSelectIntent = new Intent(mContext, SrnRichNotification.class);
              singelSelectAction.setCallbackIntent(CallbackIntent.getActivityCallback(singleSelectIntent));
      
              myActions.add(singelSelectAction);
      
              return myActions;
          }
      }
      
  6. Create the FullScreenExample sample template:
    1. Right-click the app/src/main/java/com.samsung.android.myfirstrichnotification directory, and select New > Java Class.
    2. Enter the details.

      Create New Class

    3. Click OK.
    4. Implement the FullScreenExample.java file content.

      As the SmallHeaderExample.java file, a FullScreenExample.java file has also been implemented with 4 major components: small header template, primary template, secondary template, and action.

      • Create a Full Screen Header RichNotification, which contains all the information that makes up the notification itself (such as the template, data to populate the template with, and actions).
      • Specify the primary and secondary templates with proper text formatting and content.
      • Add actions.

        Actions provide a mechanism that allows your Rich Notification to do something on the host or wearable device. You can specify 1 or more actions for your notification.

      package com.samsung.android.myfirstrichnotification;
      
      import java.util.ArrayList;
      import java.util.List;
      
      import android.content.Context;
      import android.content.Intent;
      import android.graphics.Bitmap;
      import android.graphics.BitmapFactory;
      import android.net.Uri;
      import android.text.format.Time;
      
      import com.samsung.android.sdk.richnotification.SrnAction;
      import com.samsung.android.sdk.richnotification.SrnAction.CallbackIntent;
      import com.samsung.android.sdk.richnotification.SrnImageAsset;
      import com.samsung.android.sdk.richnotification.SrnRichNotification;
      import com.samsung.android.sdk.richnotification.SrnRichNotification.AlertType;
      import com.samsung.android.sdk.richnotification.actions.SrnHostAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteBuiltInAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.InputModeFactory;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.KeyboardInputMode;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.KeyboardInputMode.KeyboardType;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.MultiSelectInputMode;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.SingleSelectInputMode;
      import com.samsung.android.sdk.richnotification.templates.SrnPrimaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnSecondaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnStandardSecondaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnStandardTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnStandardTemplate.HeaderSizeType;
      
      public class FullScreenExample implements IExample {
          private final Context context;
      
          public FullScreenExample(Context ctx) {
              context = ctx;
          }
      
          @Override
          public SrnRichNotification createRichNoti() {
              SrnRichNotification noti = new SrnRichNotification(context);
              noti.setReadout("New Full Header", "FullScreen.");
      
              noti.setPrimaryTemplate(getFullScreenTemplate());
      
              noti.setSecondaryTemplate(getFullSecondaryTemplate());
              try {
                  noti.addActionsWithPermissionCheck(getActions());
              } 
              catch (Exception e) {
                  e.printStackTrace();
              }
              noti.setAlertType(AlertType.SOUND);
      
              Bitmap appIconBitmap = BitmapFactory.decodeResource(context.getResources(),
                                                                  R.drawable.uber_icon);
              SrnImageAsset appIcon = new SrnImageAsset(context, "app_icon", appIconBitmap);
              noti.setIcon(appIcon);
      
              noti.setTitle("Movify");
      
              return noti;
          }
      
          public SrnPrimaryTemplate getFullScreenTemplate() {
              SrnStandardTemplate mFullScreenTemplate = new SrnStandardTemplate(HeaderSizeType.FULL_SCREEN);
              Bitmap bg = BitmapFactory.decodeResource(context.getResources(), R.drawable.hercules);
              SrnImageAsset ibg = new SrnImageAsset(context, "full_h", bg);
      
              mFullScreenTemplate.setBackgroundImage(ibg);
      
              mFullScreenTemplate.setSubHeader("<b> New Movie Release </b>");
              mFullScreenTemplate.setBody("<b>Brett Ratner</b>'s New Movie <b>Hercules</b> released");
      
              return mFullScreenTemplate;
          }
      
          public SrnSecondaryTemplate getFullSecondaryTemplate() {
              SrnStandardSecondaryTemplate fullSecondaryTemplate = new SrnStandardSecondaryTemplate();
      
              fullSecondaryTemplate.setTitle("<b>Movie Information</b>");
              Time today = new Time(Time.getCurrentTimezone());
              today.setToNow();
      
              fullSecondaryTemplate.setSubHeader("<b>Release Date</b>:" + today.year + "/" + today.month
                                                 + "/" + today.monthDay);
      
              fullSecondaryTemplate.setBody("<b>Synopsis</b>: Having endured his legendary twelve labors, "
                                            + "Hercules, the Greek demigod, has his life as a sword-for-hire "
                                            + "tested when the King of Thrace and his daughter seek his aid "
                                            + "in defeating a tyrannical warlord.");
      
              Bitmap commentBM = BitmapFactory.decodeResource(context.getResources(),
                                                              R.drawable.star_subtitle);
              SrnImageAsset commentIcon = new SrnImageAsset(context, "comment_icon", commentBM);
              fullSecondaryTemplate.setSmallIcon1(commentIcon, "5/5");
      
              Bitmap likeBM = BitmapFactory.decodeResource(context.getResources(), R.drawable.like);
              SrnImageAsset likeIcon = new SrnImageAsset(context, "like_icon", likeBM);
              fullSecondaryTemplate.setSmallIcon2(likeIcon, "999+");
      
              return fullSecondaryTemplate;
      
          }
      
          public List<SrnAction> getActions() {
              ArrayList<SrnAction> myActions = new ArrayList<SrnAction>();
      
              SrnHostAction primaryAction = new SrnHostAction("View On IMDB");
              Bitmap webActionBM = BitmapFactory.decodeResource(context.getResources(),
                                                                R.drawable.voice_action);
      
              SrnImageAsset webActionIcon = new SrnImageAsset(context, "web_icon", webActionBM);
      
              primaryAction.setIcon(webActionIcon);
              primaryAction.setToast("Music will be played on Phone!");
      
              String url = "http://www.imdb.com/title/tt1267297/";
              Intent resultIntent = new Intent(context, MyCallbackActivity.class);
              resultIntent.setData(Uri.parse(url));
              primaryAction.setCallbackIntent(CallbackIntent.getActivityCallback(resultIntent));
      
              myActions.add(primaryAction);
      
              SrnHostAction action2 = new SrnHostAction("Watch Trailier On Phone");
              action2.setIcon(webActionIcon);
              action2.setToast("Youtube App will be launched on Phone!");
      
              String yturl = "http://www.youtube.com/watch?v=GFqY089piQ4";
              Intent videoIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(yturl));
              videoIntent.setData(Uri.parse(url));
      
              action2.setCallbackIntent(CallbackIntent.getActivityCallback(videoIntent));
      
              myActions.add(action2);
      
              SrnRemoteBuiltInAction builtInAction = new SrnRemoteBuiltInAction("Call");
      
              builtInAction.setType(SrnRemoteBuiltInAction.OperationType.CALL);
              builtInAction.setData(Uri.fromParts("tel", "+14157364480", null));
      
              myActions.add(builtInAction);
      
              SrnRemoteInputAction keyboardAction = new SrnRemoteInputAction("Comments");
      
              KeyboardInputMode kInputMode = InputModeFactory.createKeyboardInputMode();
              kInputMode.setPrefillString("@name");
              kInputMode.setCharacterLimit(140);
              kInputMode.setKeyboardType(KeyboardType.NORMAL);
              keyboardAction.setRequestedInputMode(kInputMode);
      
              Intent keyboardIntent = new Intent(context, RichNotificationActivity.class);
              keyboardAction.setCallbackIntent(CallbackIntent.getActivityCallback(keyboardIntent));
      
              myActions.add(keyboardAction);
      
              SrnRemoteInputAction singelSelectAction = new SrnRemoteInputAction("Survey");
      
              SingleSelectInputMode sInputMode = InputModeFactory.createSingleSelectInputMode();
              Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher);
      
              sInputMode.addChoice("Yes", "color_black", new SrnImageAsset(context, "black_icon", bitmap));
              sInputMode.addChoice("No", "color_white", new SrnImageAsset(context, "black_icon", bitmap));
              sInputMode.addChoice("I don't remember", "color_red", new SrnImageAsset(context, "black_icon", bitmap));
      
              singelSelectAction.setRequestedInputMode(sInputMode);
              singelSelectAction.setDescription("Did you watch the movie");
      
              Intent singleSelectIntent = new Intent(context, RichNotificationActivity.class);
              singelSelectAction.setCallbackIntent(CallbackIntent.getActivityCallback(singleSelectIntent));
      
              myActions.add(singelSelectAction);
      
              SrnRemoteInputAction multipeSelectAction = new SrnRemoteInputAction("Multi Select");
              MultiSelectInputMode mInputMode = InputModeFactory.createMultiSelectInputMode();
              multipeSelectAction.setDescription("Select your favorite Actors.");
              mInputMode.addChoice("Dwayne Johnson", "color_black");
              mInputMode.addChoice("Ian McShane", "color_white");
              mInputMode.addChoice("John Hurt", "color_red");
              mInputMode.addChoice("Rufus Sewell", "color_blue");
      
              multipeSelectAction.setRequestedInputMode(mInputMode);
      
              Intent multipleSelectIntent = new Intent(context, RichNotificationActivity.class);
              multipeSelectAction.setCallbackIntent(CallbackIntent.getActivityCallback(multipleSelectIntent));
      
              myActions.add(multipeSelectAction);
      
              return myActions;
          }
      }
      
  7. Create the ImageExample sample template:
    1. Right-click the app/src/main/java/com.samsung.adnroid.myfirstrichnotification directory, and select New > Java Class.
    2. Enter the details.

      Create New Class ImageExample

    3. Click OK.
    4. Implement the ImageExample.java file content.

      As the SmallHeaderExample.java file, an ImageExample.java file has also been implemented with 4 major components: a small header template, primary template, secondary template, and action.

      • Create a QR Header RichNotification, which contains all of the information that makes up the notification itself (such as the template, data to populate the template with, and actions).
      • Specify the primary and secondary templates with proper text formatting and content.
      • Add actions.

        Actions provide a mechanism that allows your Rich Notification to do something on the host or wearable device. You can specify one or more actions for your notification.

      package com.samsung.android.myfirstrichnotification;
      
      import java.util.ArrayList;
      import java.util.List;
      
      import android.content.Context;
      import android.content.Intent;
      import android.graphics.Bitmap;
      import android.graphics.BitmapFactory;
      import android.graphics.Color;
      import android.net.Uri;
      
      import com.samsung.android.sdk.richnotification.SrnAction;
      import com.samsung.android.sdk.richnotification.SrnAction.CallbackIntent;
      import com.samsung.android.sdk.richnotification.SrnImageAsset;
      import com.samsung.android.sdk.richnotification.SrnRichNotification;
      import com.samsung.android.sdk.richnotification.SrnRichNotification.AlertType;
      import com.samsung.android.sdk.richnotification.actions.SrnHostAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteBuiltInAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.InputModeFactory;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.KeyboardInputMode;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.KeyboardInputMode.KeyboardType;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.MultiSelectInputMode;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.SingleSelectInputMode;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteLaunchAction;
      import com.samsung.android.sdk.richnotification.templates.SrnPrimaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnQRSecondaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnQRTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnSecondaryTemplate;
      
      public class ImageExample implements IExample {
          private final Context context;
      
          public ImageExample(Context ctx) {
              context = ctx;
          }
      
          @Override
          public SrnRichNotification createRichNoti() {
              SrnRichNotification noti = new SrnRichNotification(context);
              noti.setReadout("New QR Code", "You have a new QR code.");
      
              noti.setPrimaryTemplate(getImageTemplate());
      
              noti.setSecondaryTemplate(getImageSecondaryTemplate());
              try {
                  noti.addActionsWithPermissionCheck(getActions());
              }
              catch (Exception e) {
                  e.printStackTrace();
              }
              noti.setAlertType(AlertType.VIBRATION);
      
              Bitmap appIconBitmap = BitmapFactory.decodeResource(context.getResources(),
                                                                  R.drawable.uber_icon);
              SrnImageAsset appIcon = new SrnImageAsset(context, "app_icon", appIconBitmap);
              noti.setIcon(appIcon);
      
              return noti;
          }
      
          public SrnPrimaryTemplate getImageTemplate() {
              SrnQRTemplate mImageTemplate = new SrnQRTemplate();
              mImageTemplate.setBackgroundColor(Color.rgb(0, 255, 0));
      
              mImageTemplate.setSubHeader("<b> Beautiful </b>");
      
              Bitmap imageBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.ash);
              SrnImageAsset imageAsset = new SrnImageAsset(context, "large_image", imageBitmap);
              mImageTemplate.setImage(imageAsset);
      
              return mImageTemplate;
          }
      
          public SrnSecondaryTemplate getImageSecondaryTemplate() {
              SrnQRSecondaryTemplate qrSecTemplate = new SrnQRSecondaryTemplate();
      
              Bitmap qrCodeBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.ash2);
              SrnImageAsset qrCodeBig = new SrnImageAsset(context, "qr_code_big", qrCodeBitmap);
              qrSecTemplate.setImage(qrCodeBig);
      
              qrSecTemplate.addListItem("Profession", "Actress, Model");
              qrSecTemplate.addListItem("Star", "Scorpio");
              qrSecTemplate.addListItem("Height", "5.7");
              qrSecTemplate.addListItem("Nationality", "Indian");
      
              Bitmap commentBM = BitmapFactory.decodeResource(context.getResources(), R.drawable.star_subtitle);
              SrnImageAsset commentIcon = new SrnImageAsset(context, "comment_icon", commentBM);
              qrSecTemplate.setSmallIcon1(commentIcon, "99999999+");
      
              Bitmap likeBM = BitmapFactory.decodeResource(context.getResources(), R.drawable.like);
              SrnImageAsset likeIcon = new SrnImageAsset(context, "like_icon", likeBM);
              qrSecTemplate.setSmallIcon2(likeIcon, "99999999+");
      
              return qrSecTemplate;
          }
      
          public List<SrnAction> getActions() {
              ArrayList<SrnAction> myActions = new ArrayList<SrnAction>();
      
              SrnHostAction primaryAction = new SrnHostAction("Launch Web");
              Bitmap webActionBM = BitmapFactory.decodeResource(context.getResources(),
                                                                R.drawable.voice_action);
              SrnImageAsset webActionIcon = new SrnImageAsset(context, "web_icon", webActionBM);
      
              String url = "http://www.samsung.com";
              Intent resultIntent = new Intent(Intent.ACTION_VIEW);
              resultIntent.setData(Uri.parse(url));
      
              primaryAction.setIcon(webActionIcon);
              primaryAction.setToast("Check your phone!");
      
              primaryAction.setCallbackIntent(CallbackIntent.getActivityCallback(resultIntent));
              myActions.add(primaryAction);
      
              SrnRemoteBuiltInAction builtInAction = new SrnRemoteBuiltInAction("Call");
      
              builtInAction.setType(SrnRemoteBuiltInAction.OperationType.CALL);
              builtInAction.setData(Uri.fromParts("tel", "+14157364480", null));
              myActions.add(builtInAction);
      
              SrnRemoteLaunchAction remoteLaunchAction = new SrnRemoteLaunchAction("Launch Dialer");
              remoteLaunchAction.setPackage("com.samsung.dialer");
              Bitmap dialerBM = BitmapFactory.decodeResource(context.getResources(), R.drawable.call);
              SrnImageAsset dialerIcon = new SrnImageAsset(context, "dialer_icon", dialerBM);
              remoteLaunchAction.setIcon(dialerIcon);
              Intent remoteLaunchIntentResult = new Intent(context, RichNotificationActivity.class);
              remoteLaunchAction.setCallbackIntent(CallbackIntent.getActivityCallback(remoteLaunchIntentResult));
              myActions.add(remoteLaunchAction);
      
              SrnRemoteInputAction keyboardAction = new SrnRemoteInputAction("Keyboard");
              Intent keyboardIntent = new Intent(context, RichNotificationActivity.class);
      
              KeyboardInputMode kInputMode = InputModeFactory.createKeyboardInputMode();
              kInputMode.setPrefillString("@name");
              kInputMode.setCharacterLimit(140);
              kInputMode.setKeyboardType(KeyboardType.NORMAL);
              keyboardAction.setRequestedInputMode(kInputMode);
              keyboardAction.setCallbackIntent(CallbackIntent.getActivityCallback(keyboardIntent));
              myActions.add(keyboardAction);
      
              SrnRemoteInputAction singelSelectAction = new SrnRemoteInputAction("Single Select");
              SingleSelectInputMode sInputMode = InputModeFactory.createSingleSelectInputMode();
              Intent singleSelectIntent = new Intent(context, RichNotificationActivity.class);
      
              sInputMode.addChoice("Black", "color_black");
              sInputMode.addChoice("White", "color_white");
              sInputMode.addChoice("Red", "color_red");
              singelSelectAction.setCallbackIntent(CallbackIntent.getActivityCallback(singleSelectIntent));
      
              singelSelectAction.setRequestedInputMode(sInputMode);
              singelSelectAction.setDescription("Select your favorite color.");
              myActions.add(singelSelectAction);
      
              SrnRemoteInputAction multipeSelectAction = new SrnRemoteInputAction("Multi Select");
              Intent multipleSelectIntent = new Intent(context, RichNotificationActivity.class);
              MultiSelectInputMode mInputMode = InputModeFactory.createMultiSelectInputMode();
      
              multipeSelectAction.setDescription("Select your favorite colors.");
              mInputMode.addChoice("Black", "color_black");
              mInputMode.addChoice("White", "color_white");
              mInputMode.addChoice("Red", "color_red");
              mInputMode.addChoice("Blue", "color_blue");
              multipeSelectAction.setCallbackIntent(CallbackIntent.getActivityCallback(multipleSelectIntent));
              multipeSelectAction.setRequestedInputMode(mInputMode);
              myActions.add(multipeSelectAction);
      
              return myActions;
          }
      }
      
  8. Create the EventExample sample template:
    1. Right-click the app/src/main/java/com.samsung.adnroid.myfirstrichnotification directory, and select New > Java Class.
    2. Enter the details.

      Create New Class EventExample

    3. Click OK.
    4. Implement the EventExample.java file content.

      As the SmallHeaderExample.java file, an EventExample.java file has also been implemented with 4 major components: a small header template, primary template, secondary template, and action.

      • Create an Event Header RichNotification, which contains all of the information that makes up the notification itself (such as template, data to populate the template with, and actions).
      • Specify the primary and secondary templates with proper text formatting and content.
      • Add actions.

        Actions provide a mechanism that allows your Rich Notification to do something on the host or wearable device. You can specify one or more actions for your notification.

      package com.samsung.android.myfirstrichnotification;
      
      import java.util.ArrayList;
      import java.util.List;
      
      import android.content.Context;
      import android.content.Intent;
      import android.graphics.Bitmap;
      import android.graphics.BitmapFactory;
      import android.graphics.Color;
      import android.net.Uri;
      
      import com.samsung.android.sdk.richnotification.SrnAction;
      import com.samsung.android.sdk.richnotification.SrnAction.CallbackIntent;
      import com.samsung.android.sdk.richnotification.SrnImageAsset;
      import com.samsung.android.sdk.richnotification.SrnRichNotification;
      import com.samsung.android.sdk.richnotification.SrnRichNotification.AlertType;
      import com.samsung.android.sdk.richnotification.SrnRichNotification.PopupType;
      import com.samsung.android.sdk.richnotification.actions.SrnHostAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteBuiltInAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.InputModeFactory;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.KeyboardInputMode;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.KeyboardInputMode.KeyboardType;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.MultiSelectInputMode;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteInputAction.SingleSelectInputMode;
      import com.samsung.android.sdk.richnotification.actions.SrnRemoteLaunchAction;
      import com.samsung.android.sdk.richnotification.templates.SrnPrimaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnQRSecondaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnSecondaryTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnStandardTemplate;
      import com.samsung.android.sdk.richnotification.templates.SrnStandardTemplate.HeaderSizeType;
      
      public class EventExample implements IExample {
          private final Context mContext;
      
          public EventExample(Context ctx) {
              mContext = ctx;
          }
      
          @Override
          public SrnRichNotification createRichNoti() {
              SrnRichNotification noti = new SrnRichNotification(mContext);
      
              noti.setReadout("New Event", "Today there is an event.");
      
              Bitmap appIconBitmap = BitmapFactory.decodeResource(mContext.getResources(),
                                                                  R.drawable.uber_icon);
              SrnImageAsset appIcon = new SrnImageAsset(mContext, "app_icon", appIconBitmap);
              noti.setIcon(appIcon);
      
              noti.setTitle("Eventify");
      
              noti.setPrimaryTemplate(getEventTemplate());
      
              noti.setSecondaryTemplate(getEventSecondaryTemplate());
              try {
                  noti.addActionsWithPermissionCheck(getActions());
              }
              catch (Exception e) {
                  e.printStackTrace();
              }
              noti.setAlertType(AlertType.SOUND_AND_VIBRATION, PopupType.NORMAL);
      
              return noti;
          }
      
          public SrnPrimaryTemplate getEventTemplate() {
              SrnStandardTemplate mMediumHeaderTemplate = new SrnStandardTemplate(HeaderSizeType.MEDIUM);
              mMediumHeaderTemplate.setBackgroundColor(Color.rgb(0, 255, 0));
      
              mMediumHeaderTemplate.setSubHeader("<b> Scheduled Event </b>");
              mMediumHeaderTemplate.setBody("Scheduled Meeting 10mins from now");
      
              return mMediumHeaderTemplate;
          }
      
          public SrnSecondaryTemplate getEventSecondaryTemplate() {
              SrnQRSecondaryTemplate qrSecTemplate = new SrnQRSecondaryTemplate();
      
              Bitmap qrCodeBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.map);
              SrnImageAsset qrCodeBig = new SrnImageAsset(mContext, "qr_code_big", qrCodeBitmap);
              qrSecTemplate.setImage(qrCodeBig);
      
              qrSecTemplate.addListItem("Attendee", "Chitra Sampath Kumar");
              qrSecTemplate.addListItem("Attendee", "Taehee Lee");
              qrSecTemplate.addListItem("Attendee", "Hunje Yun");
              qrSecTemplate.addListItem("Attendee", "Minsuk Choi");
              qrSecTemplate.addListItem("Attendee", "Jihwa Park");
              qrSecTemplate.addListItem("Attendee", "Junho Lee");
      
              Bitmap commentBM = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.like);
              SrnImageAsset commentIcon = new SrnImageAsset(mContext, "comment_icon", commentBM);
              qrSecTemplate.setSmallIcon1(commentIcon, "99999999+");
      
              Bitmap likeBM = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.unlike);
              SrnImageAsset likeIcon = new SrnImageAsset(mContext, "like_icon", likeBM);
              qrSecTemplate.setSmallIcon2(likeIcon, "99999999+");
      
              return qrSecTemplate;
          }
      
          public List<SrnAction> getActions() {
              ArrayList<SrnAction> myActions = new ArrayList<SrnAction>();
      
              SrnHostAction primaryAction = new SrnHostAction("Launch Web");
              Bitmap webActionBM = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.voice_action);
              SrnImageAsset webActionIcon = new SrnImageAsset(mContext, "web_icon", webActionBM);
      
              String url = "http://www.samsung.com";
              Intent resultIntent = new Intent(Intent.ACTION_VIEW);
              resultIntent.setData(Uri.parse(url));
      
              primaryAction.setIcon(webActionIcon);
              primaryAction.setToast("Check your phone!");
      
              primaryAction.setCallbackIntent(CallbackIntent.getActivityCallback(resultIntent));
              myActions.add(primaryAction);
      
              SrnRemoteBuiltInAction builtInAction = new SrnRemoteBuiltInAction("Call");
      
              builtInAction.setType(SrnRemoteBuiltInAction.OperationType.CALL);
              builtInAction.setData(Uri.fromParts("tel", "+15557364480", null));
              myActions.add(builtInAction);
      
              SrnRemoteLaunchAction remoteLaunchAction = new SrnRemoteLaunchAction("Launch Dialer");
              remoteLaunchAction.setPackage("com.samsung.dialer");
      
              Bitmap dialerBM = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.call);
              SrnImageAsset dialerIcon = new SrnImageAsset(mContext, "dialer_icon", dialerBM);
              remoteLaunchAction.setIcon(dialerIcon);
              Intent remoteLaunchIntentResult = new Intent(mContext, RichNotificationActivity.class);
              remoteLaunchAction.setCallbackIntent(CallbackIntent.getActivityCallback(remoteLaunchIntentResult));
              myActions.add(remoteLaunchAction);
      
              SrnRemoteInputAction keyboardAction = new SrnRemoteInputAction("Keyboard");
              Intent keyboardIntent = new Intent("com.samsung.android.richnotification.sample.callback_broadcast");
      
              KeyboardInputMode kInputMode = InputModeFactory.createKeyboardInputMode();
              kInputMode.setPrefillString("@name");
              kInputMode.setCharacterLimit(140);
              kInputMode.setKeyboardType(KeyboardType.NORMAL);
              keyboardAction.setRequestedInputMode(kInputMode);
              keyboardAction.setCallbackIntent(CallbackIntent.getBroadcastCallback(keyboardIntent));
              myActions.add(keyboardAction);
      
              SrnRemoteInputAction singelSelectAction = new SrnRemoteInputAction("Single Select");
              SingleSelectInputMode sInputMode = InputModeFactory.createSingleSelectInputMode();
              Intent singleSelectIntent = new Intent(mContext, RichNotificationActivity.class);
              Bitmap bitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.ic_launcher);
      
              sInputMode.addChoice("Black", "color_black", new SrnImageAsset(mContext, "black_icon", bitmap));
              sInputMode.addChoice("White", "color_white", new SrnImageAsset(mContext, "white_icon", bitmap));
              sInputMode.addChoice("Red", "color_red", new SrnImageAsset(mContext, "white_icon", bitmap));
              singelSelectAction.setCallbackIntent(CallbackIntent.getActivityCallback(singleSelectIntent));
              singelSelectAction.setRequestedInputMode(sInputMode);
              singelSelectAction.setDescription("Select your favorite color.");
              myActions.add(singelSelectAction);
      
              SrnRemoteInputAction multipeSelectAction = new SrnRemoteInputAction("Multi Select");
              Intent multipleSelectIntent = new Intent(mContext, RichNotificationActivity.class);
              MultiSelectInputMode mInputMode = InputModeFactory.createMultiSelectInputMode();
      
              multipeSelectAction.setDescription("Select your favorite colors.");
              mInputMode.addChoice("Black", "color_black");
              mInputMode.addChoice("White", "color_white");
              mInputMode.addChoice("Red", "color_red");
              mInputMode.addChoice("Blue", "color_blue");
              multipeSelectAction.setCallbackIntent(CallbackIntent.getActivityCallback(multipleSelectIntent));
              multipeSelectAction.setRequestedInputMode(mInputMode);
              myActions.add(multipeSelectAction);
      
              return myActions;
          }
      }