Skip to content

Consent Form

As part of the Onboarding suite provided in Fiori UI, Consent Form is a set of consecutive screens containing legal or regulatory information that requires an end user to review and approve/deny before starting to use an application.

Consent Consent
Consent Form on a Phone Consent Form on a Tablet
Consent Consent
Consent Form on a Phone Consent Form on a Tablet
Consent Consent
Consent Form on a Phone Consent Form on a Tablet

Consent Form provides three modes to accommodate different levels of regulatory requirements: HIPAA (to support the Health Insurance Portability and Accountability Act), OPTIONAL, and REQUIRED.

  • HIPAA is the strictest mode, in which a user must scroll down to the bottom of each page in order to proceed to the next screen, i.e the Next button will only be displayed once the bottom of the text view is shown upon scrolling down.
  • OPTIONAL is the least strict mode, in which a Skip button is shown on the upper right corner so that a user can skip through the screens.
  • REQUIRED is the mode where a user can't skip through the screens (i.e. no Skip button is provided on the UI) but they also don't have to scroll down to the bottom of the page in order to browse to next screen, (i.e. the Next button will always be displayed).

| Consent | Consent | Consent | ![Consent](images/consent-phone-req-2.png | |:---:|:---:|:---:| | Consent Form (HIPAA) | Consent Form (OPTIONAL) | Consent Form (REQUIRED) |

Consent Form can be added easily to any app by creating a ConsentScreenSettings object. After initializing the settings, call on ConsentScreenSettings' saveToIntent() method to save the settings to whatever intent to display. For example:

    public void startConsentScreen(){

        Intent i = new Intent();
        i.setComponent(new ComponentName(activity.getPackageName(),
                "com.sap.cloud.mobile.onboarding.consent.ConsentScreenActivity"));
        ConsentScreenSettings consentScreenSettings;

        if (activity.isUITest) {
            consentScreenSettings = new ConsentScreenSettings(activity.getIntent());
        } else {
            consentScreenSettings = new ConsentScreenSettings();

            String longSentence = "Detailed text about how data privacy pertains to this app and why it's important for the user to enable this functionality. ";

            String longText = "";
            for (int l=0; l < 50; l++) {
                longText +=longSentence;
            }

            String lengthTest = "2,4 Detailed text about how data privacy pertains to this app and why it's important for the user to enable this functionality.";
            consentScreenSettings.addScreen("Consent Page 1",
                    "1 " + longText,
                    "Learn More 1",
                    "https://www.sap.com");
            consentScreenSettings.addScreen("Consent Page 2",
                    lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest,
                    "Learn More 2",
                    "https://www.sap.com");
            consentScreenSettings.addScreen("Consent Page 3",
                    "3 " + longText,
                    "Learn More 3",
                    "https://www.sap.com");
            consentScreenSettings.addScreen("Consent Page 4",
                    "4 Detailed text about how data privacy pertains to this app and why it's important for the user to enable this functionality.",
                    "Learn More 4",
                    "https://www.sap.com");
            consentScreenSettings.addScreen("Consent Page 5",
                    lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest,
                    "Learn More 5",
                    "https://www.sap.com");
            consentScreenSettings.addScreen("Consent Page 6",
                    lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest,
                    "Learn More 6",
                    "https://www.sap.com");
            consentScreenSettings.addScreen("Consent Page 7",
                    lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest,
                    "Learn More 7",
                    "https://www.sap.com");
            consentScreenSettings.addScreen("Consent Page 8",
                    lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest+"\n"+lengthTest,
                    "Learn More 8",
                    "https://www.sap.com");
            consentScreenSettings.addScreen("Consent Page - Last",
                    "Last Detailed text about how data privacy pertains to this app and why it's important for the user to enable this functionality.",
                    "Learn More Last",
                    "https://www.sap.com");
            consentScreenSettings.setId("Page1Set");
            consentScreenSettings.setScreenType(ConsentScreenSettings.ScreenType.HIPAA);
        }

        consentScreenSettings.saveToIntent(i);
        activity.startActivityForResult(i, OnboardingActivity.CONSENT);
    }

A few methods in ConsentScreenSettings are being called to set up the actual consent screens:

  • addScreen(String screenTitle, String screenContent, String screenLearnMore, String screenLearnMoreUrl): Add a screen with a title, content, and a learn more URL.
  • setId(String strId): Specify an ID for the set of consent settings.
  • setScreenType(ScreenType screenType): Specify the screen mode (one of: HIPAA, OPTIONAL, REQUIRED).

Last update: November 4, 2020