|
<< Click to Display Table of Contents >> Navigation: Gnostice Document Studio .NET > Getting Started > Document Viewing > Xamarin > Application creation |
Steps to create a basic Xamarin document viewer application for Android and iOS.
1 |
Open Visual Studio 2019 and create a new Mobile App (Xamarin.Forms) project.
|
2 |
Give the project a name (say XamarinDocumentViewer)
|
3 |
In the subsequent wizard dialog choose the Blank template and make sure both Android and iOS platforms are ticked.
|
|
After the project is created, use either the GUI or the Package Manager Console and install the Gnostice.DocumentStudio.Xamarin NuGet package to the common project. In this example it is the project titled XamarinDocumentViewer.
|
4 |
Add the following code snippet that creates and initializes the Xamarin Document Viewer Control to the file MainPage.xaml.cs of the common project (XamarinDocumentViewer). Note that the code snippet shows the entire MainPage class constructor.
public MainPage() typeof(MainPage)).Assembly; // add the viewer to the layout
|
5 |
Add a sample document to the common project and set it up as an embedded resource.
|
6 |
Build the project and run it on an emulator.
|