Mobile Clients for Android and iOS
The same three projects as Module 3;
the client now targets Android and iOS too, and the FieldOps app gains the phone screen of the
walkthrough — WorkOrderPage: the blue app bar with FieldOps' own back arrow and
FieldOps · Work orders / · WO-4821, the order cards (WO-4821 Riverside Pump Station,
WO-4820, WO-4817, WO-4809), the detail with METER READING, NOTES and Submit reading,
the Draft restored banner, the Leave WO-4821? Stay / Leave dialog, and the status strip
Remote · FieldOps server with the platform on the right.
Run it
cd "Hybrid and Native Packaging Course/Module 4/FieldOps"
dotnet run -f net10.0 --urls http://localhost:6304
- Browser, phone layout: open http://localhost:6304 in a window narrower than 600 px (or add
?view=phone). - Windows client: as in Module 3 (
-p:WindowsPackageType=Nonefor a Remote-only run); withFIELDOPS_URL=http://localhost:6304/?view=phoneit opens the phone layout on the desktop. - Android emulator:
dotnet build -t:Run -f net9.0-android FieldOps.Client\FieldOps.Client.csproj(the client openshttp://10.0.2.2:6304/). iOS Simulator: same with-f net9.0-ios, on a Mac. - Licence key:
FieldOps.Client/HybridLicense.props(git-ignored, seeHybridLicense.props.example).
What to try
| Action | Expected result |
|---|---|
| Phone layout, tap WO-4821 | Detail full screen: High priority · Pump P-2 inlet, Meter reading, Notes, Submit reading. |
Type 412.8 and a note, tap the back arrow | Leave WO-4821? The reading 412.8 has not been submitted yet. — Stay keeps you there; Leave discards the draft and pops to the list. |
| Type a reading, then open FieldOps in a new session (another client or device for the same technician) | Opens straight into WO-4821 with Draft restored — WO-4821 · reading 412.8. |
| In the Hybrid client: minimise / restore (Windows), take a call (phone) | Server log lifecycle: …; the draft is saved on Stopped/Backgrounding and restored on Resumed / after the reload. |
| Android back gesture | Device.Application.BackRequested → the same NavigateBack. |
Submit reading with abc | "abc" is not a meter reading. Enter a number such as 412.8. |
Submit reading with 412.8 | Reading 412.8 submitted for WO-4821.; back now pops without asking. |
What was verified, and how
- Builds:
FieldOps(net10.0-windows, net10.0);FieldOps.Client+FieldOps.Offlinefornet9.0-windows10.0.19041.0andnet9.0-android(debug APKcom.contoso.fieldops-Signed.apk, 14 MB): 0 errors, 0 warnings. On this machine the Android build needs the workload-manifest workaround described in the course cookbook (a machine problem, not a project setting). - Browser (
fieldops-m4, 360 × 640): the phone list and detail as in the video; typed 412.8 and a note, back arrow → the Leave dialog; Stay kept the reading; Submit reading → Reading 412.8 submitted for WO-4821.; back then popped to the list without asking. - Windows Hybrid client (unpackaged, licensed, phone layout via
FIELDOPS_URL): new session → Draft restored — WO-4821 · reading 412.8 (server log + capture of the client window,docs/screenshots/); minimise/restore of my own client window →Deactivated,Stopped,Resumed(draft restored),Activatedin the server log. - Not run: the Android emulator (no AVD on this machine, none created) and anything iOS (needs a
Mac). Therefore
Backgrounding, the reload on foreground andBackRequestedwere not observed — Windows raised neither.
Where this sample differs from the lesson
- Project name: the video calls the client
FieldOps.Mobile; it is the sameFieldOps.Clientproject from Module 3 with the mobile targets added (the lesson's "one client project"). - The phone screen is a second page. The desktop list (
WorkOrdersPage, Module 3) stays for desktops and wide browsers;WorkOrderPageserves phones, tablets and narrow browsers. Both are the same codebase and the same services. - Priority and status labels: Urgent in the video is FieldOps' High; In progress / Complete are On site / Completed. The detail line shows the order's fault ("Pump P-2 inlet").
- Server address: the
10.0.2.2:5000is10.0.2.2:6304, this module's port. - The Local fallback stays registered (packaged clients only, see Module 3) although this module's lesson describes FieldOps as Remote; the decision record from Module 1 chose Remote + Local fallback.
- Windows behaviour: minimise raised
Stopped, notBackgrounding, and did not reload the WebView.