/// <summary> /// Initalize the hockey application crashes tracing /// </summary> public void InitHockeyInsights() { //instantiate the hockey application for crashes reporting CrashManager.Register(this, _hockeyAppId); MetricsManager.Register(this, this, _hockeyAppId); MetricsManager.EnableUserMetrics(); //metrics for user activities }
public void Init() { #if !DEBUG CrashManager.Register(_context, Secrets.AndroidHockeyId, new HockeyListener()); MetricsManager.Register(_app, Secrets.AndroidHockeyId); MetricsManager.EnableUserMetrics(); #endif }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // To learn more about HockeyApp integration on Xamarin.Android, read // https://support.hockeyapp.net/kb/client-integration-cross-platform/how-to-integrate-hockeyapp-with-xamarin CrashManager.Register(this, Settings.HockeyAppId); MetricsManager.Register(Application, Settings.HockeyAppId); MetricsManager.EnableUserMetrics(); Forms.Init(this, bundle); LoadApplication(new App()); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); CrashManager.Register(this, UserSettings.HockeyAppId); MetricsManager.Register(Application, UserSettings.HockeyAppId); MetricsManager.EnableUserMetrics(); global::Xamarin.Forms.Forms.Init(this, bundle); App.Init(this); LoadApplication(new PITCSurveyApp.App()); }
protected override void OnCreate(Bundle bundle) { FormsAppCompatActivity.ToolbarResource = Resource.Layout.toolbar; base.OnCreate(bundle); this.Window.AddFlags(WindowManagerFlags.Fullscreen); global::Xamarin.Forms.Forms.Init(this, bundle); Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init(); App.UIContext = this; LoadApplication(new ContosoInsurance.App()); instance = this; Toolbar toolbar = (Toolbar)FindViewById(ContosoInsurance.Droid.Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); toolbar.SetNavigationIcon(ContosoInsurance.Droid.Resource.Drawable.navmenu); //toolbar.SetLogo(ContosoInsurance.Droid.Resource.Drawable.navmenu); try { // Register the crash manager before Initializing the trace writer CrashManager.Register(this, HOCKEYAPP_APPID); //Register to with the Update Manager //UpdateManager.Register(this, HOCKEYAPP_APPID); MetricsManager.Register(Application, HOCKEYAPP_APPID); MetricsManager.EnableUserMetrics(); } catch (Exception e) { CreateAndShowDialog(e.Message, "Error"); } try { // Check to ensure everything's setup right GcmClient.CheckDevice(this); GcmClient.CheckManifest(this); // Register for push notifications System.Diagnostics.Debug.WriteLine("Registering..."); GcmClient.Register(this, PushHandlerBroadcastReceiver.SENDER_IDS); } catch (Java.Net.MalformedURLException) { CreateAndShowDialog("There was an error creating the client. Verify the URL.", "Error"); } catch (Exception e) { CreateAndShowDialog(e.Message, "Error"); } }
protected override void OnCreate(Bundle bundle) { FormsAppCompatActivity.ToolbarResource = Resource.Layout.toolbar; base.OnCreate(bundle); Window.AddFlags(WindowManagerFlags.Fullscreen); this.Window.DecorView.SystemUiVisibility = StatusBarVisibility.Hidden; if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) { var statusBarHeightInfo = typeof(FormsAppCompatActivity).GetField("_statusBarHeight", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); statusBarHeightInfo.SetValue(this, 0); } global::Xamarin.Forms.Forms.Init(this, bundle); Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init(); App.UIContext = this; LoadApplication(new App()); instance = this; Toolbar toolbar = (Toolbar)FindViewById(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); toolbar.SetNavigationIcon(Resource.Drawable.navmenu); try { // Register the crash manager before Initializing the trace writer CrashManager.Register(this, HOCKEYAPP_APPID); //Register to with the Update Manager //UpdateManager.Register(this, HOCKEYAPP_APPID); MetricsManager.Register(Application, HOCKEYAPP_APPID); MetricsManager.EnableUserMetrics(); } catch (Exception e) { CreateAndShowDialog(e.Message, "Error"); } try { // Check to ensure everything's setup right GcmClient.CheckDevice(this); GcmClient.CheckManifest(this); // Register for push notifications System.Diagnostics.Debug.WriteLine("Registering..."); GcmClient.Register(this, PushHandlerBroadcastReceiver.SENDER_IDS); } catch (Java.Net.MalformedURLException) { CreateAndShowDialog("There was an error creating the client. Verify the URL.", "Error"); } catch (Exception e) { CreateAndShowDialog(e.Message, "Error"); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); RequestWindowFeature(WindowFeatures.NoTitle); Window.AddFlags(WindowManagerFlags.KeepScreenOn); // Register the crash manager before Initializing the trace writer CrashManager.Register(this, Secret.HockeyappAppId); // Register to with the Update Manager UpdateManager.Register(this, Secret.HockeyappAppId); HockeyLog.LogLevel = 2; // Register user metics MetricsManager.Register(Application, Secret.HockeyappAppId); MetricsManager.EnableUserMetrics(); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); PharmacyTable = FindViewById <ListView>(Resource.Id.maPharmacyTable); View header = LayoutInflater.Inflate(Resource.Layout.PharmacyTableHeader, PharmacyTable, false); PharmacyTable.AddHeaderView(header); PharmacyTable.Clickable = true; PharmacyTable.ItemClick += OnListItemClick; var profile = FindViewById <ImageView>(Resource.Id.maProfile); profile.Click += (sender, e) => { StartActivity(new Intent(this, typeof(ProfileActivity))); }; var add = FindViewById <ImageView>(Resource.Id.maAdd); add.Click += (sender, e) => { StartActivity(new Intent(this, typeof(PharmacyActivity))); }; var sync = FindViewById <ImageView>(Resource.Id.maSync); sync.Click += (sender, e) => { StartActivity(new Intent(this, typeof(SyncActivity))); }; sync.LongClick += (sender, e) => { StartActivity(new Intent(this, typeof(LoadDataActivity))); }; var lib = FindViewById <ImageView>(Resource.Id.maLibrary); lib.Click += (sender, e) => { StartActivity(new Intent(this, typeof(LibraryActivity))); }; lib.LongClick += (sender, e) => { StartActivity(new Intent(this, typeof(TestDataActivity))); }; var route = FindViewById <ImageView>(Resource.Id.maRoute); route.Click += (sender, e) => { StartActivity(new Intent(this, typeof(RouteActivity))); }; var searchView = FindViewById <RelativeLayout>(Resource.Id.maSearchRL); searchView.Click += (sender, e) => { if (CurrentFocus != null) { var imm = (InputMethodManager)GetSystemService(InputMethodService); imm.HideSoftInputFromWindow(CurrentFocus.WindowToken, HideSoftInputFlags.None); } searchView.Visibility = ViewStates.Gone; }; var search = FindViewById <ImageView>(Resource.Id.maSearch); search.Click += (sender, e) => { searchView.Visibility = ViewStates.Visible; }; var searchSettings = FindViewById <ImageView>(Resource.Id.maSearchSettingsIV); searchSettings.Click += (sender, e) => { Toast.MakeText(this, "maSearchSettingsIV Clicked", ToastLength.Short).Show(); }; SearchInput = FindViewById <EditText>(Resource.Id.maSearchInput); SearchInput.AfterTextChanged += (sender, e) => { Search(e.Editable.ToString()); }; SearchTable = FindViewById <ListView>(Resource.Id.maSearchTable); SearchTable.ItemClick += (sender, e) => { if (sender is ListView) { var lv = ((ListView)sender); var cb = e.View.FindViewById <CheckBox>(Resource.Id.sriIsCheckedCB); cb.Checked = lv.IsItemChecked(e.Position); //e.View.Selected = lv.IsItemChecked(e.Position); //lv.SetItemChecked(e.Position, true); if (lv.Adapter is SearchResultAdapter) { var adapter = (SearchResultAdapter)lv.Adapter; var newList = new List <Pharmacy>(); var sparseArray = lv.CheckedItemPositions; for (var i = 0; i < sparseArray.Size(); i++) { if (sparseArray.ValueAt(i)) { newList.Add(MainDatabase.GetEntity <Pharmacy>(adapter[sparseArray.KeyAt(i)].UUID)); } } RecreateAdapter(newList); } } }; SearchTable.ItemSelected += (sender, e) => { if (sender is ListView) { var lv = ((ListView)sender); if (lv.Adapter is SearchResultAdapter) { var adapter = (SearchResultAdapter)lv.Adapter; var obj = adapter[(int)e.Id]; } } }; Filter = FindViewById <ImageView>(Resource.Id.maFilter); Filter.Click += Filter_Click; Filter.LongClick += (sender, e) => { var fragmentTransaction = FragmentManager.BeginTransaction(); var prev = FragmentManager.FindFragmentByTag(FilterDialog.TAG); if (prev != null) { fragmentTransaction.Remove(prev); } fragmentTransaction.AddToBackStack(null); var filterDialog = new FilterDialog(); filterDialog.Show(fragmentTransaction, FilterDialog.TAG); filterDialog.AfterSaved += (caller, arguments) => { GetSharedPreferences(FilterDialog.C_FILTER_PREFS, FileCreationMode.Private) .Edit() .PutBoolean("IS_ON", true) .Commit(); RecreateAdapter(); //Filter_Click(sender, e); }; }; var message = FindViewById <ImageView>(Resource.Id.maMessage); message.Click += (sender, e) => { var fragmentTransaction = FragmentManager.BeginTransaction(); var prev = FragmentManager.FindFragmentByTag(MessageDialog.TAG); if (prev != null) { fragmentTransaction.Remove(prev); } fragmentTransaction.AddToBackStack(null); var messageDialog = new MessageDialog(); messageDialog.Show(fragmentTransaction, MessageDialog.TAG); messageDialog.AfterSaved += (caller, arguments) => { Toast.MakeText(this, "Message saved", ToastLength.Short).Show(); }; }; message.LongClick += (sender, e) => { StartActivity(new Intent(this, typeof(MessageActivity))); }; FilterContent = FindViewById <TextView>(Resource.Id.maFilterTV); AttendanceCount = FindViewById <TextView>(Resource.Id.maAttendanceCountTV); //LoginManager.Register(this, Secret.HockeyappAppId, LoginManager.LoginModeEmailOnly); //LoginManager.VerifyLogin(this, Intent); UpdateManager.Register(this, Secret.HockeyappAppId); }