Nokia forum:How do I retrieve the phone number from my midlet?

Q: How do I retrieve the phone number from my midlet?

Forum Nokia Expert:
Re: FAQ (General issues) for Java discussion boards - read this before posting - 2007-02-06, 16:16

You would have to use the JSR 253 - Mobile Telephony API which allows you to have a fairly good set of call-related funcionality, so it's possible that this API will also provide a way to let you know what's your phones's number. No Nokia devices currently support JSR 253.

There are some possible workarounds:

  1. When the user first downloads the application, have a server-side app such as a Java servlet or PHP script that retrieves the phone number from the HTTP header, and set it as a property in a dynamically-generated JAD file. This way, when your midlet is running, it can check the phone number using getAppProperty() method from MIDlet class. This approach will only work if the device is accessing the server-side application using a WAP access point, however. This happens because in this type of access point, an HTTP header containing the MSISDN (phone number) is added to the HTTP request that will be forwarded to your application, so you can retrieve it.
  2. If the target handset supports the Wireless Messaging API, you can have your application register an SMS connection, using PushRegistry, with a non-standard port. When the user first starts the application, generate some random data and send it to the phone number the user will input on a text field. If the phone number is correct, than you’ll receive the message in a few seconds on the connection you've registered. You can then check the data to see if it matches the data you generated earlier, and if it does, get the sender phone number using
    Code:
    Message.getAddress()
    method and save it to RMS. Note that the default security setting for Wireless Messaging API is "Ask Always", so this will cause security prompts if the midlet is not signed and/or the application security settings are not configured correctly.
  3. If you are using an S60 device, you can write a Symbian C++ application that retrieves the phone number and opens a server socket on 127.0.0.1. The midlet then connects to this localhost socket and retrieves that information. There are some drawbacks to this approach: Your C++ application has to be started on boot, the method used to retrieve the phone number is not portable (if you’re getting only the IMEI code, not the phone number, then it's portable); third, it depends on a C++ application, which greatly increases complexity by itself. There's a project called [URL ="http://www.midpjni.com/"]MIDP JNI[/url] that uses this "bridge" approach to bring native functionality to midlets, so you can retrieve information that otherwise would be only available to C++ applications, such as network and device properties.

 

我就简单的说下原文的意思吧,不想看英文的朋友参考一下:

解决方法有:

1.jsr 253。可以通过此jsr,获取与手机电话有关的信息,但nokia还没有任何一款手机支持此扩展包(截至2007-02-06, 16:16 )。

2.截取http报头。这种方法在前两年(05年左右),仍是可行的,但移动后来更改了报文结构,屏蔽了手机号字段。(它要拿手机号来卖钱,凡是跟手机号挂钩的,必须要跟它合作,也就是给钱他)

3.通过我们被安装的软件,发送短信到指定地址(本机到它机,本机到本机),在收到短信的平台,可以通过message的功能函数,来获取发送此短信的手机号码。(参考jsr 205规范,里面有短信的发送和截获)

4.对于symbian程序员,有其他方法。(不在本文讨论之内,这里是j2me板块)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
根据引用\[1\]中的信息,报错信息是"Failed to deploy 'XXX Dockerfile: XX/XXX/docker/Dockerfile': Can't retrieve image ID from build stream"。这个错误通常是由于无法从构建流中获取镜像ID引起的。根据引用\[2\]中的信息,可以尝试在k8s节点上安装Docker,如果节点主机上已经安装了Docker,则需要先卸载并重新安装。可以使用以下命令卸载Docker及其依赖包: ``` yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine ``` 然后,使用以下命令安装Docker: ``` yum install epel-release -y ``` 根据引用\[3\]中的信息,可以使用离线方式安装Docker仓库。首先,将Docker相关文件复制到/usr/bin/目录下: ``` cp docker/* /usr/bin/ ``` 然后,创建Docker服务配置文件: ``` cat>/usr/lib/systemd/system/docker.service<<EOF \[Unit\] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network-online.target firewalld.service Wants=network-online.target \[Service\] Type=notify ExecStart=/usr/bin/dockerd --data-root /data/docker ExecReload=/bin/kill -s HUP $MAINPID LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity TimeoutStartSec=0 Delegate=yes KillMode=process Restart=on-failure StartLimitBurst=3 StartLimitInterval=60s \[Install\] WantedBy=multi-user.target EOF ``` 最后,重新启动Docker服务: ``` systemctl daemon-reload systemctl restart docker ``` 这样应该能够解决报错问题。如果问题仍然存在,请提供更多详细的错误信息以便进一步排查。 #### 引用[.reference_title] - *1* [微服务模块部署到Docker](https://blog.csdn.net/weixin_44318522/article/details/123520154)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [RKE部署Rancher v2.5.8 HA高可用集群 以及常见错误解决](https://blog.csdn.net/Michaelwubo/article/details/124489478)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值