Rank 2: Process
I have tried the approach below to automatically login current User.
But onDestroy, User still has to login
public class LoginActivity extends AppCompatActivity { private Client client; private Account account;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
client = new Client(); client.setEndpoint("https://[HOSTNAME_OR_IP]/v1"); client.setProject("[PROJECT_ID]"); client.setKey("[API_KEY]");
account = new Account(client); }
@Override protected void onResume() { super.onResume();
try { account.get(new CoroutineCallback<>( (result, error) -> { if (error != null) error.printStackTrace(); return; } )); // User is logged in } catch (AppwriteException e) { // User is not logged in } }}