views:

42

answers:

1

Is it safe to implement a MIDlet class as a singleton? That is, after all, the Display class is acting like a singleton for each and every midlet so is the midlet itself a singleton by behaviour so that implementing it as such wouldn't break something?

In other words, it is not possible to have two instances of an app running, is it? I mean, the AMS wouldn't allow it, would it?

Thanks!

+2  A: 

Normally Singleton classes have protected constructor, and this will cause a problem because the AMS needs the MIDlet class constructor to be public not protected nor private.

Mahdi Hijazi
Thanks! I know that. the question was not implementation, but behaviour. Thanks!
Albus Dumbledore