wisleysit

updated

14 years ago

W

wisleysit

13 Posts

0

3418

January 8th, 2013 22:00

about atmos develop on android app

Hi all,

I am a new programer of developing atmos app.

I want to import atmos api to android app.

I find the following link to import java library to my android project.

https://community.emc.com/docs/DOC-5165

However, I got some problems.

It always give out "class cannot find".

Is it possible to import atmos to android?

Can anyone give me some example?

THX ALL.

  • 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).

  • chris_arnett

    1 Rookie

    •

    110 Posts

    1322

    0

    Posted January 9th, 2013 07:00

    wisleyit,

    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.

    - Stu

  • wisleysit

    13 Posts

    1322

    0

    Posted January 9th, 2013 08:00

    chris,

    thx for your reply.

    I have incuding jdom.jar in classpath.

    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

    01-10 00:56:37.709: E/AndroidRuntime(13629): java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at org.apache.http.impl.conn.SchemeRegistryFactory.createDefault(SchemeRegistryFactory.java:47)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at org.apache.http.impl.conn.PoolingClientConnectionManager. (PoolingClientConnectionManager.java:93)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at com.emc.atmos.api.jersey.JerseyUtil.createApacheClient(JerseyUtil.java:91)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at com.emc.atmos.api.jersey.AtmosApiClient. (AtmosApiClient.java:130)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at com.emc.atmos.api.jersey.AtmosApiClient. (AtmosApiClient.java:123)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at com.example.ecs_test.MainActivity.getAtmosApi(MainActivity.java:49)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at com.example.ecs_test.MainActivity.onCreate(MainActivity.java:44)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at android.app.Activity.performCreate(Activity.java:5008)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at android.app.ActivityThread.access$600(ActivityThread.java:130)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at android.os.Handler.dispatchMessage(Handler.java:99)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at android.os.Looper.loop(Looper.java:137)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at android.app.ActivityThread.main(ActivityThread.java:4745)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at java.lang.reflect.Method.invokeNative(Native Method)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at java.lang.reflect.Method.invoke(Method.java:511)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)

    01-10 00:56:37.709: E/AndroidRuntime(13629):           at dalvik.system.NativeStart.main(Native Method)

  • chris_arnett

    1 Rookie

    •

    110 Posts

    1322

    0

    Posted January 9th, 2013 11:00

    Make sure you've downloaded the latest Atmos SDK for Java (version 2.1).  You can find it here:

    http://code.google.com/p/atmos-java/downloads/detail?name=atmos-java-2.1.0.zip

    You have to include atmos-api-2.1.0.jar in your classpath as well as all of the dependencies in the list at the top of that document.

    atmos-api-2.1.0.jar

    commons-codec-1.4.jar

    jdom.jar

    jersey-apache-client4-1.16.jar

    jersey-client-1.16.jar

    jersey-core-1.16.jar

    log4j-1.2.16.jar

    security-1.1.jar

  • wisleysit

    13 Posts

    1322

    0

    Posted January 9th, 2013 18:00

    Yes , I have try to include esuapi.

    I try the following code:

    UploadHelper uploadHelper = new UploadHelper(api);

            try {           
                ObjectId oId = uploadHelper.createObject(new File(LOCALFILEPATH+fileName),null, null);           
                System.out.println(oId);

            } catch(EsuException ex){
                  System.out.println(ex.getMessage());
             }

    but it gave me the following error.

    Is that I need to include log4j.properties or

    it is server problems?

    Thx!

    01-10 11:26:12.848: W/System.err(23635): log4j:WARN No appenders could be found for logger (com.emc.esu.api.rest.AbstractEsuRestApi).

    01-10 11:26:12.848: W/System.err(23635): log4j:WARN Please initialize the log4j system properly.

    01-10 11:26:12.848: W/System.err(23635): log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

    01-10 11:26:12.934: D/dalvikvm(4120): GC_CONCURRENT freed 444K, 7% free 11826K/12615K, paused 14ms+13ms, total 66ms

    01-10 11:26:13.004: I/System(23635): Loaded time zone names for en in 158ms (155ms in ICU)

    01-10 11:26:13.082: D/dalvikvm(1464): GC_CONCURRENT freed 232K, 8% free 11706K/12679K, paused 11ms+5ms, total 70ms

    01-10 11:26:13.090: D/dalvikvm(18612): GC_CONCURRENT freed 440K, 6% free 11480K/12103K, paused 1ms+1ms, total 43ms

    01-10 11:26:13.168: D/dalvikvm(4120): GC_CONCURRENT freed 698K, 8% free 11640K/12615K, paused 12ms+15ms, total 59ms

    01-10 11:26:13.168: D/dalvikvm(4120): WAIT_FOR_CONCURRENT_GC blocked 5ms

    01-10 11:26:13.230: D/dalvikvm(1464): GC_CONCURRENT freed 124K, 6% free 12016K/12679K, paused 2ms+3ms, total 46ms

    01-10 11:26:13.324: D/dalvikvm(4120): GC_CONCURRENT freed 290K, 7% free 11842K/12615K, paused 14ms+3ms, total 92ms

    01-10 11:26:13.340: I/ActivityManager(307): Start proc com.google.android.apps.maps:FriendService for broadcast com.google.android.apps.maps/com.google.googlenav.friend.android.ServiceReceiver: pid=23662 uid=10031 gids={3003, 1015, 1028}

    01-10 11:26:13.441: D/dalvikvm(23662): GC_CONCURRENT freed 176K, 3% free 11098K/11335K, paused 3ms+9ms, total 25ms

    01-10 11:26:13.441: D/dalvikvm(23662): WAIT_FOR_CONCURRENT_GC blocked 16ms

    01-10 11:26:13.520: D/dalvikvm(23662): GC_CONCURRENT freed 150K, 3% free 11472K/11719K, paused 11ms+2ms, total 38ms

    01-10 11:26:13.535: D/dalvikvm(1464): GC_CONCURRENT freed 381K, 5% free 12054K/12679K, paused 11ms+2ms, total 68ms

    01-10 11:26:13.605: I/ActivityManager(307): No longer want com.google.android.apps.maps:LocationFriendService (pid 23338): hidden #16

    01-10 11:26:13.746: D/dalvikvm(4120): GC_CONCURRENT freed 846K, 10% free 11391K/12615K, paused 2ms+2ms, total 19ms

    01-10 11:26:13.746: D/dalvikvm(4120): WAIT_FOR_CONCURRENT_GC blocked 17ms

    01-10 11:26:13.832: D/dalvikvm(4120): GC_CONCURRENT freed 216K, 8% free 11633K/12615K, paused 13ms+13ms, total 50ms

    01-10 11:26:13.941: D/dalvikvm(125): WAIT_FOR_CONCURRENT_GC blocked 0ms

    01-10 11:26:13.941: D/dalvikvm(4120): GC_CONCURRENT freed 293K, 7% free 11848K/12615K, paused 13ms+5ms, total 44ms

    01-10 11:26:13.941: I/ActivityManager(307): Start proc com.google.android.apps.maps:LocationFriendService for broadcast com.google.android.apps.maps/com.google.googlenav.friend.reporting.LocationReportingIntentReceiver: pid=23677 uid=10031 gids={3003, 1015, 1028}

    01-10 11:26:13.965: D/dalvikvm(125): GC_EXPLICIT freed 39K, 3% free 10768K/11075K, paused 2ms+2ms, total 22ms

    01-10 11:26:13.965: D/dalvikvm(125): WAIT_FOR_CONCURRENT_GC blocked 0ms

    01-10 11:26:13.980: D/dalvikvm(125): GC_EXPLICIT freed <1K, 3% free 10768K/11075K, paused 2ms+1ms, total 19ms

    01-10 11:26:13.980: D/dalvikvm(125): WAIT_FOR_CONCURRENT_GC blocked 0ms

    01-10 11:26:13.996: D/dalvikvm(125): GC_EXPLICIT freed <1K, 3% free 10768K/11075K, paused 1ms+1ms, total 15ms

    01-10 11:26:14.043: D/dalvikvm(23677): GC_CONCURRENT freed 178K, 3% free 11095K/11335K, paused 13ms+1ms, total 33ms

    01-10 11:26:14.043: D/dalvikvm(23677): WAIT_FOR_CONCURRENT_GC blocked 10ms

    01-10 11:26:14.105: D/dalvikvm(23677): GC_CONCURRENT freed 150K, 3% free 11471K/11719K, paused 1ms+12ms, total 24ms

    01-10 11:26:14.145: D/dalvikvm(547): WAIT_FOR_CONCURRENT_GC blocked 0ms

    01-10 11:26:14.184: D/dalvikvm(547): GC_EXPLICIT freed 249K, 5% free 12523K/13127K, paused 2ms+4ms, total 37ms

    01-10 11:26:14.246: D/dalvikvm(23677): GC_CONCURRENT freed 309K, 4% free 11725K/12103K, paused 13ms+3ms, total 41ms

    01-10 11:26:14.254: D/dalvikvm(23677): WAIT_FOR_CONCURRENT_GC blocked 11ms

    01-10 11:26:14.285: I/ActivityManager(307): No longer want hkman.android.apps.hkdistictweather (pid 23453): hidden #16

    01-10 11:26:14.582: I/System.out(23635): Error connecting to server

  • chris_arnett

    1 Rookie

    •

    110 Posts

    1322

    0

    Posted January 9th, 2013 20:00

    In your catch block, print the stack trace after the message of the exception.

    ex.printStackTrace();

    Have you enabled a network connection on your android emulator?

  • wisleysit

    13 Posts

    1322

    0

    Posted January 9th, 2013 22:00

    Problem solved.

    THX

  • bfike

    3 Posts

    1322

    0

    Posted April 1st, 2013 06:00

    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.