0

I need to write a mobile application (midlet) that will run on Nokia 6600 (SDK 60 2nd Edition CW). the application's goal is to detect power interruptions(whenever there is no more electrical power going into the battery) and log them.

this mobile application will be comprised of two modules :

  1. a J2ME module, mainly for interface stuff

  2. a Symbian C++ module, that will detect power interruption events and then inform the J2ME module that will log the power failure event (time and other data, etc...).

From what I gathered on this great website (StackOverflow), I have to use MIDP-JNI (http://wiki.forum.nokia.com/index.php/MIDletNativeServicesFramework ) to allow J2ME to interract with Symbian C++ code.

so my question is :

  1. should I make the Symbian module be the server and the J2ME module the client ? or can I do it the other way around ? (because I think that the part detecting power interruptions should be the client and whenever it detects an event, it calls the J2ME server .

  2. Can anyone provide me with a code sample ? I'm not a Symbian C++ programmer, so, it's a little bit difficult for me to deal with this.

Lucifer
  • 29,392
  • 25
  • 90
  • 143
Attilah
  • 17,632
  • 38
  • 139
  • 202
  • Do you absolutely need to target Series60 2nd edition? It's unfortunate that so many units of the 6600 are still being used as its technology is quite obsolete by now. – michael aubert Aug 05 '09 at 15:44
  • 1
    Also, is there any good reason why you need to use J2ME at all? It would seem that once you've written the "difficult" bit to monitor the charging status and/or battery level in Symbian C++ then logging any interruptions is going to be a breeze and adding a JNI layer is just unnecessary complexity. – Mark Wilcox Aug 06 '09 at 08:29
  • See the solution using JSR 256 (Mobile Sensor API) here: http://stackoverflow.com/questions/11604631/control-volume-code-for-j2me/11615631#11615631 – Douglas Frari Jul 26 '12 at 15:14

2 Answers2

2

You'll need to learn Symbian C++ for this. The architecture for MIDP-JNI is basically a Symbian C++ server listening on a socket for the connection of a Java MIDlet - does that answer your question?

You can't really make the MIDlet a server because I don't think they can run in the background on a 6600. In any case, as I've commented on the question above, there doesn't seem to be any good reason to use Java ME and MIDP-JNI at all for this application.

Mark Wilcox
  • 389
  • 1
  • 7
  • Shoot ! I have to learn Symbian C++ . I somehow already knew it ! because i wanted to use J2ME mainly for the UI stuff but using it means dealing with the added complexity of MIDP-JNI. any nice book/resources for Symbian C++ to recommend ? thanks Mark. – Attilah Aug 07 '09 at 15:11
  • Quick Recipes on Symbian OS is a good place to get started with Symbian C++ development, particularly if you like the hands-on example approach to learning. There are also a lot of free resources on the developer.symbian.org wiki. However, note that the 6600 is extremely old now and most of the recent documentation and examples available only apply to S60 3rd Edition and later devices (lots of it will work on older devices but it might need some tweaking). – Mark Wilcox Aug 09 '09 at 12:59
1

In j2me you can try

System.getProperty("com.nokia.mid.batterylevel");

But I'm not sure if it works on 6600

Pavel Alexeev
  • 6,026
  • 4
  • 43
  • 51