services | platforms | author |
---|---|---|
app-service\mobile, app-service\web, app-service |
dotnet, xamarin |
lindydonna |
Azure App Service field engineer sample with web admin portal and offline-sync-enabled Xamarin.Forms client
Try out a simple version of this demo and other Xamarin demos on "Try App Service".
This sample is for a mobile client app for field engineers at a cable company to more easily manage their appointments throughout the day. The app will sync the engineer's jobs for that day onto their device when there is an internet connection. When there isn't an internet connection, the Mobile Apps offline sync feature keeps the records available and edittable; when the engineer connects back to the internet, the local changes are synced and any new Jobs are pulled to their device.
This sample shows off some great features of Azure Mobile Apps and App Service, including:
- Offline Sync
- Easy to use client SDK for Xamarin
The first step of the sample is deploying the environment and code. Checkout the Deploying section below. Or, just click this button!
Alternatively, you can deploy using the Azure Portal. Click here to deploy. Note: you can set the parameter useSQLCE to 1 or 0 to specify if you want to use SQLCE or a SQL Azure database. However, this template always creates a SQL Azure Database even if you set the SQLCE parameter to 1.
Once you've refreshed the client to get all remote changes, you'll see all the jobs you have waiting to be fulfilled. At this point, you can disconnect your internet and make some changes. All your changes will be saved through a restart of the app.
If you visit the admin page that comes with your site ({sitename}.azurewebsites.net/admin), you can see that none of the records have been updated. If you connect to the internet on your device again and refresh, your changes will sync to the server. You can see those changes reflected via the admin portal.
Just click this button to deploy!
The easiest way to deploy is to use the Continuous Integration feature of App Service.
-
Fork this repo in GitHub.
-
Create a new Mobile App from the portal.
-
In the Mobile -> Data section, create a new Data Connection. For more detailed instructions, see Create a .NET backend using the Azure portal.
-
In the portal, navigate to All Settings for the new app.
-
In the Publishing section, select Continuous deployment.
-
Configure source control to point to your fork of this repo.
-
Click the Sync button to do an initial deployment.
There is a project configuration that uses SQL CE as the server database and therefore does not require SQL Azure.
To set up this version, after step #2 above, add an app setting with key TRY_APP_SERVICE
and value 1
. To set an app setting, go to All Settings -> Application Settings -> App Settings. Then, continue with steps 3-6 above.
Requirements:
- Xamarin Studio running on Mac OS X
- Azure Account (for a free trial, use Try App Service and the instructions there)
Steps:
-
Open up the Xamarin Project
-
Update the Mobile App Name, in
./Services/JobService.cs
-
Select an iPad target and start debugging.
If you're having problems with the App, create an issue on GitHub.
We welcome and encourage PRs from the community. Just checkout Azure's CLA first.
See LICENSE for full details.
- The Xamarin CRM app utilizing Azure Mobile
- Azure Mobile Apps on Azure.com
- Kirill Gavrylyuk giving this demo on Azure Fridays