Create Email account from type existing Account Services

泄露秘密 提交于 2019-12-09 05:02:32

问题


I have gone through SampleSyncAdapter sample project provided by Android doc, but as I understand, there we need to add an account of custom Account service. But my need is to create an email account from existing account services on device.


To be more clear about my question, I am giving an example

Here are the Account services available on my Device

and I guess 'Google' and 'Email' account services are available on each Android device.

Now I want to configure an 'Email' account, so I must follow these below steps:

Step 1: Enter existing email id and password

Step 2: [a] General Settings Attributes : - (Account name, Real Name, Email Address)

Step 2: [b] Incoming server Attributes : - (POP or IMAP mail server, Server Address, user name, password)

Step 2: [c] Outgoing server Attributes : - (SMTP server, user name, password)

Step 3: By choosing Advanced settings, we can configure port and certificate options.

And we need to go through the above steps manually, but I want to create an Email account programmatically by using all above settings.


So how can I create new email account from existing Account Services progrmatically? I need this functionality for MDM.


回答1:


You are not allowed to do this for security reasons.

Imagine accounts being configured with settings that are unknown to the users - the users might not even know the accounts are being created at all! This would be a prime target point for malware, spam etc since no captcha, user permission or any other authentication is involved.

So this is a security measure....and a good one at that.



来源:https://stackoverflow.com/questions/11560247/create-email-account-from-type-existing-account-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!