Cldc midp wtk confusion

hi,
this might be a j2me-newbe's stupid question, but i have the following problem:
in cldc 1.1 the method interrupt is defined for the class thread, while in cldc 1.0
it is not. in the javadoc of wtk20 the interrupt method is not available for thread,
in wtk22 it is. in
http://developers.sun.com/techtopics/mobility/getstart/articles/survey/
i can see that both midp1 and midp2 can be on top of cldc1.0 and cldc1.1 as well.
so my QUESTIONS are:
-for example the specification of the nokia 6600 says its a cldc1.0 mobile. is it possible to write some software, that stops threads on such a mobile anyway,
since i can use midlets created using wtk22, which includes the thread.interrupt-method ?
-what exactly does the wtk represent, an implementation of cldc or midp?
thanx
eddi

This is how I usually deal with such things: I display a form on the screen while the network processing is done in the background. In the commandAction() method of my main class I start 2 threads: one which will display the special form and another one which does all the data processing.          public void commandAction(....) {
                  WhileProcessingThread whileProcessing = new WhileProcessingThread(this);
               whileProcessing.start();
            Thread actualProcessing= new Thread(this);
            actualProcessing.start();
           }The first thread (whileProcessing) is handle by a special class (WhileProcessingThread) which takes a Form object and displays the content of the form in the run method:          public void run() {
          while (true) {
               if (!doneProcessing) {
                               //display something on the screen
          } Also on this form, I have a 'back' command which returns the application to the previous screen, so that if the data processing takes forever, then we can return from that screen.
The thread which does all the data processing (actualProcessing) is handled in the main class which in my case implements the Runnable interface; in the run() method, after all the processing is done, I simply set the variable doneProcessing to true and join on the thread so that I assure that the thread which displayes the form will end.
Again, if the application hangs forever, I have the back command so that I can safely return to my previous screen. Almost all my applications which involve "network processing" are done like this and it works every time.
Hope I was clear with my explications, which might not be the case because here is kind of late :)
Mihai

Similar Messages

  • J2ME CLDC/MIDP emulator for Compaq iPAQ

    I would like to run J2ME CLDC with MIDP on my Compaq iPAQ 3650. I am NOT interested in PersonalJava at this time. I have two questions:
    1. Has anyone tried to put the J2ME Wireless Toolkit emulator on iPAQ, with or without Swing? J2ME WTK currently requires Swing, but it seems like that AWT may be used exclusively instead with some slight modifications.
    2. Does anyone know if there is an applet/AWT version of a J2ME CLDC/MIDP emulator that I can use for demos?
    Thanks.

    You can use the PalmOS emulator for winCE and install MIDP4PALM...

  • Pl help me.....in cldc/midp, cldc/pdap based application

    application is developed in cldc/midp environment , will it run in pda devices which also has cldc configuration...
    pl help me in this....
    Thnaks in advance

    CLDC will support jdk1.2 that's Personal java. So if you develope program using jdk1.2 it will support pda computer. Before u run this program using Pjee(personal java emulatior enivronment).
    u run this program using "pjava file name"

  • How to install cldc/midp to phone without them?

    I'm a Java developer new to mobile java, working on a totally new project which is at the stage of deciding what phones to use and purchase for testing. I understand the concept of cldc/midp as a standard cross-phone platform but have the following very basic question: can you (or how do you) install these prereq's on a phone that doesn't have them initially when purchased? Is this a problem or a non-issue (perhaps you just load them as with Java jdk onto a desktop)?

    If I understand you right, you want to know how to add API:s ie MMAPI to a phone?
    Well thats impossible.. the only way you are going to get support for new api is if the manufacturar adds it in the next firmware (That never happends) . So if you buy a phone that is the tools you have.. Nothing els except the ones you write your self.
    Cheers
    Kenth Fagerlund

  • Problem in CLDC-MIDP build

    Hi all,
    I downloaded CLDC1.0.4 & MIDP2.0(WINDOWS version) packages and installed as given in the Installation documents in the package.
    I could successfully build CLDC (No errors with 'make DEBUG=on'). But I am having a problem with the build of MIDP. It says
    ... jcc_classes/JavaCodeCompact.class
    make: *** [jcc_classes/JavaCodeCompact.class] Error 255
    How do I overcome this problem?
    Please advice
    Thanks in advance
    Regards,
    usha

    These are some traps while building cldc or mipd in windows
    1. it said "ALT_BOOTDIR - Have it point to the directory that contains your JDK release, if it is not in the C:\jdk1.3.1 directory."
    but however the folder name in all environment variables here should be in unix format!! aka C:/jdk1.3.1 or C:/java/j2sdk1.4.2
    this should slove your problem
    and others...
    2. "The directory of the Cygwin executables must be before the directory of the Windows executables." is very important. everyone who encountered error should check this again!
    3. set KVM_DIR to your environment variables don't take any effect!(?)
    you should modify the C:\java\midp2.0fcs\build\win32\kvm\Platform.gmk
    about KVM_DIR = $(MIDP_DIR)/../kvm
    if cldc was in C:\java\j2me_cldc\ and midp as C:\java\midp2.0fcs\
    then KVM_DIR = $(MIDP_DIR)/../j2me_cldc
    4. The default VC's environment variables 'may' be skipped or not fitted. Use .\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT instead if u got a
    ... kvm_obj/check_class.o
    make: *** [kvm_obj/check_class.o] Error 255
    likes (which fails to compile xx.c file)!
    p.s. my friend reported that he can make midp1.0 but failed in mipd2.0 building. I said to him i can make midp2.0 no problem! after discussion..we had a difference--->it is because i always run VCVARS32.BAT before i type 'make'! (because i skipped the register action in my vc installing. and i am lazy to re-fill them ^_^) and later he told to me he found it is the long folder name with space in vc's environment variables caused somewhere in midp2.0 making error!? I am not sure about this...
    hope these help those have problems in building cldc/mipd guys
    Yann "OB" Chou

  • Writing a background .... (Posted under wrong topic, moved to CLDC/MIDP)

    I am trying to write a background J2ME application which listens on a socket and writes the received data on to a file. I want this application to do both these things silently. I tried push registry but it interrupts the current application when data arrives on the registered socket. Is there any other way to do this in J2ME?
    EDIT: Sorry posted under the wrong topic. Moving it ot CLDC and MIDP topic.
    Edited by: prasannata on Jul 24, 2009 3:27 PM

    MIDP 2.0 does not support background application, you could expect this in MIDP 3.0 devices..
    Regards,
    Raja Nagendra Kumar

  • Problem parsing xml(J2ME Web Service spec) containing image in cldc/midp

    Hi,
    I have created a restful web service that generates xml file in app server. I have created xml file using JAXB2.1 spec. This xml file has many elements starting from char data to image (binary data). I could successfully create xml file and developed another test client to read the same file using JAXB. However, I am finding a problem while getting the image in the java me client (cldc1.1 and midp2.0).
    I am using J2ME Web Services Specification, using javax.xml.parsers.SAXParser to parse the xml file. Parsing is successful and got the character data. But the image data is not accurate, so I am not getting the image. I suspect the problem is with encoding but not sure how to solve this. At the server end, I verified that xml file is encoded with "UTF-8" encoding, not sure how to decode at the client end.
    I am totally confused as how to get the accurate image data, not sure if I use kxml parser would solve my problem.
    I would really appreciate if somebody can get back to me as this is very very important.

    Try to send to your web service the byte array instead of string and then convert the byte array into an image
    using a method like the following one in your service:
    // C# code
    public Image ByteArrayToImage(byte[] byteArrayIn)
         MemoryStream ms = new MemoryStream(byteArrayIn);
         Image returnImage = Image.FromStream(ms);
         return returnImage;
    }There can be some problem between encoding in J2ME and .Net so try different encodings in gathering the image bytes in your j2ME application, but, instead of jpg which has more encodings, try png that is a more standardized image compression(open standard).

  • CLDC + MIDP

    Hello,
    I receive an error message (2 actually) that I don't understand.
    It occurs after preverifying a class file.
    (I followed the exact instructions from J. Muchows book: Core J2ME)
    compiling goed fine... preverify results in:
    Error preverifying class Welcome
         Class loading error: Illegal constant pool index
    c:\midlets\Welkom\midp -classpath . Welcome
    Warning: Could not open config file(MIDP_HOME =
    c:\j2me\midp1.0.3fcs\lib\internal.config): storageOpen() MIDP_HOME =
    c:\j2me\midp1.0.3fcs\lib\internal.config: Invalid argument
    Warning: Could not open config file(MIDP_HOME =
    c:\j2me\midp1.0.3fcs\lib\system.config): storageOpen() MIDP_HOME =
    c:\j2me\midp1.0.3fcs\lib\system.config: Invalid argument
    ALERT: Error verifying class Welcome
    Can anyone plz help me??
    Thx,
    Raymond Vermeulen

    My problem has been reduced to the 2 warnings:
    c:\midlets\Welkom\midp -classpath . Welcome
    Warning: Could not open config file(MIDP_HOME = c:\j2me\midp1.0.3fcs\lib\internal.config): storageOpen() MIDP_HOME = c:\j2me\midp1.0.3fcs\lib\internal.config: Invalid argument
    Warning: Could not open config file(MIDP_HOME = c:\j2me\midp1.0.3fcs\lib\system.config): storageOpen() MIDP_HOME = c:\j2me\midp1.0.3fcs\lib\system.config: Invalid argument
    ALERT: Error verifying class Welcome
    My program (Welcome) now runs... But I'd still like to get rid of these 2 warnings.
    replies also van be posted at: [email protected] (work)
    Thanx ! :-)
    Raymond

  • Configure or disable CLDC/MIDP?

    I'm having a hard time using java applications on my Nokia XpressMusic 5130. The problem being everytime the app tries to read/write from flash or SD, or connect to the internet via GPRS, this pop-up keeps telling me "Would you like to grant this app access?"  Well ofcourse I would! I wouldn't start it if not.
    I was wondering if there was some way of actually disabling CLDC in any way. I tried editing the settings to always allow network connections and disk read/writing, but they aren't an option.
    Please help.
    Thank you for your time.

    Well, there seem to be *some* workarounds available, although I haven't tried them yet myself.
    Found this web page:
    http://handphone-solution.blogspot.com/2009/09/how-to-get-certificate-and-key-from.html
    Anyone knows if this is a good way to work around a truly frustrating issue?
    "Reversing desertification through drought tolerant trees"
    www.edenfoundation.org
    new income - better environment - more food - less poverty

  • HELP !  MIDP + WTK + Netbeans + SIP API

    Ok,
    I'm a total newb, so sorry if I offend anyone. I've been tasked with building a quick and dirty SIP client for a small hand held device. Nothing fancy, just the basics.
    So, I've gone and installed the SIP API (JSR-180), netbeans 4.1 with mobility kit, and the WTK2.2.
    I've build a very simple MIDP, which is almost verbatim from "Getting Started with SIP API for J2ME". Of course I added the things I needed that that was about it.
    I've made sure that I've included the sipa1_0_1.jar into the "Libraries and Resources" in Netbeans.
    Everthing builds fine as I would expect, but when I attempt to run the application :
    1. The emulator launches and show the Midlet to be executed.
    2. Once I execute the Midlet, I get a "Java.Lang.NullPointerException"
    The code I have included is :
    public MTPComponent() {
    String myaddress = "sip:user@host";
    SipConnectionNotifier scn = null;
    System.out.println("*******************Starting******************");
    try{
    scn = (SipConnectionNotifier) Connector.open("sip:");
    if (scn != null){
    myaddress = new String("sip:user@"+scn.getLocalAddress()+":"+scn.getLocalPort());
    System.out.println(myaddress);
    } catch(Exception ex){
    System.out.println("caught error here");
    ex.printStackTrace();
    Netbeans reports the following output :
    java.lang.ClassNotFoundException: com/sun/midp/io/j2me/sip/Protocol
    at javax.microedition.io.Connector.openPrim(+211)
    at javax.microedition.io.Connector.open(+15)
    at javax.microedition.io.Connector.open(+6)
    at javax.microedition.io.Connector.open(+5)
    at MTPDemo.MTPComponent.<init>(+36)
    at java.lang.Class.runCustomCode(+0)
    at com.sun.midp.midlet.MIDletState.createMIDlet(+19)
    at com.sun.midp.midlet.Selector.run(+22)
    java.lang.ClassNotFoundException: com/sun/midp/io/j2me/sip/Protocol
    at javax.microedition.io.Connector.openPrim(+211)
    at javax.microedition.io.Connector.open(+40)
    at javax.microedition.io.Connector.open(+6)
    at javax.microedition.io.Connector.open(+5)
    at MTPDemo.MTPComponent.<init>(+36)
    at java.lang.Class.runCustomCode(+0)
    at com.sun.midp.midlet.MIDletState.createMIDlet(+19)
    at com.sun.midp.midlet.Selector.run(+22)
    caught error here
    javax.microedition.io.ConnectionNotFoundException: The requested protocol does not exist sip:
    at javax.microedition.io.Connector.open(+72)
    at javax.microedition.io.Connector.open(+6)
    at javax.microedition.io.Connector.open(+5)
    at MTPDemo.MTPComponent.<init>(+36)
    at java.lang.Class.runCustomCode(+0)
    at com.sun.midp.midlet.MIDletState.createMIDlet(+19)
    at com.sun.midp.midlet.Selector.run(+22)
    Unable to create MIDlet MTPDemo.MTPComponent
    java.lang.NullPointerException
    at MTPDemo.MTPComponent.<init>(+174)
    at java.lang.Class.runCustomCode(+0)
    at com.sun.midp.midlet.MIDletState.createMIDlet(+19)
    at com.sun.midp.midlet.Selector.run(+22)
    Execution completed.
    The problem seems to be that scn does not get properly established. I can't figure out why. I have read what I can on this, but nothing seems to help. I have set Obsification to it's maximum setting, still no help.
    I am completely lost and am not sure what to make of this. Can anyone shed some light ?

    I doubt at this...
    "javax.microedition.io.ConnectionNotFoundException: The requested protocol does not exist sip:"
    SIP protocol is not supported by the WTK2.2 environment.
    Check the environment.

  • Any CLDC/MIDP Api for interacting with phone? (eg. phonebook)

    Hello.
    I was going through the APIs for MIDP 1.0, and wasnt able to find any functions which I can use for interacting with the phone stuff. For example, some of the stuff that I would like to do is:
    (1) Add contact info. to the phone book.
    (2) Read the contacts info.
    (3) Set an image as the screen saver / background image
    (4) Set a new ringtone
    (5) Access the Messages Inbox (and also the pictures stored).
    I was hpoing someone could tell me which classes I should be looking at, or whether I am looking at the wrong API set.
    Thanks :)

    see JSR 75: PDA Optional Packages for the J2METM Platform
    if you know your target device you should check the vendor's developer website. many vendors have vendor specific extensions that enable access to PIM functions.

  • Where is CLDC / MIDP and mobile devices at now

    Hi,
    with today�s technology is it possible to have a midlet that can be downloaded into a phone / pda / other
    that will look at a remote dsn in order to notify the user of available information.
    To be more exact, is it possible if a courier installed a midlet on his J2ME enabled phone, it would intermittently look at a url which would connect to a dsn to look for new job schedules for that driver and send him/her back the details, and use the phone to alert that new details have arrived, for instance calling the phones text alert chime or something available within the j2me framework for this type of process.
    I understand and suspect the application manager would not allow any access to the device at all, for instance flash memory, for security.
    Is this sort of thing possible without the huge expense to the customer by the intermittent connections?
    Thanks for any feedback on this,
    JP.

    Hi,
    there should be no problem from technological POV. J2ME application that would get updates from certain URL can be programmed. The other thing is connecting to network and getting data itself. There are wireless carriers that provide flatrate for data transfers, but some (most) charge a fair amount of money for data. And using data abroad is yet another story. Check with your carrier.
    Peter

  • Application memory on CLDC/MIDP for PalmOS

    Hello,
    I've got serious problem running my MIDlet on PalmOS. It seems, that the maximum amount of memory I can assign to an application is 64kB. It doesn't matter how much memory Palm (or POSE) has, I cannot increase application memory in JavaHQ. Is there any possibility to change it. I do need more memory!
    Thanks for your help,

    Thanks,
    I have one more question. When my application (MIDlet) is starting, it creates many classes (arrays, Vectors,...) which are not not used afterwards. I think, the garbage collection should take care of disposing them, but it seems like they are not disposed and this is from my memory problems came from. I tried using "System.gc()", but it didn't help.
    Could You tell me somethig about "gc", does it work at all or what should I do to make it working. I tried to trace it, but when I check STDOUT.txt (for testing I'm using POSE) the amount of garbage collected bytes is 0 :(
    Thanks in advance
    Chris Bilinski

  • Cldc cdc compatibility

    help me in this
    An application deveoped in cldc/midp environment,will it run in cdc/personal profile environment.
    Thanks in advance

    Hi,
    I would say yes, in Next Generation Java in Nokia platforms !
    There's a presentation about Next Generation Java in Nokia platforms given in a Forum Nokia Tech Days event last year in August. ( http://www.forum.nokia.com/info/sw.nokia.com/id/792e74ea-faf9-4ea0-8c38-840e799d628c/Next_Generation_Java_Tech_Days_Aug_2005.pdf.html ).
    There is a picture in this slide, were they have MIDP on top of CDC.
    I have this picture in my blog: http://ovenordstrom.blogspot.com/2006/03/is-j2mepersonal-profile-dead-java.html
    -ove

  • Cldc and cdc compatibility

    help me in this
    An application deveoped in cldc/midp environment,will it run in cdc/personal profile environment
    Thanks in advance

    Hi,
    I would say yes, in Next Generation Java in Nokia platforms !
    There's a presentation about Next Generation Java in Nokia platforms given in a Forum Nokia Tech Days event last year in August. ( http://www.forum.nokia.com/info/sw.nokia.com/id/792e74ea-faf9-4ea0-8c38-840e799d628c/Next_Generation_Java_Tech_Days_Aug_2005.pdf.html ).
    There is a picture in this slide, were they have MIDP on top of CDC.
    I have this picture in my blog: http://ovenordstrom.blogspot.com/2006/03/is-j2mepersonal-profile-dead-java.html
    -ove

Maybe you are looking for