Some test text!
Xamarin / Guides / Setup (Android)
Platform
Documentation
You can setup realtime collaboration functionality using the collaboration package with the Apryse SDK.
To compile for Java 8, add the following to your application's .csproj
file:
Visual Studio 2019 is required
<PropertyGroup>
<AndroidEnableDesugar>true</AndroidEnableDesugar>
<AndroidDexTool>d8</AndroidDexTool>
</PropertyGroup>
Insall:
Update your AndroidManifest.xml
as described in Step 1 of this guide .
Create the CollabViewerTabHostFragment2
, and start it like any other Android Fragment.
private void addViewerFragment(AppCompatActivity activity, Android.Net.Uri fileUri)
{
// Create a custom ViewerConfig used to initialize the viewer fragment
var viewerConfig = new ViewerConfig.Builder()
.MultiTabEnabled(false)
.OpenUrlCachePath(this.CacheDir.AbsolutePath)
.Build();
// Create the Fragment using CollabViewerBuilder2
var tabHostFragment = (CollabViewerTabHostFragment2)CollabViewerBuilder2
.WithUri(fileUri)
.UsingConfig(viewerConfig)
.Build(this);
// Add the Fragment to your activity
var ft = activity.SupportFragmentManager.BeginTransaction();
ft.Replace(Resource.Id.fragment_container, tabHostFragment, null);
ft.Commit();
}
where R.id.fragment_container
is the resource id of a layout in your activity that will contain your fragment:
For example:
<?xml version="1.0" encoding="utf-8"?>
<!-- This FrameLayout will contain our viewer fragment -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Get the answers you need: Support