• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 681
  • 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

0
khamouda
Asked:
khamouda
  • 2
  • 2
2 Solutions
 
jimmackCommented:
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.
0
 
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 ?

thanks
0
 
OBCTCommented:
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 ;-)
0
 
khamoudaAuthor Commented:

I think jim will not agree with you ;)
0
 
jimmackCommented:
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 ;-)
0
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

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

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