After further research, it appears the Android SDK does not include JAXB, which is required by the new AtmosApi interface. However, you can attempt to use the older EsuApi and see if that works.
EsuApi atmosApi = new EsuRestApi( hostname, 80, fullTokenId, secretKey );
Also, be sure to add the jars directly to the lib folder in your project as they will automatically be configured (external jars need additional configuration).
I forgot to include jdom.jar in the classpath in that document. Try that and if you continue to get errors, please post the specific exception message, which will tell you which class isn't found.
I also have incuding commons-httpclient folder to my project.
However it also got the following error:
01-10 00:56:37.701: E/dalvikvm(13629): Could not find class 'org.apache.http.params.SyncBasicHttpParams', referenced from method com.emc.atmos.api.jersey.JerseyUtil.createApacheClient
01-10 00:56:37.701: W/dalvikvm(13629): VFY: unable to resolve new-instance 2313 (Lorg/apache/http/params/SyncBasicHttpParams;) in Lcom/emc/atmos/api/jersey/JerseyUtil;
01-10 00:56:37.701: D/dalvikvm(13629): VFY: replacing opcode 0x22 at 0x003e
01-10 00:56:37.701: D/dalvikvm(13629): DexOpt: unable to opt direct call 0x2f27 at 0x38 in Lcom/emc/atmos/api/jersey/JerseyUtil;.createApacheClient
01-10 00:56:37.701: W/dalvikvm(13629): Superclass of 'Lorg/apache/http/params/SyncBasicHttpParams;' is final 'Lorg/apache/http/params/BasicHttpParams;'
01-10 00:56:37.701: W/dalvikvm(13629): Link of class 'Lorg/apache/http/params/SyncBasicHttpParams;' failed
01-10 00:56:37.701: D/dalvikvm(13629): DexOpt: unable to opt direct call 0x39a9 at 0x40 in Lcom/emc/atmos/api/jersey/JerseyUtil;.createApacheClient
01-10 00:56:37.701: I/dalvikvm(13629): Could not find method org.apache.http.impl.conn.DefaultClientConnectionOperator. , referenced from method org.apache.http.impl.conn.PoolingClientConnectionManager.createConnectionOperator
01-10 00:56:37.701: W/dalvikvm(13629): VFY: unable to resolve direct method 13712: Lorg/apache/http/impl/conn/DefaultClientConnectionOperator;. (Lorg/apache/http/conn/scheme/SchemeRegistry;Lorg/apache/http/conn/DnsResolver;)V
01-10 00:56:37.701: D/dalvikvm(13629): VFY: replacing opcode 0x70 at 0x0004
01-10 00:56:37.709: I/dalvikvm(13629): Could not find method org.apache.http.conn.scheme.Scheme. , referenced from method org.apache.http.impl.conn.SchemeRegistryFactory.createDefault
01-10 00:56:37.709: W/dalvikvm(13629): VFY: unable to resolve direct method 12071: Lorg/apache/http/conn/scheme/Scheme;. (Ljava/lang/String;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V
01-10 00:56:37.709: D/dalvikvm(13629): VFY: replacing opcode 0x70 at 0x000f
01-10 00:56:37.709: I/dalvikvm(13629): Could not find method org.apache.http.conn.scheme.Scheme. , referenced from method org.apache.http.impl.conn.SchemeRegistryFactory.createSystemDefault
01-10 00:56:37.709: W/dalvikvm(13629): VFY: unable to resolve direct method 12071: Lorg/apache/http/conn/scheme/Scheme;. (Ljava/lang/String;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V
01-10 00:56:37.709: D/dalvikvm(13629): VFY: replacing opcode 0x70 at 0x000f
01-10 00:56:37.709: D/dalvikvm(13629): DexOpt: unable to opt direct call 0x2f27 at 0x1f in Lorg/apache/http/impl/conn/SchemeRegistryFactory;.createDefault
01-10 00:56:37.709: D/dalvikvm(13629): DexOpt: unable to opt direct call 0x2f27 at 0x1f in Lorg/apache/http/impl/conn/SchemeRegistryFactory;.createSystemDefault
01-10 00:56:37.709: D/AndroidRuntime(13629): Shutting down VM
01-10 00:56:37.709: W/dalvikvm(13629): threadid=1: thread exiting with uncaught exception (group=0x40f67300)
01-10 00:56:37.709: E/AndroidRuntime(13629): FATAL EXCEPTION: main
I'm having trouble getting this working. I need to get this api implemented into an android app but i keep getting the "Could Not Find Class" error. What exactly did you have to do to get this to work? I realized that the jdom library was an older version that was supposed to be incompatible with android but the new jdom 2 was suppose to work fine with it so i modified the source code for the emcesu library and recreated the jar file (i switched to using the older version of the library before the new interface since i read that the newer version was incompatible with android as well). I tested the jar file with a small little java program to ensure that it still works too.
chris_arnett
1 Rookie
•
110 Posts
1322
1
Posted January 9th, 2013 12:00
After further research, it appears the Android SDK does not include JAXB, which is required by the new AtmosApi interface. However, you can attempt to use the older EsuApi and see if that works.
EsuApi atmosApi = new EsuRestApi( hostname, 80, fullTokenId, secretKey );
Also, be sure to add the jars directly to the lib folder in your project as they will automatically be configured (external jars need additional configuration).