开发者

How to handle external and internal event in j2me

i am developing game in j2me. In that i ha开发者_StackOverflowve to handle external and internal event.. I studied in some of websites that we can handle the event with the help of hidenotify() and shownotify().

But it dont know where to use these two methods? whether in hidenotify() in pauseApp() and shownotify() in startApp() or somewhere else..

Please anyone give me a clear idea about handling the event in mobile.


In J2ME world, external events resemble the following:

  1. In coming SMS message. This is used trigger application specific action caused by a message sent from a pre-defined and well known sender. This feature is known as "push".
  2. Media card inserted and the application needs to recognize it and act upon it.
  3. If the phone is NFC enabled, launching an application when the phone is taken to a card reader.
  4. When a server is attempting to connect to the phone, launch the application and perform some specific action. This requires that phone is addressable on network; very few of them support it.
  5. Launching the application at a specific time.

I hope you get the idea. Most of the above are achieved by making use Push Registry.

The events that you are talking about are the callbacks to application that AMS (Application Management Software) notifies before the component is being shown and before the component is being hidden.

And pauseApp will be called by AMS when the application is about to be paused; this typically happens when there is an incoming phone call, or the flip is closed (on a flip phone) etc.

Hope it answers your question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜