Sean W.
Sean W.

Reputation: 5132

Configure exchange email account via Android API

I'd like to write an application that, given a username and password, will (among other things) configure an exchange email email account on the device. Is it possible to do via the Android API? If so, via what class?

Upvotes: 0

Views: 1754

Answers (1)

Avinash
Avinash

Reputation: 879

In the versions prior to 3.0 there is a way to configure exchange email by passing in the UserName and Password as extras.

ComponentName cname = new ComponentName("com.android.email", "com.android.email.activity.setup.AccountSetupBasics");
            Intent intent = new Intent("android.intent.action.MAIN");
            intent.putExtra("com.android.email.AccountSetupBasics.username", emailAddress);
            intent.putExtra("com.android.email.AccountSetupBasics.password", config.password);
            intent.putExtra("com.android.email.extra.eas_flow", true);
            intent.setComponent(cname);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(intent);

Upvotes: 3

Related Questions