通过Android的API配置Exchange电子邮件帐户 [英] Configure exchange email account via Android API

查看:877
本文介绍了通过Android的API配置Exchange电子邮件帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢写,给定一个用户名和密码的应用程序,将(除其他事项外),配置设备上的Exchange电子邮件的电子邮件帐户。是否有可能通过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?

推荐答案

在之前的版本3.0是有办法通过传递用户名和密码的额外配置Exchange电子邮件。

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);

这篇关于通过Android的API配置Exchange电子邮件帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆