Skip to content

Instantly share code, notes, and snippets.

@VidyasagarMSC
Created September 1, 2015 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VidyasagarMSC/0534e0447b54686c0fbc to your computer and use it in GitHub Desktop.
Save VidyasagarMSC/0534e0447b54686c0fbc to your computer and use it in GitHub Desktop.
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
//MQA references
using Com.Ibm.Mqa.Config;
using Com.Ibm.Mqa;
namespace Count.Android
{
[Activity (Label = "Count.Android", MainLauncher = true, Icon = "@drawable/icon")]
public class MainActivity : Activity
{
int count = 1;
//Use your own generated APP KEY
const string APP_KEY="1g59b7d884f9fdf5426162e5cb1f87a700648bce4fg0g1g379e0d3a";
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
//MQA Android session configuration
Configuration configuration = new Configuration.Builder(this)
.WithAPIKey(APP_KEY) //Provides the quality assurance application APP_KEY
.WithMode(MQA.Mode.Qa) //Selects the quality assurance application mode
.WithReportOnShakeEnabled(true) //Enables shake report trigger
.WithDefaultUser("default_user@email.com") //Sets a default user and user selection
.Build();
//Starting MQA Android Session
MQA.StartNewSession (this, configuration);
// Set our view from the "main" layout resource
SetContentView (Resource.Layout.Main);
// Get our button from the layout resource,
// and attach an event to it
Button button = FindViewById<Button> (Resource.Id.myButton);
button.Click += delegate {
button.Text = string.Format ("{0} clicks!", count++);
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment