Enroll a Device {#ttp-device-enroll-device}
===========================================

Before starting the device enrollment process, make sure the Tap to Pay Ready app is installed on the Android device. Download the app using this [Google Play Store link](https://play.google.com/store/apps/details?id=com.visa.kic.app.kernel ""). If the app is not installed before device enrollment, you will be prompted to install it during the enrollment process. To learn more about the Tap to Pay Ready app, see [PCI MPoC Standard Compliance](/docs/cybs/en-us/tap-to-phone/integration/all/rest/tap-to-phone/tap-to-phone-intro/ttp-comply-pci-mpoc-intro.md "").  
Use the information in this section to enroll a device using the `enrollDevice` activity. This activity presents a merchant-facing UI that enables users to enroll a new device or a previously enrolled device by selecting or entering the device's serial number. Follow this step to enroll a device.

1. Use the `enrollDevice` activity to enroll the device.

   ```
   val mposUi: MposUi = ...
   mposUi.tapToPhone.enrollDevice(activity, requestCode)
   ...
   override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
       super.onActivityResult(requestCode, resultCode, data)

       val isEnrollmentSuccessful =
           resultCode == EnrollResultIntent.ENROLLMENT_RESULT_CODE &&
           data?.getStringExtra(EnrollResultIntent.ENROLLMENT_RESULT_EXTRA) ==
               EnrollResultIntent.ENROLLMENT_RESULT_EXTRA_ENROLLED

       if (isEnrollmentSuccessful) {
           val serialNumber = data?.getStringExtra(
               EnrollResultIntent.ENROLLMENT_RESULT_EXTRA_SERIAL_NUMBER
           )
           onEnrollmentComplete(serialNumber)
       } else {
           onEnrollmentFailed()
       }
   }
   ```

   #### Step Result

The `enroll` activity returns the result Intent.
