如何获得联系人姓名及其电话号码 [英] How can I get contact name with his/her number

查看:122
本文介绍了如何获得联系人姓名及其电话号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Android脚本和Python开发一个简单的应用程序.

I'm trying to develop a simple app using Android Scripting and Python.

现在,我有一个电话号码,我想找出哪个联系人有该号码.我可以执行contactsGet()并搜索数字,但是很多程序都使用该功能,我认为有一种更简单的方法.

Now, I have a phone number, and I want to find out which contact has that number. I can do a contactsGet() and search for numbers, but so many programs uses that feature that, I think there is an easier way for that.

有一个问题也有相同的问题,但是Java,是否有Python等效项? 通过电话号码搜索联系人

There is a question with same problem, but Java, is there a Python equivalent? Search contact by phone number

有一种简单的方法可以实现吗?

Is there a simple way to achieve that?

任何示例代码都会受到赞赏.

Any example code is appreciated.

编辑,几天没有答案后,我决定稍微改变一下问题:搜索数字以获取由contactGet()获得的列表的最佳方法是什么?

Edit, after a few days with no answer, I decided to change the question a little: What is the best way for search a number for a list which I got with contactsGet()?

推荐答案

这是抽象层的常见问题.该层没有抽象您想要使用的特定功能,工具或案例.但是,在这种情况下,似乎并没有失去所有希望.看来android脚本API是一个开源项目.为什么不贡献一个可以为项目提供此功能的补丁?

This is a common problem with layers of abstraction. The layer doesn't abstract a specific functionality, tool, or case you'd like to use. In this case, however, it appears that not all hope is lost. It appears that the android scripting api is an open-source project. Why not contribute a patch that would provide this ability to the project?

我可能会在将来的某个时候提供这样的补丁,但是如果对您很重要,您可以在我做之前做同样的事情,然后继续前进!

I may contribute such a patch at some point in the future, but if it's important to you, you could do the same before I do, and be on your way!

这篇关于如何获得联系人姓名及其电话号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆