Select to view content in your preferred language

Portal Item Downloader in MAUI

445
1
12-15-2022 01:00 PM
JasonMiller7
New Contributor

First of all, many thanks to all who have made Runtime 200.x a reality... 🙂

I am looking to create a MAUI app where the app will download various mobile map packages (depending on the user's needs) and display them in the app.  What I would like to do is mimic what is done in the Runtime Samples app where a Portal ItemId is given, and the app checks to see if the item already exists on disk, and if not, then downloads it.  Since the "SampleLoader.cs" file is tailored to a "SampleInfo" object, I'm wondering if anyone has created a more "generic" PortalItemLoader.... I'm working on creating one myself, but not being a "professional programmer", it's taking me a little longer than desired... so just curious if anyone has done anything like this already...

Thanks!

 

0 Kudos
1 Reply
dotMorten_esri
Esri Notable Contributor

Check out the file download task in the demos repo:
https://github.com/Esri/arcgis-runtime-demos-dotnet/blob/main/src/CampusRouting/OfficeLocator.Core/D...
It even supports pause and resume of partial downloads, great if downloads are large, and you get interrupted.
It is used by the provisioning helper, which given the itemid, just returns the download path if the data is already on disk: https://github.com/Esri/arcgis-runtime-demos-dotnet/blob/main/src/CampusRouting/OfficeLocator.Core/P...

0 Kudos