获取 BlackBerry 设备电话号码

发布于 2024-10-06 06:38:48 字数 159 浏览 0 评论 0原文

在我的应用程序中,我想检索设备电话号码。我使用了 Phone.getDevicePhoneNumber(true)

它在模拟器中工作,但是当我在设备上测试时它返回一个空字符串。 还有其他方法可以获取设备电话号码吗?

我使用的是jde 4.5.0。

In my application I want to retrive the device phone number. I used Phone.getDevicePhoneNumber(true)

It is working in the simulator, but when I test on the device it returns an empty string.
Is there any other option for getting the device phone number?

I am using jde 4.5.0.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤凫 2024-10-13 06:38:48

最简单的方法是要求用户输入电话号码。

The straightforward approach would be to ask the user to enter their phone number.

少跟Wǒ拽 2024-10-13 06:38:48

Phone.getDevicePhoneNumber(true) 读取SIM卡中的号码。问题是号码并不总是在 SIM 卡上。我也遇到过 SIM 卡上的号码错误的情况。

没有保证以编程方式获取号码的方法。我过去所做的就是向用户提供 SIM 卡号,并要求他们更正/确认。

Phone.getDevicePhoneNumber(true) reads the number from the SIM card. The problem is the number isn't always on the SIM card. I've also seen cases where the wrong number is on the SIM card.

There is no guaranteed way to programmatically get the number. What I've done in the past is present the SIM card number to the user and asked them to correct/confirm it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文