×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    37

    Question J2ME on Symbian with Native Interface

    HI

    I need to develop an application for Symbian that runs in the background (I think it's impossible on a cell phone not running Symbian).
    I thought I could write it in my favourite langage (JAVA but I should use a native interface to register the app as a kind of service or to have it running in the background.

    Do you think that could also work on a cell phone?
    Is it possible to JNI a part of my program in order to realize it? (I've never done JNI though), or is there a better way to do it ?

    Thanks in advance
    [url]http://wapcamer.free.fr[/url]

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,569

    Re: J2ME on Symbian with Native Interface

    There is no way to directly call native Symbian functions from a J2ME (Java 2 Micro Edition program (a MIDP MIDlet). You could open a socket to call a native Symbian C++ app, which does the native Symbian API calling. In other words, there is no JNI support in J2ME.

    On some phones using the older PersonalJava or the Java PersonalProfile, you can to some degree do more than using J2ME/MIDP. However, there are not many phones supporting those Java variants.

    If you really want to take advantage of Symbian facilities/APIs, write your app in C++, instead.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    37

    Re: J2ME on Symbian with Native Interface

    Thank you for your answer.
    My problem is that I need a portable application (running on both Windows mobile and Symbian) but with the following constraints:
    - background running
    - Telephony handling, for incoming and outgoing calls.

    I think for the backgrounf running, you just have to switch application, it shouldn't be a problem. But can you confirm me that the applet would still be running if it doesn't have the hand? (especially for network connections)

    Concerning the telephony, I've seen TAPI for MIDP but I don't think it is implemented yet on any device.

    i will have to choose the target devices regarding those criteria, but any advice is welcome.
    Thanks
    [url]http://wapcamer.free.fr[/url]

  4. #4
    Regular Contributor
    Join Date
    Oct 2005
    Location
    London, UK
    Posts
    235

    Re: J2ME on Symbian with Native Interface

    I havent done a huge amount of MIDP development, so i might be wrong but to my knowledge Java MIDlets don't continue running in the background, they can be sent to the background say if you had an incoming call but the MIDlet will automatically be in a paused state.

    ViruDoshi
    ~ No Style Without Substance ~

  5. #5
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Braunschweig, Germany
    Posts
    345

    Re: J2ME on Symbian with Native Interface

    It depends on the phone if a MIDlet continues to run in the background. On most devices they don't. As far as I know call handling is not available right now but while be once MIDP3 is specified and there are devices which support it.

    If you want to these things with current devices, you have to use C++.

    Bernd

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    37

    Re: J2ME on Symbian with Native Interface

    Let's consider this example:
    I start my midlet and I then push the Symbian button.
    The Midlet is not closed, and phone menus are accessible.

    Now I need the midlet to keep on listening on the socket (this is a client app which connects to a server) and to be able to answer without any interaction of the user.

    I now it would be much easier to do in native dev, unfortunatly we target too many different devices to allow porting time.

    That's why...

    Concernign the call handling, I thought I would write a server in native, that handles phone telephony on the one hand, and on the other communicates with the midlet. But if the Midlet goes idle when it's not on top, well you see my problem...

    Thanks for your help
    [url]http://wapcamer.free.fr[/url]

  7. #7
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Braunschweig, Germany
    Posts
    345

    Re: J2ME on Symbian with Native Interface

    Yes, I think I understand your problem, but I don't see a good solution for it. Telephony is not available for MIDP1/2 devices, so your only chance at the moment is to use Symbian, Windows Mobile and PalmOS devices with at least some part of the program as a native program.

    With these alternatives I think the best solution is a pure native program. And even with that it will a problem with some Symbian devices because they don't have official telephony support for 3rd party applications. It would be necessary to use some unsupported APIs.

    Bernd

  8. #8
    Registered User
    Join Date
    Mar 2003
    Posts
    37

    Re: J2ME on Symbian with Native Interface

    Just to let you know,
    I made a quick midlet, that has one thread increamenting a counter.
    We can see the counter growing up and when you either close the phone (this is a Samsung D720 slide-up), or push Symbian key or red key, they you lose the display, but the thread i still running.
    If you launch the app again, the counter displays at a higher level than when we left.

    So the answer concerning application in background is: YES !
    [url]http://wapcamer.free.fr[/url]

  9. #9
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Braunschweig, Germany
    Posts
    345

    Re: J2ME on Symbian with Native Interface

    Thanks for the info. I only knew that is is working on some phones but is not on most, but never checked on which is is working. So it should be possible to do the trick with the background server.

    Bernd

Similar Threads

  1. invoke j2me application from symbian C++ app
    By sridhar_ratna in forum Symbian
    Replies: 25
    Last Post: 2008-10-29, 06:31
  2. Symbian C++ Equivalent of J2ME RecordStore
    By anmian in forum Symbian
    Replies: 6
    Last Post: 2007-05-15, 14:37
  3. Global Symbian Development Opportunities *High Importance*
    By sara.lindsay in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2004-05-07, 12:17
  4. ItemCommandListener interface Q - from new j2me programmer
    By jhodgski in forum Mobile Java General
    Replies: 3
    Last Post: 2003-10-07, 21:41
  5. Replies: 1
    Last Post: 2003-03-25, 11:06

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×