这是可能的添加和programmaticaly配置Exchange帐户 [英] Is this possible to add and configure an exchange account programmaticaly

查看:238
本文介绍了这是可能的添加和programmaticaly配置Exchange帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android上,我们可以通过设置 - 手动添加帐户>帐户并。SYNC->添加问责>企业,然后我们满山遍野,并添加帐户

On android we can add an account manually through settings->Account&sync->add account->Corporate and then we fill the fields and add the account.

我想以编程方式做到这一点。我搜索互联网上,但没有找到任何办法做到这一点。

I want to do this programmatically. I searched on internet but did not find any way to do this.

我发现了两个职位(的http:// code.google.com / p /安卓/问题/细节?ID = 21233 与<一个href=\"http://stackoverflow.com/questions/4056043/android-how-to-add-configure-exchange-setting-programmatically\">Android如何添加/配置Exchange以编程方式设置?),之后,它看起来像,这是不可能的......但没有任何一个知道有什么办法做到这一点?

I found two posts ( http://code.google.com/p/android/issues/detail?id=21233 AND Android How to add/configure Exchange setting programmatically? ), after which it looks like that it is not possible...But does any one know any way to do this?

我们可以通过编程打开屏幕设置 - >帐户并SYNC->按意图Settings.ACTION_ADD_ACCOUNT添加帐户。我能以某种方式满山遍野呢?

We can programmatically open the screen settings->Account&sync->add account by intent Settings.ACTION_ADD_ACCOUNT. Can I somehow fill the fields too?

有没有打算这样做呢?或者,我可以用客户经理不知何故?

Is there any intent to do this? Or can I use account manager somehow?

推荐答案

我也太会遇到这样的问题,我所得到的唯一答案是否定的为Android 3.0及以上,并没有真正为2.3和更低。

I did too encounter this problem and the only answer I ever got is NO for Android 3.0 and above, and NOT REALLY for 2.3 and lower.


  • 有关平台2.3,并降低你可以调用的意图与外汇帐户创建屏参数,因此,所有字段将被填充。

  • For platform 2.3 and lower you can call intent with parameters for the Exchange account creation screen, so all fields will be filled.

//Gingerbread and lower
ComponentName localComponentName = new ComponentName("com.android.email", "com.android.email.activity.setup.AccountSetupBasics");
Intent exchangeIntent = new Intent("android.intent.action.MAIN");
exchangeIntent.putExtra("com.android.email.AccountSetupBasics.username", mUserName);
exchangeIntent.putExtra("com.android.email.AccountSetupBasics.password", mPassword);
exchangeIntent.putExtra("com.android.email.extra.eas_flow", true);
exchangeIntent.setComponent(localComponentName);
exchangeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

(这code是基于一个答案我在栈上交流发现,但我不能再次找到它以供参考)

您必须明白,这种解决方案并不适用于那些不具备默认的电子邮件客户端设备。

You must understand that this solution does not apply to devices that do not have the default eMail client.

我认为这个解决方案是一个黑客,而不是真正的解决办法,但是这是我心中已经找到。

I consider this solution as a hack and not a real solution but this is what i'v found.

从蜂巢及以后的外汇帐户创建画面被改变,它不会从意图得到这些参数的比较多,所以这种解决方案并不适用,我无法找到任何其他的方式来做到这一点。

From HoneyComb and onward the exchange account creation screen was changed and it does not get those parameters any more from the intent, so this solution does not apply and i could not found any other way to do it.

这是我还没有实现的另一个解决方案是使用第三方电子邮件客户端电源的需要API来创建它,删除或修改Exchange帐户

Another solution that i have not implemented is to use a 3rd party email client which supply's needed API to create, delete or modify an exchange account

希望我帮助

这篇关于这是可能的添加和programmaticaly配置Exchange帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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