×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    46

    Calling a native c or c++ application from J2ME

    Hi,
    I am newbie to J2ME and i want to develop an application which calls a native c or c++ application from J2ME MIDlet.

    Is it possible in J2ME to call a native c or c++ application.

    I heard about KNI which the J2ME version of Java's JNI.

    I didn't found information or examples regarding the interaction between j2me and c or c++.

    Somebody given that through socket connections it was possible to establish connection between J2ME and c or c++.

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Calling a native c or c++ application from J2ME


  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    46

    Re: Calling a native c or c++ application from J2ME

    Hi,
    Thanks for your reply.

    My task is not related to symbian c++, but it is related to general c++.

    How to call a native c++ application from J2ME.

    Is it possible. At least, if its possible to call a DLL from J2ME please suggest me or give me any examples if already there anywhere.

    Thanks
    G.S.Rajasekhar

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,570

    Re: Calling a native c or c++ application from J2ME

    On Symbian/S60 based phones, you can only use a local socket call from a MIDlet to a Symbian C++ based server. You can't call a native DLL directly from a MIDlet.

  5. #5
    Registered User
    Join Date
    Aug 2007
    Posts
    46

    Re: Calling a native c or c++ application from J2ME

    Hi Petrib,
    I had gone through different links and come across the midpjni(which is at midpjni.com)

    But the site itself is hacked, please suggest me any different solutions or any useful links for connecting from MIDP to any c++ application.

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Calling a native c or c++ application from J2ME

    There is no equivalent of JNI for CLDC. You are specifically prevented from doing this. An application containing methods declared as "native" cannot be installed. This is essential to the sandboxing model.

    Assuming you are working on a device that allows you to install a native application (such as Symbian or Windows Mobile), then you might be able to start a native application that opens a server-side socket. If the MIDP run-time on the device supports sockets, then you might be able to establish a socket connection (to 127.0.0.1) to the native application.

    Note that most mobile devices do not permit you to install native applications.

    Categorically, you cannot invoke functions in a DLL directly from a MIDP application.

    On some devices, you might be able to launch a native application (using platformRequest()), but I would not bet money on it.

Similar Threads

  1. application error with 3gp file in J2ME
    By ruchig_iic in forum Mobile Java Media (Graphics & Sounds)
    Replies: 10
    Last Post: 2012-01-16, 22:40
  2. J2ME Application Network Settings
    By madankn in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2009-03-25, 08:37
  3. Can I Access Native Contact list from J2ME Application
    By hasbee_royal in forum Mobile Java General
    Replies: 1
    Last Post: 2008-04-11, 13:05
  4. J2ME application for controlling mouse through phone
    By tarun.park in forum Bluetooth Technology
    Replies: 2
    Last Post: 2006-09-25, 19:39
  5. Replies: 0
    Last Post: 2004-08-25, 11:42

Posting Permissions

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