---
title: Step 3. Test the app
description: Provides instructions on how to test the Android DaVinci sample app, including logging in, registering a new user, viewing user information, and troubleshooting common errors.
component: orchsdks
page_id: orchsdks:davinci:try-it-out/android/03_running-sample-pingone
canonical_url: https://developer.pingidentity.com/orchsdks/davinci/try-it-out/android/03_running-sample-pingone.html
revdate: Fri, 17 Oct 2025 14:50:55 +0100
keywords: ["DaVinci", "Android", "Test", "Run", "Sample App", "Tutorial", "Troubleshooting"]
section_ids:
  troubleshooting: Troubleshooting
  what_can_cause_validation_errors_in_the_request: What can cause validation errors in the request?
---

# Step 3. Test the app

[icon: circle-check, set=far]PingOne [icon: android, set=fab]Android

* [Prepare](00_before-you-begin.html)

* [Download](01_downloading-forgerocksdk.html)

* [Configure](02_configuring-sample-for-davinci.html)

* **Run**

In the following procedure, you run the sample app that you configured in the previous step.

1. Add or connect a device to Android Studio.

   Learn more about devices in Android Studio in the Android Developer documentation:

   * [Create and manage virtual devices](https://developer.android.com/studio/run/managing-avds?_gl=1*1q3w4b8*_up*MQ..*_ga*MTQ5NTk5Njc4My4xNzMwMTE4ODIx*_ga_6HH9YJMN9M*MTczMDExODgyMS4xLjAuMTczMDExODgyMS4wLjAuMTM0NjM1MTk2OA..)

   * [Run apps on a hardware device](https://developer.android.com/studio/run/device?_gl=1*17hr6hh*_up*MQ..*_ga*MTQ5NTk5Njc4My4xNzMwMTE4ODIx*_ga_6HH9YJMN9M*MTczMDExODgyMS4xLjAuMTczMDExODgyMS4wLjAuMTM0NjM1MTk2OA..)

2. On the **Run** menu, click **Run 'samples.app'**.

   Android Studio starts the sample application on the simulated or connected device.

   The app automatically starts the DaVinci flow:

   ![The DaVinci sample app first screen with fields and buttons.](../../_images/davinci-sample-username-password-en.png)Figure 1. The DaVinci sample app first screen with fields and buttons.

3. Optionally, to register a new identity in PingOne, tap the **No Account? Register now!** link.

   |   |                                            |
   | - | ------------------------------------------ |
   |   | This link is an example of a `FlowButton`. |

   The app displays the registration screen:

   ![The DaVinci sample app registration screen](../../_images/davinci-sample-register-en.png)Figure 2. The DaVinci sample app registration screen.

   1. Enter the details of the new identity, and then click **Save**.

      The app creates the new identity in PingOne and returns to the sign on screen.

4. Enter the username and password of a PingOne identity, and then click **Sign On**.

   The app sends the credentials to PingOne for validation, and on success displays the user's info:

   ![The DaVinci sample app displaying user info](../../_images/davinci-sample-userinfo-en.png)Figure 3. The DaVinci sample app displaying user info

5. Tap the menu ([icon: bars, set=fa]) icon, and then tap **[icon: generating_tokens, set=material, size=inline] Show Token**.

   The app shows the access token obtained on behalf of the user.

   ![The DaVinci sample app displaying a user's access token](../../_images/davinci-sample-access-token-en.png)Figure 4. The DaVinci sample app displaying a user's access token

6. Tap the menu ([icon: bars, set=fa]) icon, and then tap **[icon: logout, set=material, size=inline] Logout**.

   The app revokes the existing tokens and ends the session in PingOne.

## Troubleshooting

This section contains help if you encounter an issue running the sample code.

### What can cause validation errors in the request?

When starting the app you might see an error message as follows:

> The request could not be completed. One or more validation errors were in the request.

![davinci sample validation error en](../../_images/davinci-sample-validation-error-en.png)Figure 5. Validation error when starting the app

The **Logcat** pane in Android Studio often contains additional information about the error:

```json
{
  "id" : "2a72bf00-5f20-4b78-a7d0-ad8d95e9b11b",
  "code" : "INVALID_DATA",
  "message" : "The request could not be completed. One or more validation errors were in the request.",
  "details" : [
    {
      "code" : "INVALID_VALUE",
      "target" : "redirect_uri",
      "message" : "Redirect URI mismatch"
    }
  ]
}
```

In this case the cause is `Redirect URI mismatch`.

Ensure that your `redirectUri` value in `com/pingidentity/samples/app/davinci/DaVinciViewModel.kt` exactly matches one of the values you entered in the Redirect URIs field in your OAuth 2.0 application in PingOne:

![.Match the redirect URIs in the sample app and PingOne configuration](../../_images/troubleshoot-match-redirect-uris-en.png)Figure 6. Match the redirect URIs in the sample app and PingOne configuration
