Hey all,
im trying to do this tutorial Add layers to a map (offline) | ArcGIS for Developers
I need to tell the apk where the location of the PackageFolder is. When i put it on my device or i use the path from my pc. It will not load the mmpk, when i test the apk.
this is how i write it:
var mapPackageFolder = @C:\Users\Test\Desktop\XamarinTest\Vegetation Management; var mapPackageFile = @SUEWAG VTPK Grundkarte Beschriftung.mmpk;
this is how i tested it, when i put the folder it to my Device
var mapPackageFolder = @Interner Speicher\XamarianTest; var mapPackageFile = @SUEWAG VTPK Grundkarte Beschriftung.mmpk;
do i miss something?
What platform, WPF or UWP? UWP restricts where you could put files.
I think i need to explain more. Im using Visual Studio and Xamarin to create iOS and Android applications. Im working with Windows10.
I dont use UWP and WPF, maybe im using the wrong tutorial???
There is no C: drive on an iOS or Android device, you cannot set a location like you would in Windows with a full path.
The easiest way is to use a Environment.SpecialFolder because this returns the platform specific location.
<SPAN class="keyword token">var</SPAN> mapPackageFolder <SPAN class="operator token">=</SPAN> Path<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Combine</SPAN><SPAN class="punctuation token">(</SPAN>Environment<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetFolderPath</SPAN><SPAN class="punctuation token">(</SPAN>Environment<SPAN class="punctuation token">.</SPAN>SpecialFolder<SPAN class="punctuation token">.</SPAN>MyDocuments<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"SomeSubfolder"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"SomePackageName"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
Thanks it helped me, but i got it working with Android.OS.Environment.ExternalStorageDirectory.
But now i get this Error:
Esri.ArcGISRuntime.ArcGISRuntimeException: 'Invalid access: Mobile map package failed to open. Check the archive format is correct, zip file with no compression.'
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.