Create Email account from type existing Account Services

Viewed 1486

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 enter image description here

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 Answers
Related