Package Com.example.testhockeyapp;
Import Net.hockeyapp.android.CrashManager;
Import Net.hockeyapp.android.CrashManagerListener;
Import Net.hockeyapp.android.UpdateManager;
Import Android.os.Bundle;
Import android.app.Activity;
Import Android.view.Menu;
Import Android.view.View;
Import Android.view.View.OnClickListener;
Import Android.widget.Button;
Import Android.widget.Toast;
public class Mainactivity extends activity {
private static final String app_id = "A7ab0fe5f11edc8afbfbc842ecc38ad7";
String a = null;
@Override
protected void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (R.layout.activity_main);
Button button = (button) Findviewbyid (R.id.button1);
Button.setonclicklistener (New Onclicklistener () {
@Override
public void OnClick (View v) {
A.charat (23);
}
});
Checkforupdates ();
}
@Override
public boolean Oncreateoptionsmenu (Menu menu) {
Inflate the menu; This adds items to the action bar if it is present.
Getmenuinflater (). Inflate (R.menu.main, menu);
return true;
}
@Override
protected void Onresume () {
TODO auto-generated Method Stub
Super.onresume ();
Checkforcrashes ();
}
private void Checkforcrashes () {
Crashmanager.register (This, app_id, new Crashmanagerlistener () {
@Override
public void Oncrashessent () {
Super.oncrashessent ();
Runonuithread (New Runnable () {
@Override
public void Run () {
Toast.maketext (Getapplicationcontext (),
"Crash data was sent. Thanks! ",
Toast.length_long). Show ();
}
});
}
@Override
public void Oncrashesnotsent () {
Super.oncrashesnotsent ();
Runonuithread (New Runnable () {
@Override
public void Run () {
Toast.maketext (
Getapplicationcontext (),
"Crash data failed to sent. Please try again later. ",
Toast.length_long). Show ();
}
});
}
});
}
private void Checkforupdates () {
Remove this for store builds!
Updatemanager.register (this, app_id);
}
}