Skip to content

Android Reference Wallet build instructions

This guide describes how to setup Android EUDI Reference Wallet and how to use it with the FortID Verifier to verify PID or mDL credential in Android EUDI Reference wallet.


Android Reference Wallet build instructions

Prerequisites

  1. Android Studio

  2. Git

  3. Android Device

    • An Android device running Android 8.0 (API level 26) or higher
    • USB cable to connect your device to the computer

NOTE: Tested with Android Studio Meerkat | 2024.3.1 Patch 2

Setting Up the Project

  1. Clone the Repository

    Terminal window
    git clone git@github.com:eu-digital-identity-wallet/eudi-app-android-wallet-ui.git
    cd eudi-app-android-wallet-ui
  2. Checkout the Specific Version

    Terminal window
    git checkout Wallet/Demo_Version=2025.03.24-Demo_Build=24
  3. Open the Project in Android Studio

    • Launch Android Studio
    • Click on “Open an existing Android Studio project”
    • Navigate to the cloned repository folder and select it
    • Wait for the project to sync and download dependencies

Configure project

In order for the app to work with FortID verifier we need to update pre-registered OpenId4VP configuration:

  • open file in Android Studio
Terminal window
core-logic/src/demo/java/eu/europa/ec/corelogic/config/ConfigWalletCoreImpl.kt
  • add updates to file:
    1. Import in import section
    import eu.europa.ec.eudi.wallet.transfer.openId4vp.PreregisteredVerifier
    1. Add constants to companion object
    private companion object {
    const val VCI_ISSUER_URL = "https://issuer.eudiw.dev"
    const val VCI_CLIENT_ID = "wallet-dev"
    const val AUTHENTICATION_REQUIRED = false
    const val OPENID4VP_VERIFIER_API_URI = "https://evs.fortid.com:5000/protocol/authorization-response"
    const val OPENID4VP_VERIFIER_LEGAL_NAME = "FortID Verification Service"
    const val OPENID4VP_VERIFIER_CLIENT_ID = "FortID-Verification-Service"
    }
    1. Update OpenId4Vp configuration, withClientIdSchemes part, with constants declared in previous step
    withClientIdSchemes(
    listOf(ClientIdScheme.Preregistered(
    listOf(
    PreregisteredVerifier(
    clientId = OPENID4VP_VERIFIER_CLIENT_ID,
    verifierApi = OPENID4VP_VERIFIER_API_URI,
    legalName = OPENID4VP_VERIFIER_LEGAL_NAME
    )
    )
    )),
    )

Connecting Your Android Device

  1. Enable Developer Options

    • Go to Settings on your Android device
    • Scroll down to “About phone”
    • Find “Build number” and tap it 7 times
    • You’ll see a message that you’re now a developer
  2. Enable USB Debugging

    • Go back to Settings
    • Find “Developer options” (usually at the bottom)
    • Enable “USB debugging”
  3. Connect Your Device

    • Connect your Android device to your computer using a USB cable
    • On your device, you might see a prompt asking to allow USB debugging - tap “Allow”
    • In Android Studio, you should see your device listed in the “Device Manager”

Building and Running the Application

  1. Build and Run the Application

    • Make sure your Android device is selected in the device dropdown menu
    • Click the “Run” button (green play icon) in the toolbar
    • Alternatively, press Shift+F10 (Windows/Linux) or Control+R (Mac)
  2. First Run

    • The first build might take several minutes as Android Studio downloads dependencies and builds the project
    • You’ll see the app being installed and launched on your device

Building Without a Device and Manual APK Installation

Building the APK

  1. Generate Release APK

    • In Android Studio, click on “Build” in the top menu
    • Select “Generate App Bundles or APKs”
    • Choose “Generate APKs”
    • Wait for the build to complete
    • You’ll see a notification when the build is finished
  2. Locate the APK

    • After successful build, click on “locate” in the notification
    • Alternatively, navigate to:
      app/build/outputs/apk/demo/debug/app-demo-debug.apk
    • The APK file will be named something like app-demo-debug.apk

Installing the APK on Your Device

  1. Transfer the APK

    • Connect your Android device to your computer
    • Copy the APK file to your device’s storage
    • You can use:
      • USB file transfer mode
      • Cloud storage
      • Email
      • Any file sharing method
  2. Install the APK

    • On your Android device, navigate to where you saved the APK file
    • Tap on the APK file
    • If prompted, allow installation from unknown sources:
      • Go to Settings > Security
      • Enable “Unknown sources” or “Install unknown apps”
    • Follow the installation prompts
    • The app will be installed and available in your app drawer
  3. Alternative Installation Method (ADB)

    • Connect your device via USB
    • Enable USB debugging (see Connecting Your Android Device section)
    • Open a terminal/command prompt
    • Navigate to the directory containing the APK
    • Run the following command:
      Terminal window
      adb install app-demo-debug.apk
    • Wait for the installation to complete

    Note: The adb tool is located in the Android SDK platform-tools directory:

    • Windows: %LOCALAPPDATA%\Android\Sdk\platform-tools\adb.exe
    • macOS: ~/Library/Android/sdk/platform-tools/adb
    • Linux: ~/Android/Sdk/platform-tools/adb

    You can also access it through Android Studio:

    1. Open Android Studio
    2. Go to Tools > SDK Manager
    3. Under “SDK Tools” tab, ensure “Android SDK Platform-Tools” is installed
    4. The path will be shown in the “Android SDK Location” field

Troubleshooting APK Installation

  1. Installation Blocked

    • Make sure you’ve enabled installation from unknown sources
    • Check if your device has any security software blocking the installation
  2. ADB Installation Issues

    • Ensure USB debugging is enabled
    • Check if your device is recognized by running adb devices
    • Try using the full path to the APK file
  3. Version Conflicts

    • If you have a previous version installed, you might need to uninstall it first
    • Use adb uninstall <package-name> to remove the old version

Troubleshooting

  1. Device Not Recognized

    • Ensure USB debugging is enabled
    • Try a different USB cable
    • Check if your device appears in the list when running adb devices in the terminal
  2. Build Errors

    • Make sure you have the correct version of Android Studio
    • Check that you have the required SDK versions installed
    • Try “File” > “Invalidate Caches / Restart” if you encounter strange build issues
  3. App Crashes

    • Check the “Logcat” window in Android Studio for error messages
    • Ensure your device meets the minimum Android version requirement

Additional Resources

Remember to keep your Android Studio and SDK tools updated for the best development experience.

Verifying

At this point, the EUDI Reference Wallet stores the PID or mDL VC. You can now proceed with the verification flow by following this guide.