Skip to Content

Customizing MAF Logon Component in Android

Developers can use MAF Logon component to implement quickly the logon UI logic needed to onboard users with SMP 3.0. Although this component is very functional and easy to implement, companies would rarely use its default settings in mobile clients to go live. In this blog will explore some of the settings that can be modified in the MAF Logon component.


The use of this component requires some dependencies that are described in this document How To… Setup MAF resources in Android Studio  Follow along and you will find that in this document we got an instance of the LogonUIFacade class and initialize it in the onCreate method of the LogonActivity as shown in the following code snippet

Code Snippet – initialize MAF Logon Component (with default settings)


       protected void onCreate(Bundle savedInstanceState) {


              // set context reference

        Context mContext = this;

              // get an instance of the LogonUIFacade

        LogonUIFacade mLogonUIFacade = LogonUIFacade.getInstance();

              //Initialize the Logon UI Facade

              mLogonUIFacade.init(this, mContext, <name of your application id>);

              // ask LogonUIFacede to present the logon screen

              // set the resulting view as the content view for this activity



As a result, the mobile client will display the default screen flow of the MAF Logon component


Now with few more lines of codes in the onCreate method, you can customize the MAF logon component to simplify the registration process

Step 1-2: Hide MobilePlace Window and then initialize MAF Logon component

In order to hide the MobilePlace window we would need to get the logon core shared preferences settings and modify the mobile place shared property before we get an instance of the LogonUIFacade class.

Code Snippet – Hide MobilePlace window and initialize LogonUIFacade class

//STEP1: Hide MobilePlace window

SharedPreferences prefs = getSharedPreferences(LogonCore.PREFERENCE_FILE_NAME, Context.MODE_PRIVATE);

SharedPreferences.Editor pEditor = prefs.edit();

pEditor.putBoolean(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_MOBILEPLACE.toString(), false);


//STEP2: Get an instance of the LogonUIFacade and initialize it as in the original code

LogonUIFacade mLogonUIFacade = LogonUIFacade.getInstance();

mLogonUIFacade.init(this, this, “<your application id>”);

Step 3: Set Default Values in login fields

Mobile clients require the SMP server URL and port in order to onboard the user with SMP 3.0. However, in most cases companies would like to set these fields with default values and hide them from the final user.  Developers can set default values with the setDefaultValue methods of the LogonUIFacade class as shown following code snippet.

Code Snippet – Set default values

//STEP3: Set Default values

mLogonUIFacade.setDefaultValue(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_SUPSERVERURL, “<your smp server host>”);

mLogonUIFacade.setDefaultValue(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_SUPSERVERPORT, “<your smp server port>”);

//type “true” if the mobile client is using HTTPS, type “false” otherwise

mLogonUIFacade.setDefaultValue(SharedPreferenceKeys.PREFERENCE_ID_HTTPSSTATUS, “<true|false>”);

Step 4: Hide fields in the login details

Generally, users only know their username and passwords. Developers may want to hide the rest of the fields to simplify the registration process. By default, all fields are displayed, hence you only need to specify those fields that are going to be hidden as shown below.

Code Snippet – Hide fields

// STEP4: Hide Login details

mLogonUIFacade.isFieldHidden(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_SUPSERVERURL, true);

mLogonUIFacade.isFieldHidden(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_SUPSERVERPORT, true);

mLogonUIFacade.isFieldHidden(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_SECCONFIG, true);

mLogonUIFacade.isFieldHidden(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_SUPSERVERFARMID, true);

mLogonUIFacade.isFieldHidden(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_URLSUFFIX, true);

mLogonUIFacade.isFieldHidden(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_MOBILEUSER, true); mLogonUIFacade.isFieldHidden(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_ACTIVATIONCODE, true); mLogonUIFacade.isFieldHidden(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_HTTPSSTATUS, true);

mLogonUIFacade.isFieldHidden(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_GATEWAYCLIENT, true);

mLogonUIFacade.isFieldHidden(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_SUPSERVERDOMAIN, true);

mLogonUIFacade.isFieldHidden(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_PINGPATH, true);

mLogonUIFacade.isFieldHidden(LogonCore.SharedPreferenceKeys.PREFERENCE_ID_GWONLY, true);

Step 5: Hide Splash Screen

In order to hide the splash screen, developers need to set the showSplashScreen to false. However, this change restores the default values, so it’s important to call it at the end.

Code Snippet – Hide Splash Screen

// ask LogonUIFacede to present the logon screen

// set the resulting view as the content view for this activity


// Hide splash screen


After these changes, the new mobile client will display the screen flow of the MAF Logon component  as follows


Hope this helps,


You must be Logged on to comment or reply to a post.
  • /
      • Hi Midhun,

        My application runs properly and after providing the parameters (Server, Ports, etc) nothing is happening. I am getting below error in android studio:

        04-29 22:50:36.204 19147-19446/com.example.usman.travelagency I/ [group:] [artifact: Request] [version: 3.7.0] [buildTime: 2015-02-23 21:28] [gitCommit: a0a77a89919c865a32e1d4c67d163d100ccbb660] [gitBranch: rel-3.7]

        04-29 22:50:36.295 19147-19446/com.example.usman.travelagency I/ [group:] [artifact: Request] [version: 3.7.0] [buildTime: 2015-02-23 21:28] [gitCommit: a0a77a89919c865a32e1d4c67d163d100ccbb660] [gitBranch: rel-3.7]

        04-29 22:50:36.295 19147-19446/com.example.usman.travelagency I/ [group:] [artifact: CoreServices] [version: 3.7.0] [buildTime: 2015-02-23 21:28] [gitCommit: a0a77a89919c865a32e1d4c67d163d100ccbb660] [gitBranch: rel-3.7]

        04-29 22:50:36.355 19147-19456/com.example.usman.travelagency W/System.err Error: 80003 Message: Unable to reach Backend URL

        04-29 22:50:36.355 19147-19456/com.example.usman.travelagency W/System.err at

        04-29 22:50:36.355 19147-19456/com.example.usman.travelagency W/System.err at$

        04-29 22:50:36.375 19147-19456/com.example.usman.travelagency E/ClientHub Error contacting Client Hub Application

        04-29 22:50:36.375 19147-19456/com.example.usman.travelagency I/ClientHub Pincode not validated yet.

        04-29 22:50:36.375 19147-19456/com.example.usman.travelagency D/MAFLogonActivity onLogonFinished: Host is unreachable!

        04-29 22:50:36.495 19147-19147/com.example.usman.travelagency E/ViewRootImpl sendUserActionEvent() mView == null

          04-29 22:50:41.750 19147-19147/com.example.usman.travelagency W/IInputConnectionWrapper showStatusIcon on inactive InputConnection



          • Hi Midhun,

            I have checked the ports and i am able to telnet the Server IP on port 8080. But still facing the same error. No clue why its throwing this error.



          • Hi Muhammad,

            You could raise a new discussion on this since the question is not related to this blog.

            Firstly, use REST Client to test and make sure you are able to register. Then check the accessibility from device.


            SAP Technology RIG

          • Hi Midhun,

            I have tested with the REST Client. I am able to test it with the REST client and it is working fine. But still the device is giving the same error.



  • Hi guys,


    I have a problem wich I can't resolve. When I try to change settings and click on "Next" button, I got the message  "NWNative Has Stopped". Therefore, 0 error is detected on my Android Studio.

    Offcourse, I tested to connect with my credentials at hcmps server from a web browser and It's works.

    I'm totally blocked, I hope you will help me to find a solution.


    Thank's in advance.



    • Hi,

      That is probably worth an OS update:

      Important: If your PC is producing NWNative.dll errors, you should check your Windows operating system immediately!

      The file NWNative.dll is part of the software CNE Net NetWare 5 Beta 3 from the Novell Inc.. NWNative.dll size is 66048, the version is, works on Windows.