检测移动设备中的掉线
我正在使用 Motorola 设备并使用 J2ME 开发它。我正在寻找一种功能来检测掉线时的来电或去电。 我的意思是,当电话挂断时,我需要识别此事件。
谢谢
I'm using Motorola device and developed it with J2ME . I'm searching for a functionality to detect incomming or outcomming calls when dropped .
I mean , when the call is dropped I need to recognize this event.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
没有标准的 J2ME 电话 API。
该特定手机上可能有一个可用的、基于 Java 的专有 API,但这不太可能且不明显需要验证。
There is no standard J2ME telephony API.
There could be a working proprietary java-based API on that particular handset but that's both unlikely and not obvious to verify.
您可以使用应用程序的生命周期来检测中断。您的设备可以检测电话呼叫何时打入和结束,并触发 shownotify()、hidenotify()、startApp()、pauseApp(),然后执行相应操作。请参阅 canvas 类。因此,如果您正在运行应用程序,您可以检测来电,等待其结束然后执行某些操作。这当然是特定于设备/制造商的,当涉及到将其移植到许多设备时,您会陷入困境。我不确定您是否可以对拨出电话执行类似的操作,因为您的应用程序将在后台运行并在大多数设备上暂停。
You could use the life-cycle of the application to detect interrupts. Your device can detect when a phone-call comes in and ends, and trigger shownotify(), hidenotify(), startApp(), pauseApp(), then do something accordingly. See the canvas class. So if you have an application running, you can detect an incoming phone-call, wait for it to end then do something. This is of course very device/manufacturer specific and you are in a world of hurt when it comes to porting this for many devices. I'm not sure if you can do something like this for outgoing calls, since your app will be in the background and paused for most devices.
您可以尝试检查摩托罗拉开发者网页。 Motorola 有自己的一套 j2me 库,它可能支持您需要的情况。
You could try checking the motorola developer webpage. Motorola has its own set of libraries for j2me, it may support the case you need.