Created
September 1, 2015 19:32
-
-
Save VidyasagarMSC/0534e0447b54686c0fbc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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("[email protected]") //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