0

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.

roamcel
  • 645
  • 1
  • 8
  • 17

1 Answers1

1

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.

mr_lou
  • 1,910
  • 2
  • 14
  • 26
  • PushRegistry. Looks like a good idea, thanks for the heads up. I'll check it out. – roamcel Oct 20 '14 at 06:09
  • Even with a stupid midlet that only plays a sound every 30 seconds, pushregistry is unable to perform the task while the phone is locked :(. Unsure about what to do next. – roamcel Oct 26 '14 at 06:16
  • I suspect it's device dependent. Another phone will probably give you a different result, i.e. it will play the sound despite the device being locked. But since it won't work on your Samsung device, I guess you have to either switch to another technology then, or else, if you want to stick with JavaME, then you have to sign your MIDlet, and then use the send-SMS-to-yourself approach instead. – mr_lou Oct 26 '14 at 07:41