Hi Adam,
I apologize for the delay. I'll attach the sample application to this message. As to which SDK you should use, it would depend on your business requirements with the Runtime SDK. I personally prefer .NET because I'm more proficient in it and typically work in Windows environments, but I also leverage Java, Android, and iOS when the project requires using one of those SDKs.
The sample I've written uses the Runtime for .NET SDK. For each runtime API there should a sample application included that would most likely have a sample that shows how to open a tile package. I would assume that if you're familiar with other languages you shouldn't have too much trouble rewriting this sample into those languages.
I've also included a copy of the logic I used below along with an image of the application. You'll see that the application contains a single button that you can use to load tile packages from disk.
using System.Windows.Forms;
using Esri.ArcGISRuntime.Controls;
using System;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using Esri.ArcGISRuntime.Layers;
namespace LoadTilePackage
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private async void LoadButton_OnClick(object sender, RoutedEventArgs e)
{
// Allow the user to browse to a tile package
string tpkPath = BrowseFolderForFile("Please select a Tile Package", "Tile Package (*.tpk)|*.tpk");
if (String.IsNullOrEmpty(tpkPath))
return;
// Create a map to hold the layer
Map map = new Map();
// Load the tile package
ArcGISLocalTiledLayer layer = new ArcGISLocalTiledLayer(tpkPath);
await layer.InitializeAsync();
// Add the tpk to the map
map.Layers.Add(layer);
// Replace the MapView's map with the new map
MyMapView.Map = map;
}
public string BrowseFolderForFile(string title, string extension)
{
OpenFileDialog openFileDialog = new OpenFileDialog
{
Filter = extension,
Multiselect = false,
ShowHelp = true,
Title = title
};
if (openFileDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return string.Empty;
string fileName = openFileDialog.FileName;
return fileName;
}
}
}