34

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.

Anup Cowkur
  • 20,443
  • 6
  • 51
  • 84
Android Learner
  • 2,559
  • 6
  • 34
  • 43
  • 1
    If you found any solutions, Please share. It will help me. – Manoj Sep 20 '12 at 11:45
  • 1
    It seems not possible. You can check about K9. It is an open source project, and you can create any type of email account – Android Learner Sep 24 '12 at 14:10
  • thanks. I haved checked with K9. But it can configure already existing email account. But it is not possible to create(or Register) new email account in K9. – Manoj Sep 25 '12 at 04:38
  • 4
    Yes you are right... You can't do this. Reason is here http://stackoverflow.com/questions/3956050/create-gmail-facebook-and-twitter-account-through-api – Android Learner Sep 25 '12 at 05:12
  • Why don't you reuse the existing account? – rds Oct 29 '12 at 12:18
  • @rds Did you downvoted? First read what is the question, I clearly written I need to programatically create an account for existing Account Services, then what is the confusion? – Android Learner Nov 01 '12 at 07:30
  • @AndroidLearner No. What makes you think so? – rds Nov 01 '12 at 12:14

1 Answers1

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.

Anup Cowkur
  • 20,443
  • 6
  • 51
  • 84