Creating the client-side authentication components
Create a native Android application and add the MobileFirst native APIs as explained in the documentation.
Add an activity, LoginFormBasedAuth, which handles and presents the login form.
Remember to add this activity to the AndroidManifest.xml file, too.
Create a MyChallengeHandler class as a subclass of ChallengeHandler.
Your MyChallengeHandler class must implement isCustomResponse, which checks every custom response received from MobileFirst Server to verify whether this is the expected challenge.
The handleChallenge method is called after the isCustomResponse method returns true.
Here this method presents the login form.
The submitLogin method is called by the login form. If the user asked to abort this action, use the submitFailure() method, otherwise use the submitLoginForm() method to send input data to the authenticator.
In the MainActivity class, connect to MobileFirst Server, register your challengeHandler object, and invoke the protected adapter procedure.
The procedure invocation triggers MobileFirst Server to send a challenge that will trigger the challenge handler.