Nifty on Android

Hey, I tried to run some Nifty windows on an Android device but the log is returning some errors :

04-21 11:51:55.785: INFO/dalvikvm(2484): Could not find method de.lessvoid.nifty.NiftyInputConsumer.processMouseEvent, referenced from method com.jme3.niftygui.InputSystemJme.onMouseButtonEventQueued
04-21 11:51:55.785: WARN/dalvikvm(2484): VFY: unable to resolve interface method 10043: Lde/lessvoid/nifty/NiftyInputConsumer;.processMouseEvent (IIIIZ)Z
04-21 11:51:55.785: DEBUG/dalvikvm(2484): VFY: replacing opcode 0x78 at 0x0016
04-21 11:51:55.785: DEBUG/dalvikvm(2484): VFY: dead code 0x0019-001f in Lcom/jme3/niftygui/InputSystemJme;.onMouseButtonEventQueued (Lcom/jme3/input/event/MouseButtonEvent;Lde/lessvoid/nifty/NiftyInputConsumer;)V
04-21 11:51:55.785: INFO/dalvikvm(2484): Could not find method de.lessvoid.nifty.NiftyInputConsumer.processMouseEvent, referenced from method com.jme3.niftygui.InputSystemJme.onMouseMotionEventQueued
04-21 11:51:55.785: WARN/dalvikvm(2484): VFY: unable to resolve interface method 10043: Lde/lessvoid/nifty/NiftyInputConsumer;.processMouseEvent (IIIIZ)Z
04-21 11:51:55.785: DEBUG/dalvikvm(2484): VFY: replacing opcode 0x78 at 0x001c
04-21 11:51:55.785: DEBUG/dalvikvm(2484): VFY: dead code 0x001f-001f in Lcom/jme3/niftygui/InputSystemJme;.onMouseMotionEventQueued (Lcom/jme3/input/event/MouseMotionEvent;Lde/lessvoid/nifty/NiftyInputConsumer;)V
04-21 11:51:55.792: ERROR/dalvikvm(2484): Could not find class 'org.bushe.swing.event.ThreadSafeEventService', referenced from method de.lessvoid.nifty.Nifty.initalizeEventBus
04-21 11:51:55.792: WARN/dalvikvm(2484): VFY: unable to resolve new-instance 2134 (Lorg/bushe/swing/event/ThreadSafeEventService;) in Lde/lessvoid/nifty/Nifty;
04-21 11:51:55.792: DEBUG/dalvikvm(2484): VFY: replacing opcode 0x22 at 0x0002
04-21 11:51:55.792: DEBUG/dalvikvm(2484): VFY: dead code 0x0004-000a in Lde/lessvoid/nifty/Nifty;.initalizeEventBus ()V
04-21 11:51:55.792: INFO/dalvikvm(2484): Failed resolving Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber; interface 2132 'Lorg/bushe/swing/event/EventTopicSubscriber;'
04-21 11:51:55.792: WARN/dalvikvm(2484): Link of class 'Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber;' failed
04-21 11:51:55.796: INFO/dalvikvm(2484): Could not find method org.bushe.swing.event.EventServiceLocator.getEventService, referenced from method de.lessvoid.nifty.Nifty.getEventService
04-21 11:51:55.796: WARN/dalvikvm(2484): VFY: unable to resolve static method 17036: Lorg/bushe/swing/event/EventServiceLocator;.getEventService (Ljava/lang/String;)Lorg/bushe/swing/event/EventService;
04-21 11:51:55.796: DEBUG/dalvikvm(2484): VFY: replacing opcode 0x71 at 0x0002
04-21 11:51:55.796: DEBUG/dalvikvm(2484): VFY: dead code 0x0005-0006 in Lde/lessvoid/nifty/Nifty;.getEventService ()Lorg/bushe/swing/event/EventService;
04-21 11:51:55.800: INFO/dalvikvm(2484): Could not find method org.bushe.swing.event.EventServiceLocator.getEventService, referenced from method de.lessvoid.nifty.Nifty.publishEvent
04-21 11:51:55.800: WARN/dalvikvm(2484): VFY: unable to resolve static method 17036: Lorg/bushe/swing/event/EventServiceLocator;.getEventService (Ljava/lang/String;)Lorg/bushe/swing/event/EventService;
04-21 11:51:55.800: DEBUG/dalvikvm(2484): VFY: replacing opcode 0x71 at 0x0004
04-21 11:51:55.800: DEBUG/dalvikvm(2484): VFY: dead code 0x0007-000a in Lde/lessvoid/nifty/Nifty;.publishEvent (Ljava/lang/String;Lde/lessvoid/nifty/NiftyEvent;)V
04-21 11:51:55.800: WARN/dalvikvm(2484): VFY: unable to find class referenced in signature (Lorg/bushe/swing/event/EventTopicSubscriber;)
04-21 11:51:55.800: INFO/dalvikvm(2484): Failed resolving Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber; interface 2132 'Lorg/bushe/swing/event/EventTopicSubscriber;'
04-21 11:51:55.804: WARN/dalvikvm(2484): Link of class 'Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber;' failed
04-21 11:51:55.804: ERROR/dalvikvm(2484): Could not find class 'de.lessvoid.nifty.Nifty$ClassSaveEventTopicSubscriber', referenced from method de.lessvoid.nifty.Nifty.subscribe
04-21 11:51:55.804: WARN/dalvikvm(2484): VFY: unable to resolve new-instance 975 (Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber;) in Lde/lessvoid/nifty/Nifty;
04-21 11:51:55.804: DEBUG/dalvikvm(2484): VFY: replacing opcode 0x22 at 0x002b
04-21 11:51:55.804: DEBUG/dalvikvm(2484): VFY: dead code 0x002d-003b in Lde/lessvoid/nifty/Nifty;.subscribe (Lde/lessvoid/nifty/screen/Screen;Ljava/lang/String;Ljava/lang/Class;Lorg/bushe/swing/event/EventTopicSubscriber;)V
04-21 11:51:55.804: ERROR/dalvikvm(2484): Could not find class 'org.bushe.swing.event.EventTopicSubscriber', referenced from method de.lessvoid.nifty.Nifty.unsubscribe
04-21 11:51:55.804: WARN/dalvikvm(2484): VFY: unable to resolve instanceof 2132 (Lorg/bushe/swing/event/EventTopicSubscriber;) in Lde/lessvoid/nifty/Nifty;
04-21 11:51:55.804: DEBUG/dalvikvm(2484): VFY: replacing opcode 0x20 at 0x0003
04-21 11:51:55.804: DEBUG/dalvikvm(2484): VFY: dead code 0x0005-0031 in Lde/lessvoid/nifty/Nifty;.unsubscribe (Ljava/lang/String;Ljava/lang/Object;)V
04-21 11:51:55.804: INFO/dalvikvm(2484): Failed resolving Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber; interface 2132 'Lorg/bushe/swing/event/EventTopicSubscriber;'
04-21 11:51:55.804: WARN/dalvikvm(2484): Link of class 'Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber;' failed
04-21 11:51:55.804: ERROR/dalvikvm(2484): Could not find class 'de.lessvoid.nifty.Nifty$ClassSaveEventTopicSubscriber', referenced from method de.lessvoid.nifty.Nifty.unsubscribeAll
04-21 11:51:55.804: WARN/dalvikvm(2484): VFY: unable to resolve check-cast 975 (Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber;) in Lde/lessvoid/nifty/Nifty;
04-21 11:51:55.804: DEBUG/dalvikvm(2484): VFY: replacing opcode 0x1f at 0x001b
04-21 11:51:55.804: DEBUG/dalvikvm(2484): VFY: dead code 0x001d-002a in Lde/lessvoid/nifty/Nifty;.unsubscribeAll (Lde/lessvoid/nifty/screen/Screen;)V
04-21 11:51:55.808: INFO/Screen(2484): Missing ScreenController for screen [null] using DefaultScreenController() instead but this might not be what you want.
04-21 11:51:55.816: ERROR/dalvikvm(2484): Could not find class 'org.xmlpull.mxp1.MXParser', referenced from method de.lessvoid.nifty.loaderv2.NiftyLoader.loadControlFile
04-21 11:51:55.816: WARN/dalvikvm(2484): VFY: unable to resolve new-instance 2188 (Lorg/xmlpull/mxp1/MXParser;) in Lde/lessvoid/nifty/loaderv2/NiftyLoader;
04-21 11:51:55.816: DEBUG/dalvikvm(2484): VFY: replacing opcode 0x22 at 0x002a
04-21 11:51:55.816: DEBUG/dalvikvm(2484): VFY: dead code 0x002c-004e in Lde/lessvoid/nifty/loaderv2/NiftyLoader;.loadControlFile (Ljava/lang/String;Ljava/lang/String;Lde/lessvoid/nifty/loaderv2/types/NiftyType;)V
04-21 11:51:55.816: ERROR/dalvikvm(2484): Could not find class 'org.xmlpull.mxp1.MXParser', referenced from method de.lessvoid.nifty.loaderv2.NiftyLoader.loadNiftyXml
04-21 11:51:55.816: WARN/dalvikvm(2484): VFY: unable to resolve new-instance 2188 (Lorg/xmlpull/mxp1/MXParser;) in Lde/lessvoid/nifty/loaderv2/NiftyLoader;
04-21 11:51:55.816: DEBUG/dalvikvm(2484): VFY: replacing opcode 0x22 at 0x0026
04-21 11:51:55.820: DEBUG/dalvikvm(2484): VFY: dead code 0x0028-0074 in Lde/lessvoid/nifty/loaderv2/NiftyLoader;.loadNiftyXml (Ljava/lang/String;Ljava/io/InputStream;Lde/lessvoid/nifty/Nifty;)Lde/lessvoid/nifty/loaderv2/types/NiftyType;
04-21 11:51:55.820: ERROR/dalvikvm(2484): Could not find class 'org.xmlpull.mxp1.MXParser', referenced from method de.lessvoid.nifty.loaderv2.NiftyLoader.loadStyleFile
04-21 11:51:55.820: WARN/dalvikvm(2484): VFY: unable to resolve new-instance 2188 (Lorg/xmlpull/mxp1/MXParser;) in Lde/lessvoid/nifty/loaderv2/NiftyLoader;
04-21 11:51:55.820: DEBUG/dalvikvm(2484): VFY: replacing opcode 0x22 at 0x002a
04-21 11:51:55.820: DEBUG/dalvikvm(2484): VFY: dead code 0x002c-0050 in Lde/lessvoid/nifty/loaderv2/NiftyLoader;.loadStyleFile (Ljava/lang/String;Ljava/lang/String;Lde/lessvoid/nifty/loaderv2/types/NiftyType;Lde/lessvoid/nifty/Nifty;)V
04-21 11:51:55.820: ERROR/dalvikvm(2484): Could not find class 'org.xmlpull.mxp1.MXParser', referenced from method de.lessvoid.nifty.loaderv2.NiftyLoader.registerSchema
04-21 11:51:55.820: WARN/dalvikvm(2484): VFY: unable to resolve new-instance 2188 (Lorg/xmlpull/mxp1/MXParser;) in Lde/lessvoid/nifty/loaderv2/NiftyLoader;
04-21 11:51:55.820: DEBUG/dalvikvm(2484): VFY: replacing opcode 0x22 at 0x0007
04-21 11:51:55.820: DEBUG/dalvikvm(2484): VFY: dead code 0x0009-0022 in Lde/lessvoid/nifty/loaderv2/NiftyLoader;.registerSchema (Ljava/lang/String;Ljava/io/InputStream;)V
04-21 11:51:55.847: INFO/dalvikvm(2484): Total arena pages for JIT: 11
04-21 11:51:55.921: DEBUG/dalvikvm(2484): GC_CONCURRENT freed 909K, 53% free 3204K/6727K, external 1882K/2137K, paused 2ms+3ms
04-21 11:51:56.058: WARN/dalvikvm(2484): threadid=9: thread exiting with uncaught exception (group=0x40015560)

It seems that the missing mouse on Android devices is bugging Nifty up. Is there a way to fix this ?

Note : If someone already run some Nifty GUI on an Android device, I'd be interested in seing his code if possible.

did you add all the nifty*.jar to your projects java build path?

Yep, I had :


  • nifty-1.3-SNAPSHOT.jar
  • nifty-default-controls-1.3.SNAPSHOT.jar
  • nifty-examples-1.3-SNAPSHOT.jar
  • nifty-style-black-1.3-SNAPSHOT.jar
  • nifty-style-grey-1.0.jar



    I didn’t really which ones I had to put in so I put them all Oo…

Its strange that you get the errors at runtime, i would assume this errors should show up during compilation of jme.



Or nifty uses some classes which are not available on android like the awt.BufferdImage.

I think you forgot eventbus and xmlpull-xpp3?

Yeah that’s what I thought too so i tried it again adding it but I had the same single log… with the same error messages dealing with xmlpull*.jar.



Edit : My bad actually I thought I added xmlpull but I did just put them into my libs folder without adding it to buildpath. So now I’m not having the xmlpull*.jar errors anymore. But I’m still having those ones :


04-21 17:21:37.238: ERROR/dalvikvm(2192): Could not find class '[Ljava.awt.image.BufferedImage;', referenced from method com.jme3.system.AppSettings.getIcons
04-21 17:21:37.874: ERROR/dalvikvm(2192): Could not find class 'org.bushe.swing.event.ThreadSafeEventService', referenced from method de.lessvoid.nifty.Nifty.initalizeEventBus
04-21 17:21:37.886: ERROR/dalvikvm(2192): Could not find class 'de.lessvoid.nifty.Nifty$ClassSaveEventTopicSubscriber', referenced from method de.lessvoid.nifty.Nifty.subscribe
04-21 17:21:37.886: ERROR/dalvikvm(2192): Could not find class 'org.bushe.swing.event.EventTopicSubscriber', referenced from method de.lessvoid.nifty.Nifty.unsubscribe
04-21 17:21:37.886: ERROR/dalvikvm(2192): Could not find class 'de.lessvoid.nifty.Nifty$ClassSaveEventTopicSubscriber', referenced from method de.lessvoid.nifty.Nifty.unsubscribeAll
Could not find class ‘org.bushe.swing.event.ThreadSafeEventService’, referenced from method de.lessvoid.nifty.Nifty.initalizeEventBus


looks suspicious. I have no idea if nifty works under android, i will try it over the weekend.

I can’t wait 'cause I really have no clue of what’s wrong :).

sorry, didnt look into this as it was a busy week. Do you still have the problem?

Yep, actually I’ve been busy too and couldn’t look at it neither…

first, the fact that these errors only show up at runtime isn’t all that strange, since nifty makes use of reflection. Through reflection, you can load classes on the fly and call their methods and everything, AT RUNTIME. So compile time, all the compiler sees are the texts in the xml file.

So it means that… huh… what ? I’m not sure i get your answer actually ^_^’.

Well…



The errors you see are only going to show up at runtime. There is just no way to catch them at compile time. Such is the fun of using reflection.

So to try and fix them, you should be focussing on your runtime classpath. Since the compiletime classpath is not used to detect if the classes are present or not.

I got the TestNiftyGUI test to run. Dalvik complains about old class code in com.xmlpull.v1.* (from xpp3-1.1.4c.jar) but goes on.

Its a very simple hellonifty.xml, but works - sort of :slight_smile:



Demo is in MyApp, update the svn to get also the updated eclipse project.

Nice, that’s good news. Now just to figure out if those warnings can be fixed somehow.

I’ve tried your code (this one http://colladaviewer.googlecode.com/svn/trunk/AndroidRenderer/src/com/jme3/app/ I think it’s the good one) but it’s still not working. And I still have the same log errors I think :

05-03 10:32:14.626: INFO/AndroidAssetManager(4091): loadAsset(Common/MatDefs/Nifty/Nifty.j3md)
05-03 10:32:14.626: INFO/AndroidAssetManager(4091): Loading asset: Common/MatDefs/Nifty/Nifty.j3md
05-03 10:32:14.626: INFO/INKSPOT(1298): ContentResolver.registerContentObserver : android.database.AbstractCursor$SelfContentObserver@46c26ea0, uri : content://com.lge.provider.appMenuInfos/app_child_infos?notify=true
05-03 10:32:14.636: INFO/INKSPOT(1298): ContentResolver.unregisterContentObserver : android.database.AbstractCursor$SelfContentObserver@46c26ea0
05-03 10:32:14.636: INFO/MaterialDef(4091): 3 May 2011 10:32:14 com.jme3.material.MaterialDef
05-03 10:32:14.636: INFO/MaterialDef(4091): INFO: Loaded material definition: Default GUI
05-03 10:32:14.636: INFO/INKSPOT(1298): ContentResolver.registerContentObserver : android.database.AbstractCursor$SelfContentObserver@46c6b7e8, uri : content://com.lge.provider.appMenuInfos/app_child_infos?notify=true
05-03 10:32:14.636: INFO/INKSPOT(1298): ContentResolver.unregisterContentObserver : android.database.AbstractCursor$SelfContentObserver@46c6b7e8
05-03 10:32:14.636: INFO/INKSPOT(1298): ContentResolver.registerContentObserver : android.database.AbstractCursor$SelfContentObserver@46d563c8, uri : content://com.lge.provider.appMenuInfos/app_child_infos?notify=true
05-03 10:32:14.636: INFO/INKSPOT(1298): ContentResolver.unregisterContentObserver : android.database.AbstractCursor$SelfContentObserver@46d563c8
05-03 10:32:14.646: INFO/INKSPOT(1298): ContentResolver.registerContentObserver : android.database.AbstractCursor$SelfContentObserver@46daa870, uri : content://com.lge.provider.appMenuInfos/app_child_infos?notify=true
05-03 10:32:14.646: INFO/INKSPOT(1298): ContentResolver.unregisterContentObserver : android.database.AbstractCursor$SelfContentObserver@46daa870
05-03 10:32:14.646: INFO/INKSPOT(1298): ContentResolver.registerContentObserver : android.database.AbstractCursor$SelfContentObserver@46d99b98, uri : content://com.lge.provider.appMenuInfos/app_child_infos?notify=true
05-03 10:32:14.646: INFO/dalvikvm(4091): Could not find method de.lessvoid.nifty.NiftyInputConsumer.processMouseEvent, referenced from method com.jme3.niftygui.InputSystemJme.onMouseButtonEventQueued
05-03 10:32:14.646: WARN/dalvikvm(4091): VFY: unable to resolve interface method 10084: Lde/lessvoid/nifty/NiftyInputConsumer;.processMouseEvent (IIIIZ)Z
05-03 10:32:14.646: DEBUG/dalvikvm(4091): VFY: replacing opcode 0x78 at 0x0016
05-03 10:32:14.646: DEBUG/dalvikvm(4091): VFY: dead code 0x0019-001f in Lcom/jme3/niftygui/InputSystemJme;.onMouseButtonEventQueued (Lcom/jme3/input/event/MouseButtonEvent;Lde/lessvoid/nifty/NiftyInputConsumer;)V
05-03 10:32:14.646: INFO/dalvikvm(4091): Could not find method de.lessvoid.nifty.NiftyInputConsumer.processMouseEvent, referenced from method com.jme3.niftygui.InputSystemJme.onMouseMotionEventQueued
05-03 10:32:14.646: WARN/dalvikvm(4091): VFY: unable to resolve interface method 10084: Lde/lessvoid/nifty/NiftyInputConsumer;.processMouseEvent (IIIIZ)Z
05-03 10:32:14.646: DEBUG/dalvikvm(4091): VFY: replacing opcode 0x78 at 0x001c
05-03 10:32:14.646: DEBUG/dalvikvm(4091): VFY: dead code 0x001f-001f in Lcom/jme3/niftygui/InputSystemJme;.onMouseMotionEventQueued (Lcom/jme3/input/event/MouseMotionEvent;Lde/lessvoid/nifty/NiftyInputConsumer;)V
05-03 10:32:14.646: INFO/INKSPOT(1298): ContentResolver.unregisterContentObserver : android.database.AbstractCursor$SelfContentObserver@46d99b98
05-03 10:32:14.656: INFO/INKSPOT(1298): ContentResolver.registerContentObserver : android.database.AbstractCursor$SelfContentObserver@46c758d0, uri : content://com.lge.provider.appMenuInfos/app_child_infos?notify=true
05-03 10:32:14.656: ERROR/dalvikvm(4091): Could not find class 'org.bushe.swing.event.ThreadSafeEventService', referenced from method de.lessvoid.nifty.Nifty.initalizeEventBus
05-03 10:32:14.656: WARN/dalvikvm(4091): VFY: unable to resolve new-instance 2233 (Lorg/bushe/swing/event/ThreadSafeEventService;) in Lde/lessvoid/nifty/Nifty;
05-03 10:32:14.656: DEBUG/dalvikvm(4091): VFY: replacing opcode 0x22 at 0x0002
05-03 10:32:14.656: DEBUG/dalvikvm(4091): VFY: dead code 0x0004-000a in Lde/lessvoid/nifty/Nifty;.initalizeEventBus ()V
05-03 10:32:14.656: INFO/dalvikvm(4091): Failed resolving Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber; interface 2231 'Lorg/bushe/swing/event/EventTopicSubscriber;'
05-03 10:32:14.656: WARN/dalvikvm(4091): Link of class 'Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber;' failed
05-03 10:32:14.656: INFO/INKSPOT(1298): ContentResolver.unregisterContentObserver : android.database.AbstractCursor$SelfContentObserver@46c758d0
05-03 10:32:14.656: INFO/dalvikvm(4091): Could not find method org.bushe.swing.event.EventServiceLocator.getEventService, referenced from method de.lessvoid.nifty.Nifty.getEventService
05-03 10:32:14.656: WARN/dalvikvm(4091): VFY: unable to resolve static method 17554: Lorg/bushe/swing/event/EventServiceLocator;.getEventService (Ljava/lang/String;)Lorg/bushe/swing/event/EventService;
05-03 10:32:14.656: DEBUG/dalvikvm(4091): VFY: replacing opcode 0x71 at 0x0002
05-03 10:32:14.656: DEBUG/dalvikvm(4091): VFY: dead code 0x0005-0006 in Lde/lessvoid/nifty/Nifty;.getEventService ()Lorg/bushe/swing/event/EventService;
05-03 10:32:14.656: INFO/dalvikvm(4091): Could not find method org.bushe.swing.event.EventServiceLocator.getEventService, referenced from method de.lessvoid.nifty.Nifty.publishEvent
05-03 10:32:14.656: WARN/dalvikvm(4091): VFY: unable to resolve static method 17554: Lorg/bushe/swing/event/EventServiceLocator;.getEventService (Ljava/lang/String;)Lorg/bushe/swing/event/EventService;
05-03 10:32:14.656: DEBUG/dalvikvm(4091): VFY: replacing opcode 0x71 at 0x0004
05-03 10:32:14.656: DEBUG/dalvikvm(4091): VFY: dead code 0x0007-000a in Lde/lessvoid/nifty/Nifty;.publishEvent (Ljava/lang/String;Lde/lessvoid/nifty/NiftyEvent;)V
05-03 10:32:14.656: WARN/dalvikvm(4091): VFY: unable to find class referenced in signature (Lorg/bushe/swing/event/EventTopicSubscriber;)
05-03 10:32:14.656: INFO/dalvikvm(4091): Failed resolving Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber; interface 2231 'Lorg/bushe/swing/event/EventTopicSubscriber;'
05-03 10:32:14.656: WARN/dalvikvm(4091): Link of class 'Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber;' failed
05-03 10:32:14.666: ERROR/dalvikvm(4091): Could not find class 'de.lessvoid.nifty.Nifty$ClassSaveEventTopicSubscriber', referenced from method de.lessvoid.nifty.Nifty.subscribe
05-03 10:32:14.666: WARN/dalvikvm(4091): VFY: unable to resolve new-instance 982 (Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber;) in Lde/lessvoid/nifty/Nifty;
05-03 10:32:14.666: DEBUG/dalvikvm(4091): VFY: replacing opcode 0x22 at 0x002b
05-03 10:32:14.666: DEBUG/dalvikvm(4091): VFY: dead code 0x002d-003b in Lde/lessvoid/nifty/Nifty;.subscribe (Lde/lessvoid/nifty/screen/Screen;Ljava/lang/String;Ljava/lang/Class;Lorg/bushe/swing/event/EventTopicSubscriber;)V
05-03 10:32:14.666: ERROR/dalvikvm(4091): Could not find class 'org.bushe.swing.event.EventTopicSubscriber', referenced from method de.lessvoid.nifty.Nifty.unsubscribe
05-03 10:32:14.666: WARN/dalvikvm(4091): VFY: unable to resolve instanceof 2231 (Lorg/bushe/swing/event/EventTopicSubscriber;) in Lde/lessvoid/nifty/Nifty;
05-03 10:32:14.666: DEBUG/dalvikvm(4091): VFY: replacing opcode 0x20 at 0x0003
05-03 10:32:14.666: DEBUG/dalvikvm(4091): VFY: dead code 0x0005-0031 in Lde/lessvoid/nifty/Nifty;.unsubscribe (Ljava/lang/String;Ljava/lang/Object;)V
05-03 10:32:14.666: INFO/dalvikvm(4091): Failed resolving Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber; interface 2231 'Lorg/bushe/swing/event/EventTopicSubscriber;'
05-03 10:32:14.666: WARN/dalvikvm(4091): Link of class 'Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber;' failed
05-03 10:32:14.666: ERROR/dalvikvm(4091): Could not find class 'de.lessvoid.nifty.Nifty$ClassSaveEventTopicSubscriber', referenced from method de.lessvoid.nifty.Nifty.unsubscribeAll
05-03 10:32:14.666: WARN/dalvikvm(4091): VFY: unable to resolve check-cast 982 (Lde/lessvoid/nifty/Nifty$ClassSaveEventTopicSubscriber;) in Lde/lessvoid/nifty/Nifty;
05-03 10:32:14.666: DEBUG/dalvikvm(4091): VFY: replacing opcode 0x1f at 0x001b
05-03 10:32:14.666: DEBUG/dalvikvm(4091): VFY: dead code 0x001d-002a in Lde/lessvoid/nifty/Nifty;.unsubscribeAll (Lde/lessvoid/nifty/screen/Screen;)V
05-03 10:32:14.666: INFO/Screen(4091): Missing ScreenController for screen [null] using DefaultScreenController() instead but this might not be what you want.
05-03 10:32:14.696: DEBUG/dalvikvm(1298): GC_EXPLICIT freed 5632 objects / 342456 bytes in 40ms
05-03 10:32:14.696: INFO/AllAppsWorkspace(1298): Init Horizontal Grid View. ***Back Thread End***....
05-03 10:32:14.696: DEBUG/AllAppsWorkspace(1298): semaphoreRelease()
05-03 10:32:14.716: DEBUG/dalvikvm(4091): GC_FOR_MALLOC freed 6735 objects / 407096 bytes in 29ms
05-03 10:32:14.746: DEBUG/dalvikvm(4091): GC_FOR_MALLOC freed 1181 objects / 143232 bytes in 23ms
05-03 10:32:14.746: INFO/dalvikvm-heap(4091): Grow heap (frag case) to 3.227MB for 95388-byte allocation
05-03 10:32:14.776: DEBUG/dalvikvm(4091): GC_FOR_MALLOC freed 20 objects / 936 bytes in 33ms
05-03 10:32:14.806: DEBUG/dalvikvm(4091): GC_FOR_MALLOC freed 26 objects / 184504 bytes in 22ms
05-03 10:32:14.826: DEBUG/dalvikvm(4091): GC_FOR_MALLOC freed 14 objects / 152072 bytes in 22ms
05-03 10:32:14.856: DEBUG/dalvikvm(4091): GC_FOR_MALLOC freed 4 objects / 16496 bytes in 22ms
05-03 10:32:14.856: INFO/dalvikvm-heap(4091): Grow heap (frag case) to 3.310MB for 90130-byte allocation
05-03 10:32:14.876: DEBUG/dalvikvm(4091): GC_FOR_MALLOC freed 1 objects / 40984 bytes in 23ms
05-03 10:32:14.966: DEBUG/dalvikvm(4091): GC_FOR_MALLOC freed 2691 objects / 267952 bytes in 25ms
05-03 10:32:15.036: INFO/global(4091): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.
05-03 10:32:15.086: DEBUG/dalvikvm(4091): GC_FOR_MALLOC freed 4828 objects / 328968 bytes in 27ms
05-03 10:32:15.106: INFO/global(4091): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.
05-03 10:32:15.106: INFO/global(4091): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.


Edit : Btw, I have the same error on both the Nexus S and the Optimus 2X.
org.bushe.swing.event.EventTopicSubscriber
is in eventbus-1.4.jar

Did you include all jars in jme3/lib/niftygui into your library path?

You’re right it kinda works now (even if I still have some police bug but I think I can figure it out). But the thing is that as there is no mouse on smartphones :smiley: and it causes the app crashing when you touch the screen. Is there a way to substitute touch to mouse ?



Edit : Another thing, it seems that the application is not running on the full screen. I mean, the Nifty overlay doesn’t fill the whole screen. Like it dosen’t support 800x480 resolution.

Oh and a last thing, the app is running in landscape mode.

The AndroidInput class supports touch to mouse events, could be that its not turned on, because i dont use the mouse events.



I dont know if nifty now supports resolution independence, last time i checked about a year ago you had to design

your menus exactly for the used resolution.



setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) in MainActivity

OK, thank you for all this information. I’m gonna check all this stuff.