[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

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