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:
| Field | Description |
|---|---|
| Tenant ID | Your Azure AD (Entra ID) tenant GUID |
| Client ID | The Application (client) ID from your Azure AD app registration |
| API Endpoint | The 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
Option A: QR Code (Recommended)
- In the Mobile Setup page in BC, use the Generate QR Code action
- Open the Aptean Mesh Client app on your device
- 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
- Open the Aptean Mesh Client app
- Enter the API endpoint URL manually in the settings screen
- Sign in with your Business Central user credentials
Step 3: Verify the Connection
Once connected, the mobile app performs the following sequence:
- Authenticates against Azure AD using the configured Client ID and Tenant ID
- Calls
GetPageFlow-- this fetches all mobile page definitions from your App Bundle, including each page's JSON, service binding, and workflow association - 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:
- In Mobile Setup, turn on Request Logging
- 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
| Problem | Solution |
|---|---|
| "Connection Error" on the app | Verify the API endpoint URL is correct and reachable from the device |
| Blank screen after sign-in | Check that the App Bundle has a Root Page ID set |
| Wrong pages or old content | Confirm the bundle status and user assignment are correct; re-fetch page flow from the app settings |
| Authentication fails | Verify the Azure AD app registration, redirect URIs, and that your user has a BC license |
| "Service not configured" error | Ensure the service code in the page JSON matches a record in Mobile Service Registry |
| "No service implementation found" error | Verify 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:
- Creating a Mobile Service -- build a full-featured service with actions and callbacks
- Page with Data Binding -- query BC data and bind it to page components
- Components Reference -- browse all available UI components for building mobile pages
- AL API Reference -- explore the full framework API