Can anyone please provide me full source code of Browser and Light Android demo for Cling 2.0-alpha3

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Can anyone please provide me full source code of Browser and Light Android demo for Cling 2.0-alpha3

hoangth
I've read the manual, chapter 5 Cling on Android. I've followed the manual to the end of that chapter and also I checked with demo source code for a complete code.

I use the newest version of ADT (from android.com), and Cling 2.0-alpha3 (I add 4 jar files in cling/core : cling-core-2.0-alpha3.jar, seamless-http-1.0-alpha3.jar, seamless-util-1.0-alpha3.jar, seamless-xml-1.0-alpha3.jar to the android project)

The code built fine, no error occured, but when I run (both Browser and Light), it always has the error "NoClassDefFoundError"

With the Browser demo, the log is
06-08 18:33:52.801: W/dalvikvm(2997): Unable to resolve superclass of Lcom/piavgh/browser/BrowserActivity$BrowseRegistryListener; (830)
06-08 18:33:52.817: W/dalvikvm(2997): Link of class 'Lcom/piavgh/browser/BrowserActivity$BrowseRegistryListener;' failed
06-08 18:33:52.817: E/dalvikvm(2997): Could not find class 'com.piavgh.browser.BrowserActivity$BrowseRegistryListener', referenced from method com.piavgh.browser.BrowserActivity.<init>
06-08 18:33:52.821: W/dalvikvm(2997): VFY: unable to resolve new-instance 717 (Lcom/piavgh/browser/BrowserActivity$BrowseRegistryListener;) in Lcom/piavgh/browser/BrowserActivity;
06-08 18:33:52.821: D/dalvikvm(2997): VFY: replacing opcode 0x22 at 0x0003
06-08 18:33:52.825: W/dalvikvm(2997): VFY: unable to find class referenced in signature (Lorg/fourthline/cling/android/AndroidUpnpService;)
06-08 18:33:52.829: W/dalvikvm(2997): VFY: unable to find class referenced in signature (Lorg/fourthline/cling/android/AndroidUpnpService;)
06-08 18:33:52.833: W/dalvikvm(2997): Unable to resolve superclass of Lcom/piavgh/browser/BrowserActivity$BrowseRegistryListener; (830)
06-08 18:33:52.833: W/dalvikvm(2997): Link of class 'Lcom/piavgh/browser/BrowserActivity$BrowseRegistryListener;' failed
06-08 18:33:52.837: W/dalvikvm(2997): Unable to resolve superclass of Lcom/piavgh/browser/BrowserActivity$BrowseRegistryListener; (830)
06-08 18:33:52.837: W/dalvikvm(2997): Link of class 'Lcom/piavgh/browser/BrowserActivity$BrowseRegistryListener;' failed
06-08 18:33:52.841: I/dalvikvm(2997): Could not find method org.seamless.util.logging.LoggingUtil.resetRootHandler, referenced from method com.piavgh.browser.BrowserActivity.onCreate
06-08 18:33:52.845: W/dalvikvm(2997): VFY: unable to resolve static method 5338: Lorg/seamless/util/logging/LoggingUtil;.resetRootHandler ([Ljava/util/logging/Handler;)V
06-08 18:33:52.845: D/dalvikvm(2997): VFY: replacing opcode 0x71 at 0x0006
06-08 18:33:52.849: I/dalvikvm(2997): Could not find method org.fourthline.cling.android.AndroidUpnpService.getRegistry, referenced from method com.piavgh.browser.BrowserActivity.onDestroy
06-08 18:33:52.853: W/dalvikvm(2997): VFY: unable to resolve interface method 5324: Lorg/fourthline/cling/android/AndroidUpnpService;.getRegistry ()Lorg/fourthline/cling/registry/Registry;
06-08 18:33:52.853: D/dalvikvm(2997): VFY: replacing opcode 0x72 at 0x0009
06-08 18:33:52.857: I/dalvikvm(2997): Could not find method org.fourthline.cling.android.AndroidUpnpService.getRegistry, referenced from method com.piavgh.browser.BrowserActivity.onOptionsItemSelected
06-08 18:33:52.861: W/dalvikvm(2997): VFY: unable to resolve interface method 5324: Lorg/fourthline/cling/android/AndroidUpnpService;.getRegistry ()Lorg/fourthline/cling/registry/Registry;
06-08 18:33:52.861: D/dalvikvm(2997): VFY: replacing opcode 0x72 at 0x0019
06-08 18:33:52.865: W/dalvikvm(2997): Unable to resolve superclass of Lcom/piavgh/browser/BrowserActivity$BrowseRegistryListener; (830)
06-08 18:33:52.869: W/dalvikvm(2997): Link of class 'Lcom/piavgh/browser/BrowserActivity$BrowseRegistryListener;' failed
06-08 18:33:52.869: D/dalvikvm(2997): DexOpt: unable to opt direct call 0x13ca at 0x05 in Lcom/piavgh/browser/BrowserActivity;.<init>
06-08 18:33:52.877: D/AndroidRuntime(2997): Shutting down VM
06-08 18:33:52.877: W/dalvikvm(2997): threadid=1: thread exiting with uncaught exception (group=0xa4d2db20)
06-08 18:33:52.885: E/AndroidRuntime(2997): FATAL EXCEPTION: main
06-08 18:33:52.885: E/AndroidRuntime(2997): Process: com.piavgh.upnpandroidapp, PID: 2997
06-08 18:33:52.885: E/AndroidRuntime(2997): java.lang.NoClassDefFoundError: com.piavgh.browser.BrowserActivity$BrowseRegistryListener
06-08 18:33:52.885: E/AndroidRuntime(2997): at com.piavgh.browser.BrowserActivity.<init>(BrowserActivity.java:29)
06-08 18:33:52.885: E/AndroidRuntime(2997): at java.lang.Class.newInstanceImpl(Native Method)
06-08 18:33:52.885: E/AndroidRuntime(2997): at java.lang.Class.newInstance(Class.java:1208)
06-08 18:33:52.885: E/AndroidRuntime(2997): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
06-08 18:33:52.885: E/AndroidRuntime(2997): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
06-08 18:33:52.885: E/AndroidRuntime(2997): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
06-08 18:33:52.885: E/AndroidRuntime(2997): at android.app.ActivityThread.access$800(ActivityThread.java:135)
06-08 18:33:52.885: E/AndroidRuntime(2997): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
06-08 18:33:52.885: E/AndroidRuntime(2997): at android.os.Handler.dispatchMessage(Handler.java:102)
06-08 18:33:52.885: E/AndroidRuntime(2997): at android.os.Looper.loop(Looper.java:136)
06-08 18:33:52.885: E/AndroidRuntime(2997): at android.app.ActivityThread.main(ActivityThread.java:5017)
06-08 18:33:52.885: E/AndroidRuntime(2997): at java.lang.reflect.Method.invokeNative(Native Method)
06-08 18:33:52.885: E/AndroidRuntime(2997): at java.lang.reflect.Method.invoke(Method.java:515)
06-08 18:33:52.885: E/AndroidRuntime(2997): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
06-08 18:33:52.885: E/AndroidRuntime(2997): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
06-08 18:33:52.885: E/AndroidRuntime(2997): at dalvik.system.NativeStart.main(Native Method)


With the Light demo, the log is
06-08 18:37:03.494: E/dalvikvm(3034): Could not find class 'org.fourthline.cling.model.types.UDN', referenced from method com.piavgh.light.LightActivity.<init>
06-08 18:37:03.494: W/dalvikvm(3034): VFY: unable to resolve new-instance 852 (Lorg/fourthline/cling/model/types/UDN;) in Lcom/piavgh/light/LightActivity;
06-08 18:37:03.494: D/dalvikvm(3034): VFY: replacing opcode 0x22 at 0x0003
06-08 18:37:03.502: W/dalvikvm(3034): VFY: unable to find class referenced in signature (Lorg/fourthline/cling/android/AndroidUpnpService;)
06-08 18:37:03.514: W/dalvikvm(3034): VFY: unable to find class referenced in signature (Lorg/fourthline/cling/android/AndroidUpnpService;)
06-08 18:37:03.518: E/dalvikvm(3034): Could not find class 'org.fourthline.cling.model.meta.Icon', referenced from method com.piavgh.light.LightActivity.createDefaultDeviceIcon
06-08 18:37:03.518: W/dalvikvm(3034): VFY: unable to resolve new-instance 842 (Lorg/fourthline/cling/model/meta/Icon;) in Lcom/piavgh/light/LightActivity;
06-08 18:37:03.526: D/dalvikvm(3034): VFY: replacing opcode 0x22 at 0x0002
06-08 18:37:03.526: E/dalvikvm(3034): Could not find class 'org.fourthline.cling.model.types.UDADeviceType', referenced from method com.piavgh.light.LightActivity.createDevice
06-08 18:37:03.530: W/dalvikvm(3034): VFY: unable to resolve new-instance 850 (Lorg/fourthline/cling/model/types/UDADeviceType;) in Lcom/piavgh/light/LightActivity;
06-08 18:37:03.534: D/dalvikvm(3034): VFY: replacing opcode 0x22 at 0x0000
06-08 18:37:03.534: W/dalvikvm(3034): VFY: unable to find class referenced in signature (Lorg/fourthline/cling/model/meta/LocalService;)
06-08 18:37:03.538: I/dalvikvm(3034): Could not find method org.fourthline.cling.android.AndroidUpnpService.getRegistry, referenced from method com.piavgh.light.LightActivity.getSwitchPowerService
06-08 18:37:03.542: W/dalvikvm(3034): VFY: unable to resolve interface method 5323: Lorg/fourthline/cling/android/AndroidUpnpService;.getRegistry ()Lorg/fourthline/cling/registry/Registry;
06-08 18:37:03.542: D/dalvikvm(3034): VFY: replacing opcode 0x72 at 0x0009
06-08 18:37:03.546: E/dalvikvm(3034): Could not find class 'org.fourthline.cling.android.AndroidUpnpServiceImpl', referenced from method com.piavgh.light.LightActivity.onCreate
06-08 18:37:03.546: W/dalvikvm(3034): VFY: unable to resolve const-class 827 (Lorg/fourthline/cling/android/AndroidUpnpServiceImpl;) in Lcom/piavgh/light/LightActivity;
06-08 18:37:03.550: D/dalvikvm(3034): VFY: replacing opcode 0x1c at 0x000e
06-08 18:37:03.558: W/dalvikvm(3034): VFY: unable to find class referenced in signature (Lorg/fourthline/cling/model/meta/LocalService;)
06-08 18:37:03.562: I/dalvikvm(3034): Could not find method org.fourthline.cling.model.meta.LocalService.getManager, referenced from method com.piavgh.light.LightActivity.onDestroy
06-08 18:37:03.566: W/dalvikvm(3034): VFY: unable to resolve virtual method 5333: Lorg/fourthline/cling/model/meta/LocalService;.getManager ()Lorg/fourthline/cling/model/ServiceManager;
06-08 18:37:03.566: D/dalvikvm(3034): VFY: replacing opcode 0x6e at 0x0009
06-08 18:37:03.570: I/dalvikvm(3034): Could not find method org.fourthline.cling.android.AndroidUpnpService.get, referenced from method com.piavgh.light.LightActivity.onOptionsItemSelected
06-08 18:37:03.570: W/dalvikvm(3034): VFY: unable to resolve interface method 5322: Lorg/fourthline/cling/android/AndroidUpnpService;.get ()Lorg/fourthline/cling/UpnpService;
06-08 18:37:03.570: D/dalvikvm(3034): VFY: replacing opcode 0x72 at 0x000f
06-08 18:37:03.574: D/dalvikvm(3034): DexOpt: unable to opt direct call 0x14db at 0x09 in Lcom/piavgh/light/LightActivity;.<init>
06-08 18:37:03.618: D/dalvikvm(3034): DexOpt: unable to opt direct call 0x14d2 at 0x0d in Lcom/piavgh/light/LightActivity;.createDefaultDeviceIcon
06-08 18:37:03.630: D/dalvikvm(3034): DexOpt: unable to opt direct call 0x14d9 at 0x05 in Lcom/piavgh/light/LightActivity;.createDevice
06-08 18:37:03.638: D/dalvikvm(3034): DexOpt: unable to opt direct call 0x14d7 at 0x10 in Lcom/piavgh/light/LightActivity;.createDevice
06-08 18:37:03.642: D/dalvikvm(3034): DexOpt: unable to opt direct call 0x14d8 at 0x1b in Lcom/piavgh/light/LightActivity;.createDevice
06-08 18:37:03.642: D/dalvikvm(3034): DexOpt: unable to opt direct call 0x14d0 at 0x1e in Lcom/piavgh/light/LightActivity;.createDevice
06-08 18:37:03.646: D/dalvikvm(3034): DexOpt: unable to opt direct call 0x14cc at 0x23 in Lcom/piavgh/light/LightActivity;.createDevice
06-08 18:37:03.646: D/dalvikvm(3034): DexOpt: unable to opt direct call 0x14ce at 0x30 in Lcom/piavgh/light/LightActivity;.createDevice
06-08 18:37:03.650: D/dalvikvm(3034): DexOpt: unable to opt direct call 0x14d1 at 0x3c in Lcom/piavgh/light/LightActivity;.createDevice
06-08 18:37:03.654: D/dalvikvm(3034): DexOpt: unable to opt direct call 0x14d3 at 0x43 in Lcom/piavgh/light/LightActivity;.createDevice
06-08 18:37:03.666: D/dalvikvm(3034): DexOpt: unable to opt direct call 0x14da at 0x19 in Lcom/piavgh/light/LightActivity;.getSwitchPowerService
06-08 18:37:03.670: D/AndroidRuntime(3034): Shutting down VM
06-08 18:37:03.674: W/dalvikvm(3034): threadid=1: thread exiting with uncaught exception (group=0xa4d2db20)
06-08 18:37:03.714: E/AndroidRuntime(3034): FATAL EXCEPTION: main
06-08 18:37:03.714: E/AndroidRuntime(3034): Process: com.piavgh.light, PID: 3034
06-08 18:37:03.714: E/AndroidRuntime(3034): java.lang.NoClassDefFoundError: org.fourthline.cling.model.types.UDN
06-08 18:37:03.714: E/AndroidRuntime(3034): at com.piavgh.light.LightActivity.<init>(LightActivity.java:49)
06-08 18:37:03.714: E/AndroidRuntime(3034): at java.lang.Class.newInstanceImpl(Native Method)
06-08 18:37:03.714: E/AndroidRuntime(3034): at java.lang.Class.newInstance(Class.java:1208)
06-08 18:37:03.714: E/AndroidRuntime(3034): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
06-08 18:37:03.714: E/AndroidRuntime(3034): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
06-08 18:37:03.714: E/AndroidRuntime(3034): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
06-08 18:37:03.714: E/AndroidRuntime(3034): at android.app.ActivityThread.access$800(ActivityThread.java:135)
06-08 18:37:03.714: E/AndroidRuntime(3034): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
06-08 18:37:03.714: E/AndroidRuntime(3034): at android.os.Handler.dispatchMessage(Handler.java:102)
06-08 18:37:03.714: E/AndroidRuntime(3034): at android.os.Looper.loop(Looper.java:136)
06-08 18:37:03.714: E/AndroidRuntime(3034): at android.app.ActivityThread.main(ActivityThread.java:5017)
06-08 18:37:03.714: E/AndroidRuntime(3034): at java.lang.reflect.Method.invokeNative(Native Method)
06-08 18:37:03.714: E/AndroidRuntime(3034): at java.lang.reflect.Method.invoke(Method.java:515)
06-08 18:37:03.714: E/AndroidRuntime(3034): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
06-08 18:37:03.714: E/AndroidRuntime(3034): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
06-08 18:37:03.714: E/AndroidRuntime(3034): at dalvik.system.NativeStart.main(Native Method)


But, when I use the prebuilt apk, it's worked fine. So I think it's because of my code or my dev environment.
Can anyone please give me the complete source code of this 2 demo? I need to check if my dev environment has any problems

Thank you very much