protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); fpm = FingerprintManagerCompat.From(this); cancel = new Android.Support.V4.OS.CancellationSignal(); sharedPreferences = Application.Context.GetSharedPreferences("UserInfo", FileCreationMode.Private); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_main); etEmail = FindViewById <EditText>(Resource.Id.etEmail); etPassword = FindViewById <EditText>(Resource.Id.etPassword); btnSignIn = FindViewById <Button>(Resource.Id.btnSignIn); btnSignUp = FindViewById <Button>(Resource.Id.btnSignUp); btnSignIn.Click += BtnSignIn_Click; btnSignUp.Click += BtnSignUp_Click; string Email = Intent.GetStringExtra("email"); etEmail.Text = Email; string Password = Intent.GetStringExtra("password"); etPassword.Text = Password; if (!string.IsNullOrEmpty(Intent?.Data?.LastPathSegment)) { if (Intent.Data.LastPathSegment == "SignUp") { var intent = new Intent(this, typeof(SignUpActivity)); StartActivity(intent); } } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); _fingerprintManagerCompat = FingerprintManagerCompat.From(this); _cancelation = new global::Android.Support.V4.OS.CancellationSignal(); _sharedPreferences = PreferenceManager.GetDefaultSharedPreferences(this); //TODO rest shared Preferences: Application.Context.GetSharedPreferences("sampleSharedPreferencesName",FileCreationMode.Private); SetContentView(Resource.Layout.Main); _emailEditText = FindViewById <EditText>(Resource.Id.emailEditText); _passwordEditText = FindViewById <EditText>(Resource.Id.passwordEditText); _signinButton = FindViewById <Button>(Resource.Id.signinButton); _registerButton = FindViewById <Button>(Resource.Id.registerButton); _signinButton.Click += SignInButton_Click; _registerButton.Click += RegisterButton_Click; //Register from Shortcut options if (!string.IsNullOrEmpty(Intent?.Data?.LastPathSegment)) { if (Intent.Data.LastPathSegment == "register") { StartActivity(typeof(RegisterActivity)); } } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); _fingerprintManager = FingerprintManagerCompat.From(this); _cancellationSignal = new global::Android.Support.V4.OS.CancellationSignal(); _preferences = Application.Context.GetSharedPreferences("UserInfo", FileCreationMode.Private); _emailEditText = FindViewById <EditText>(Resource.Id.emailEditText); _passwordEditText = FindViewById <EditText>(Resource.Id.passwordEditText); _loginButton = FindViewById <Button>(Resource.Id.loginButton); _registerButton = FindViewById <Button>(Resource.Id.registerButton); _loginButton.Click += LoginButton_Click; _registerButton.Click += RegisterButton_Click; if (string.IsNullOrEmpty(Intent?.Data?.LastPathSegment)) { return; } if (Intent.Data.LastPathSegment == "register") { StartActivity(typeof(RegisterActivity)); } }
private void LogUserIn() { _cancelation = new global::Android.Support.V4.OS.CancellationSignal(); FingerprintManagerCompat.AuthenticationCallback authenticationCallback = new AuthenticationCallback(this, _userId); Toast.MakeText(this, "Place fingerprint on sensor", ToastLength.Long).Show(); _fingerprintManagerCompat.Authenticate(null, 0, _cancelation, authenticationCallback, null); }
private void UserFPMLogin() { var cancel = new global::Android.Support.V4.OS.CancellationSignal(); FingerprintManagerCompat.AuthenticationCallback authentication = new AuthenticationCallback(this, UserId); Toast.MakeText(this, "Place fingerprint on sensor", ToastLength.Long).Show(); fpm.Authenticate(null, 0, cancel, authentication, null); }