入门安卓所有者的电子邮件地址,很好

编程入门 行业动态 更新时间:2024-10-18 18:19:23
本文介绍了入门安卓所有者的电子邮件地址,很好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想允许用户向我提供他们的电子邮件地址,而无需键入它。理想情况下,会是一个文本字段,用户既可以键入电子邮件地址,或按下按钮,自动填充。

I want to allow the user to provide me their email address without typing it in. Ideally, there'd be a text field where the user could either type an email address or push a button to autofill it.

在前面一个问题,Roman Nurik建议使用一个的AccountManager 来处理这个问题,但这需要我的应用程序使用GET_ACCOUNTS权限;我的应用程序便可以访问所有的用户帐户的设备,包括他们的Facebook / Twitter账户上。该权限似乎太宽泛了我想要的。

In an earlier question, Roman Nurik suggests using an AccountManager to handle this, but that requires my app to use the GET_ACCOUNTS privilege; my app could then access all of the user's accounts on the device, including their Facebook/Twitter accounts. That permission seems way too broad for what I want.

有没有一种更好的方式来处理这种不需要给予我的应用程序,例如重型许可?

Is there a nicer way to handle this that doesn't require granting my app such a heavy duty permission?

推荐答案

事实上,不仅你不能做到这一点没有GET_ACCOUNTS,你想要的信息只存在于用户的(谷歌)帐户数据。

Indeed, not only can't you do this without GET_ACCOUNTS, the information you want only exists in the user's (Google) account data.

在我的Sprint手机,所有者地址冲刺分配是 myusername@sprintpcs ,并且可以使用被看作 getprop 从shell。但是,这不是我的主电子邮件地址,甚至是一个我曾经使用/检查。你的需要的是我的Gmail地址,并储存在Android的帐户数据。

On my Sprint phone, the 'owner' address sprint assigns is myusername@sprintpcs, and that can be seen using getprop from a shell. But that's not my primary email address, or even one I ever use/check. What you want is my gmail address, and that's stored in the Android account data.

其实,你想的的两个中的一个的 - 这是你需要GET_ACCOUNTS另一个原因。如果你要问我的电子邮件地址,你需要让我中选出两个@ gmail占我已经在设备上配置。 我知道哪一个是我的'preferred'一(但即使这样的语境),但AFAIK没有被认为是由系统更主要或默认比其他。

Actually, you want one of the two — which is another reason you need GET_ACCOUNTS. If you're going to ask for my email address, you need to let me select among the two @gmail accounts I have configured on the device. I know which one is my 'preferred' one (although even that's contextual), but AFAIK neither is considered by the system to be more 'primary' or 'default' than the other.

更多推荐

入门安卓所有者的电子邮件地址,很好

本文发布于:2023-06-08 21:30:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/589391.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:很好   所有者   电子邮件地址   入门

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!