views:

520

answers:

2

Hey all,

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.

thanks.

+2  A: 

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
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
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
+1  A: 

In j2me you can try

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

But I'm not sure if it works on 6600

Pavel Alexeev