• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 679
  • Last Modified:

J2ME PushRegistry in WTK22

Hi dears,

I am trying to use the PushRegistry.registerAlarm method, using WTK22, should it be only in the destryApp() ? ;

any way, I put it in destroyApp() and the emulator asks me "is it OK to receive automatic updates"

when I press "yes", it doesn't do any thing, just hangs !!!, it seems a bug or something,

I tried with normal RUN and also OTA

Thanks for the help

  • 2
  • 2
2 Solutions
I haven't tried 2.2 for a couple of reasons.  Primarily, it's only beta and it only works on Windows (and I do my development on Linux ;-))

It could be that it's a beta issue, I recall seeing something similar when requesting network connections in the 2.0 (or 2.1?) emulator.

This is another one of the many reasons that I do my testing on real devices.  The emulators are OK for basic functionality, but there are so many bugs/defects/"features" on the real handsets that it's the only reliable way to test.
khamoudaAuthor Commented:
Yes you are write, but I don't have midp 2 device, emulators bugs are many, and it exhausts the RAM also !

even wtk21 has a problem when OTA it doesn't complete the downloading , it just hangs ?!

for push registry, do I have to put the registerAlarm in the destroyApp() abstract ?

It doesn't say anything in the documentation about needing to use this method in destroyApp.
It would probably be a better idea to do this when the application starts rather than when it's about to exit.
The destroyApp method should be used to cleanup the MIDlets resources.

Try calling registerAlarm in the abstract method 'startApp' or at least not as the application is not being destroyed.

Just wait for Jimmack to confirm this incase I'm incorrect ;-)
khamoudaAuthor Commented:

I think jim will not agree with you ;)
I don't think it really matters where you set up the alarm.  destroyApp() may be a good place to do this, since you know that it's the last thing that will be executed before the application is terminated.

It may also depend on whether you want to use the return result from registerAlarm().  This information *may* be more useful during startApp() - just a thought ;-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now