roamcel
roamcel

Reputation: 645

J2ME system notification / play sound when phone is locked

Good day all,

I have a java based phone (samsung star 2 5260) and it's three weeks that I'm trying to come up with a solution to receive notification on received emails. The phone configures a periodic check for a minimum of 30 minutes, but I need a much more frequent control (five minutes maximum).

I have tried countless solutions, and I've come up with the closest one, being a custom mujmail midlet that supports my gmail mailbox over imap, deployed thanks to the netbeans editor. Point is, I've modified mujmail's polling to run on the background, but audio does not play when the phone is locked, so even if the midlet checks and receives emails, it's unable to notify me. The application minimizes and keeps on running, but it's unable to tell me that new mail has arrived.

I've even tried sending an sms when there's new mail, but was unable to sign the application (looks like ktoolbar produces 1024 bit certificates, and thawte, verisign, etc. will only produce 2048 bit certs since a few years.), and so it'll always ask authorization, which renders this approach useless.

So I'm desperate to find an alternative.

And I was hoping that we can in some way emulate the 'system alert' that the phone uses when it's locked and you receive an sms (audio cue). Is this a j2me functionality, or is it specific to the samsung sdk? Does anybody have an idea of how to access this functionality from inside a midlet? Is there a way to create a midlet in the trusted third party domain without signing it?

I know j2me is an old subject, but hopefully someone here is still knowledgeable about it.

Thanks in advance.

Upvotes: 0

Views: 127

Answers (1)

mr_lou
mr_lou

Reputation: 1920

Looks like you're expecting too much from JavaME.

If it's possible to do what you want, you can be certain that it requires signing. Basically you have to sign your MIDlet with a certificate that is supported on your phone. Most developers go for Thawte or Verisign, because their certificates are supported on the most devices.

If you're only interested in getting this to run on your own phone, it's possible you can find a much cheaper provider, like e.g. Samsung themselves. But I admit I don't know.

In any case, there's no way around signing, when you want to do things like this with JavaME.

(Well.... there's a tiny slim chance that your phone lets you set permissions, like "Never ask" in the MIDlet properties on the phone after installation, but only a tiny slim chance).

Even after signing your MIDlet, it still won't be able to wake up the phone. JavaME is a sandbox. If the user puts the phone to sleep, then JavaME can't wake it up. (At least not without special API's, which I don't think exists).

If it was me, I'd investigate this approach:

Implement PushRegistry timer to launch the MIDlet ever 5 minutes. This should theoretically launch the MIDlet despite the phone sleeping. (But not if it's turned off). Then attempt if you can play an alarm sound here. If you can't, then I'd look into sending an SMS to myself.

Upvotes: 1

Related Questions