TC65 NoClassDefFoundError

118 views
Skip to first unread message

morteza jahangard

unread,
Feb 7, 2017, 5:09:12 PM2/7/17
to Cinterion Java enabled chips support
hi
i use cinterion tc65i
my program :

import javax.microedition.midlet.*;
import com.siemens.icm.io.ATCommand;
import com.siemens.icm.io.ATCommandFailedException;
public class Homes extends MIDlet {
   
    public void startApp() {
        String resp="";
        String at_cmd_response="";
        try
        {
            ATCommand atc=new ATCommand(true);
           
            resp=atc.send("AT+CMGF=1\r");
           
            at_cmd_response = atc.send("AT+CMGS=\09147996616\r");
           
            resp=atc.send("hello friend\r"+(char)26);
        }catch(ATCommandFailedException e)
        {
            e.printStackTrace();
        }
        destroyApp(true);
    }
   
    public void pauseApp() {
    }
   
    public void destroyApp(boolean unconditional) {
        notifyDestroyed();
    }
}


when i running program wthi at^sjra:
result:

JAVA ERROR: MIDlet initialization failed: java.lang.NoClassDefFoundError: com/si
emens/icm/io/ATCommandFailedException



i use ASC0
i write program to connect to com ports or read ,write,print sring and its work correct but when i use ATCommand or other AT classes its dont work ! some one told me you should use import com.cinterion instead of import com.siemens i do but program program dont work on module
i use hyper terminal and asc0 on windows 8 to debug and program successfully compiled but when want running from module its dont work,
my english is weak and im sorry about this but i hope some one help me i really need to give my money because i complete weather dataloggers program  but hanged on this module

em

unread,
Feb 7, 2017, 5:26:58 PM2/7/17
to java...@googlegroups.com

Hi,  I guess you must change sdk as since it is Cinterion and not Siemens there are different imports needed.

Check http://www.javacint.com/TC65Dev

"9.3.4 Firmware
From the firmware version 2.004, Cinterion decided to switch the namespaces of all the classes to “com.siemens” to “com.cinterion”. This mean you have almost no effort to port it but you can’t “EASILY” make the same program work on both platforms. The EGS5 and TC65i-X are only delivered with the firmware 2.004 or higher. This mean the "com.siemens" namespace is not available on this chips.
If you really wanted to do that, I guess you could create a base class with two implementations, one that use some “com.siemens” namespace classes and one that use the “com.cinterion” namespaces classes. But you would have to rewrite one base class and two proxy classes for each class of the TC65i’s SDK. That’s a LOT of stupid work to do.
If you are faced with this situation, I would recommend using the preprocessor to create a chip specific import code. You could add the “sdkns” (like “SDK Namespace”) capacity, and create a project configuration with “siemens” value and the other with the “cinterion” value.
Then it would look like that:
//#if sdkns=="siemens"
import com.siemens.icm.io.ATCommandListener;
//#elif sdkns=="cinterion"
//# import com.cinterion.io.ATCommandListener;
//#endif"

Cheers Jacek

--
javacint group - http://www.javacint.com/
---
You received this message because you are subscribed to the Google Groups "Cinterion Java enabled chips support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javacint+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages