本文介绍了我怎样才能拿到手机的用户的名字(或全名)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一种方法来获取用户的名字或完整的名字吗?我指的是手机的用户
Is there a way to get the user's first name or entire name? I mean the user of the phone
它需要特殊表现的权限?
does it require special manifest permissions?
推荐答案
究竟你是什么意思?你可能能够访问在某些方面的名称:
What exactly do you mean? You may be able to access the name in certain ways:
- 您可以尝试访问存储在一个谷歌帐户的信息,要求
GET_ACCOUNTS
许可 - 您可以作为Vinayak.B建议,尽量搜集从联系人的信息,要求
READ_CONTACTS
和READ_PHONE_STATE
的权限,但我认为这是一击或错过的选择。 - 还有一个
READ_PROFILE
许可,我认为这是一个有趣的路要走,但我没有与任何经验,所以我不能告诉你是否是一个卓有成效的企业。
- You can try to access their information stored in a Google account, requiring the
GET_ACCOUNTS
permission - You could, as Vinayak.B suggested, try to glean the info from the contacts, requiring the
READ_CONTACTS
and theREAD_PHONE_STATE
permission, although I think this is a hit-or-miss option. - There is also a
READ_PROFILE
permission, which I think is an interesting way to go, but I don't have any experience with that, so I can't tell you whether or not it's a fruitful venture.
我会先试试 GET_ACCOUNTS
选项,因为它们必须拥有一个谷歌帐户来下载你的应用程序。它也似乎有点不太侵入我
I would try the GET_ACCOUNTS
option first, since they must have a Google account to download your app. It also seems a little less invasive to me
我真的希望这回答你的问题,但如果没有,你真的需要提供更多的信息。
I really hope this answers your question, but if it doesn't, you really need to provide more information.
这篇关于我怎样才能拿到手机的用户的名字(或全名)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!