Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android How to add/configure Exchange setting programmatically?

Is it me or I can't find any example of how to add/configure Microsoft Exchange programatically?

It seems like

AccountManager ::

addAccount (String accountType, String authTokenType, String[] requiredFeatures, Bundle addAccountOptions, Activity activity, AccountManagerCallback<Bundle> callback, Handler handler)

should do the work. However, I can't figure out how for Microsoft Exchange account. Could you point me to a simple working example code?

Thank you.

like image 661
jclova Avatar asked Apr 09 '26 02:04

jclova


1 Answers

Seems like it can't be done by applications.

you'll get the following exception:

ERROR/AndroidRuntime(442): Caused by: java.lang.SecurityException: caller uid xxxxx is different than the authenticator's uid

you'll get this exception because the account manager verifies that the application that wrote the exchange authenticator (Google) is the same one that is creating the account. here's a post that explains AccountManager's logic in that case.

like image 85
rony l Avatar answered Apr 10 '26 15:04

rony l



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!