寻找 Android Gmail SMTP Oauth 示例
为什么很难找到使用 Oauth 和 Google Mail 发送电子邮件的 Android 示例?
我是 Java 和 Android 新手,很难解决这个问题。有可能吗?
我找到了这个 用于 Android 开发的 Gmail(或 POP3)库
指向此链接 http://code.google.com/apis/gmail/oauth /code.html
但在任何地方都找不到有效的 Android 示例。
我希望这是可能的。我有一个应用程序使用此代码从用户 Gmail 帐户发送电子邮件
http://www .jondev.net/articles/Sending_Emails_without_User_Intervention_(no_Intents)_in_Android
但我的用户不喜欢在我的应用中输入他们的 Google 密码。我不怪他们。在当今时代,您可能会认为有一个简单的解决方案,其中包含许多示例。
那么,是否有一些例子,而我只是想念它们?
TIA
Why is it so hard to find an Android example of sending email using Oauth and Google Mail?
I am new to Java and Android and am having a hard time working this out. It is possible?
I have found this Gmail (or POP3) library for Android development
Which links to this http://code.google.com/apis/gmail/oauth/code.html
But no working Android examples to be found anywhere.
I would this this is possible. I have an app that sends email from the users Gmail account using this code
http://www.jondev.net/articles/Sending_Emails_without_User_Intervention_(no_Intents)_in_Android
But my users do not like to enter their Google password in my app. And I don't blame them. In this day and age you would think that there would be an easy solution with many examples.
So, are there examples out there and I am just missing them?
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
XOAUTH 和 Android 源代码:
实现 SMTP 或IMAP XOAuth
HTH
XOAUTH and Android with source code:
Implementing SMTP or IMAP XOAuth
HTH
我实际上问过另一个问题中是否有“生产质量”OAuth 实现:
有适用于 Android 的生产质量 OAuth 示例吗?
看起来我链接到的那个示例是最好的。我最终不得不对其进行一些调整,以使其真正按预期工作(例如,让后退按钮按预期工作)。到目前为止,我能够挖掘到的最佳技术是将启动 OAuth 活动的活动设置为 singleTask,并且当您从 OAuth 活动交换回它时,在意图中设置 FLAG_ACTIVITY_CLEAR_TOP 标志。
I actually asked if there was a "production quality" OAuth implementation around in another question:
Is there a production quality OAuth sample for Android?
Looks like that example I linked to is the best that's floating around. I've ended up having to tweek it a bit to make it really work as expected (have the back button work as expected for example). The best technique I've been able to dig up so far is to have the activity which launches the OAuth activity set as singleTask, and when you swap back to it from the OAuth activity set the FLAG_ACTIVITY_CLEAR_TOP flag in the intent.