Hi everyone,
I’m a new French student (in fact worker that try take over studies in programming) and I try to program my first mobile application.
I would like to connect this application to MongoDB and firstly use the login function through email/password authentification. Because it doesn’t work, I tried to use the anonymous authentification that doesn’t work too.
This is an Android app programmed by Android Studio in JAVA.
My code which is si:ply (took on Realm web site):
mLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View viewMain) {
App ClientApp = new App(new AppConfiguration.Builder(ClientAppId).build());Credentials credentials = Credentials.anonymous(); ClientApp.loginAsync(credentials, result -> { if (result.isSuccess()) { Log.v("QUICKSTART", "Successfully authenticated anonymously."); User user = ClientApp.currentUser(); // interact with realm using your user object here } else { Log.e("QUICKSTART", "Failed to log in. Error: " + result.getError()); } }); } });
If I use the degug mode, I can see that this line stop the login function.
ClientApp.loginAsync(credentials, result -> {
May somebody could help me and explain me what happen wrong ?
Thank you.