--- title: "Replacing the OTP Method UI" slug: "s3suite94-replacing-the-otp-method-ui" updated: 2026-10-27T18:42:04Z published: 2026-10-27T18:42:04Z canonical: "docs.onespan.com/s3suite94-replacing-the-otp-method-ui" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.onespan.com/llms.txt > Use this file to discover all available pages before exploring further. # Replacing the OTP Method UI The App SDK provides a default UI class for OTP registration and authentication that implements the IOtpLiveData interface. ![](https://cdn.document360.io/038f59a7-abd0-4c14-9de7-3434d28b49fd/Images/Documentation/image5(19).png?sv=2026-02-06&spr=https&st=2026-10-29T04%3A18%3A08Z&se=2026-10-29T05%3A18%3A08Z&sr=c&sp=r&sig=1oohdBG4kjyF2PG5Mwv1u4i17y%2Bo3ihCd3qbig5AS9c%3D) The class that implements your custom UI must also implement the IOtpLiveData interface. In addition, an object of Nok Nok's default UI class is created by Nok Nok's MethodUIFactory. Therefore, you must define your own factory class to create an object of your custom UI. The following steps take you through defining your custom UI class and your custom factory class. 1. Create a custom class that implements your UI. 2. Your custom class calls the following methods in class OtpMethodUI: cancel(), resendCode(), processIdentifier(), processConfirmIdentifier(), processCode(). Refer to the [Client API Docs](/dpoa/docs/s3suite94-android-client-api-docs) for details on these methods. 3. Declare that your custom class implements the IOtpLiveData interface. Define the following methods in your custom UI class: onGetIdentifier(), onConfirmIdentifier(), onGetCode(), onFinish() and onCancel(). These method definitions ensure that your class implements the IOtpLiveData interface. 4. Define a new factory class as a subclass of MethodUIFactory. For example, call this new class SampleMethodUIFactory. 5. Override your new factory's createMethodUI() method. Refer to SampleMethodUIFactory.kt in the Tutorial App for details on how to write this method. 6. When you create your factory, set your SampleMethodUIFactory class to the MethodUIFactory instance. ```plaintext MethodUIFactory.setInstance(new SampleMethodUIFactory()); ``` Refer to the [Client API Docs](/dpoa/docs/s3suite94-android-client-api-docs) for the OtpMethodUI class, the IOtpLiveData interface and the MethodUIFactory class for more details. #### Working Example in Tutorial App - Refer to files SampleMethodUIFactory.kt and SampleOtpUI.kt for an example implementation.