Up

Integration for Xamarin

Requirements

For iOS support: requires iOS 6.0 or later.

For Android support: requires android 2.2 or later.

  1. Add UbertestersSDK component with Xamarin Studio

    • Open your project with Xamarin Studio and double click the Components folder

    • Press Get more components button

    • Enter UbertestersSDK in a search filed and click the Ubertesters component

    • Press Add to app button

    • Now the UbertestersSDK component is added to your Xamarin Studio

  2. Add Ubertesters organization token to your project:

  3. Android integration

    • Edit “AndroidManifest.xml” file of your project:

      <application>
          //...
          <meta-data android:name="ubertesters_organization_token" android:value="your organization token"/>
          //...
      </application>
    • Add Permissions into <manifest> tag:

      <?xml version="1.0" encoding="utf-8"?>
      <manifest xmlns:android="http://schemas.android.com/apk/res/android"
                package="your package"
                android:versionCode="1"
                android:versionName="1.0">
      
          // ...
          <!-- Ubertesters library user-permisions -->
          <uses-permission android:name="android.permission.GET_TASKS" />
          <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
          <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
          <!-- Ubertesters library user-permisions -->
          //...
      
      </manifest>
    • Open “AppDelegate.cs” file. Add using “XUbertestersSDK” namespace:

      using XUbertestersSDK;
    • Open your application class and override OnCreate function. Initialize UbertestersSDK and add crash handler in “AppDelegate.cs”:

      public class DemoApp : Application
      {
      public DemoApp(IntPtr handle, JniHandleOwnership transfer)
      : base(handle,transfer)
          {
          }
      
          public override void OnCreate ()
          {
          base.OnCreate ();
          XUbertesters.Initialize (this); // Call initialize to run ubertesters
          AndroidEnvironment.UnhandledExceptionRaiser += OnException; // subscribe on unhandled exceptions
          }
      
          private static void OnException(object sender, RaiseThrowableEventArgs e)
          {
              XUbertesters.SendException(e);
          }
      }
      If you don’t have application class, add new class to your project and inherit Application class. You have to add attribute [Application()] and remove application initialization from file Properties/ApplicationInfo.cs:
      [assembly: Application (Label = "Demo app", Icon = "@drawable/icon")]
  4. iOS integration

    • Edit info.plist of your project and paste organization token with “ubertesters_organization_token” key

    • Open “AppDelegate.cs” file. Add using “XUbertestersSDK” namespace:

      using XUbertestersSDK;
    • Override UIApplication Delegate’s method “FinishedLaunching” (if it isn’t already exist).

    • Copy following code to the FinishedLaunching body next lines:

      XUbertesters.Initialize ();
      
       AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) => {
      
       XUbertesters.SendCrash(e);
      
       };