|MBO Android App||OData Android App|
OData Android Content:
- Device’s Local Database Creation
- Read Operations
- CUD Operations (coming soon)
On-boarding is the process of registering a user and giving them appropriate access to data and applications. MBO based mobile apps built in SUP 2.x/SMP 2.3 must register with the server before establishing a connection. Similarly OData based mobiles apps built in SMP 3.0 must on-board with the server before accessing backend data. However, this registration process for MBO based apps is completely different from the on-boarding process for OData based apps. In consequence, developers who want to migrate android apps from MBO to OData are required to rewrite the login screen. In the following section, we will compare both registration processes to guide your through these changes.
MBO Based Mobile Apps
In order for MBO based mobile apps to register with the server during the initial application startup, developers must:
- Create a standard Android activity
- In the onCreate method, indicate the Android layout used by this activity: In Android, developers can create the user interface with layout in XML to include the UI elements like text fields and buttons.
- Capture basic information like host, login and password
- Register the application using the registerApplication method in the com.sybase.mobile.Application class. The following code shows how to register the application and device from an MBO based android app.
OData based mobile apps
On the other hand, OData based mobile apps built using SMP 3.0 can leverage the MAF Logon component to simplify the on-boarding process. The MAF Logon component provides with the user interface and the logic required to onboard users.
In order to use the MAF Logon component, developers must
- Import a number of libraries and external resources to the android project
- Create a standard Android activity that implements com.sap.maf.tools.logon.logonui.api.LogonListener
- In the onCreate method, initialize the LogonUIFacade and present the logon screen by setting the resulting view as the content for this activity. The following Code shows how to customize and display the MAF logon screen from the OData based mobile apps.
- Once the registration finished, the MAF logon component will call the onLogonFinished method. Developers can implement this method to verify whether the on-boarding process finished successfully.
You can find in this guide How To… Setup MAF resources in Android Studio details about how to:
- Import MAF libraries and external resources into your android project
- Display the MAF Logon component
- Verify results of the on-boarding process
Below you will find screenshots of the LoginActivity for the sample MBO based app and the OData based app.
Please note we have submitted this sample app for publishing and it will be available on a public Git repository soon.