Skip to main content

Connecting the Client

This guide walks you through connecting the Aptean Mesh Client Android app to your Business Central environment, so you can see your mobile pages running on a device.

Prerequisites

Before connecting, make sure you have:

  • A published AL extension with at least one mobile page (see Hello World)
  • An App Bundle configured with a Root Page ID and user assignment
  • The service registered in the Mobile Service Registry
  • The Aptean Mesh Client app installed on your Android device or emulator

Step 1: Configure Mobile Setup in BC

In Business Central, search for Mobile Setup and fill in the connection fields:

FieldDescription
Tenant IDYour Azure AD (Entra ID) tenant GUID
Client IDThe Application (client) ID from your Azure AD app registration
API EndpointThe OData/API endpoint for your BC environment

These values tell the mobile app where to authenticate and which BC environment to connect to.

Step 2: Connect the Mobile App

  1. In the Mobile Setup page in BC, use the Generate QR Code action
  2. Open the Aptean Mesh Client app on your device
  3. Scan the QR code -- the app automatically configures the connection settings

This is the fastest way to set up a new device.

Option B: Manual Configuration

  1. Open the Aptean Mesh Client app
  2. Enter the API endpoint URL manually in the settings screen
  3. Sign in with your Business Central user credentials

Step 3: Verify the Connection

Once connected, the mobile app performs the following sequence:

  1. Authenticates against Azure AD using the configured Client ID and Tenant ID
  2. Calls GetPageFlow -- this fetches all mobile page definitions from your App Bundle, including each page's JSON, service binding, and workflow association
  3. Renders the Root Page -- the page whose ID matches the Root Page ID configured on the App Bundle

If you followed the Hello World tutorial, you should see "Hello from Aptean Mesh!" displayed on screen.

Troubleshooting

Enable Request Logging

For debugging, you can enable logging to inspect the raw JSON-RPC traffic:

  1. In Mobile Setup, turn on Request Logging
  2. After making requests from the mobile app, open Mobile Request Logs in BC

The log entries show:

  • Request JSON -- the full JSON-RPC payload sent by the mobile client
  • Response JSON -- the response returned by BC
  • Timestamp and Duration -- for performance analysis

Common Issues

ProblemSolution
"Connection Error" on the appVerify the API endpoint URL is correct and reachable from the device
Blank screen after sign-inCheck that the App Bundle has a Root Page ID set
Wrong pages or old contentConfirm the bundle status and user assignment are correct; re-fetch page flow from the app settings
Authentication failsVerify the Azure AD app registration, redirect URIs, and that your user has a BC license
"Service not configured" errorEnsure the service code in the page JSON matches a record in Mobile Service Registry
"No service implementation found" errorVerify your codeunit subscribes to OnResolveService and the codeunit ID in the registry is correct

What's Next

You now have a working end-to-end setup -- from AL code in VS Code, through Business Central, to the mobile device. From here you can explore: