I am currently developing a small map editor for Android (mainly personal use, but I might Open-Source it).
I used aegroto’s template and BootMonkey, so I have the following project structure:
Root Folder
- MainApplication
- ...
+ Game
| - Main (SimpleApplication)
For the map editor, I need to be able to declare several variables, like tile type, and I can do that through a GUI.
I like the Android GUI (standard android Views), so I would prefer to use that, like jME and swing work together. However, I can’t refer to any of my game classes from my android classes, and I can’t change the variables located in the game.
Another option I have is using one of jME’s GUIs, which include Lemur, Nifty, and t0neg0d’s GUI.
I don’t want to use Nifty and I don’t know how to use t0neg0d’s GUI, so my options are basically limited to Lemur and Android GUI.
I also solved my other problem: Android <-> jME communication.
For anyone that needs to use Android applications in their jme module project:
You can refer to your Application through the AndroidHarnessFragment#getJmeApplication(). The Application contains the AppStateManager, through which you can call any loadedAppState. For example, you can use Android libs to search for a file in the data folders, and then send the file through a function/buffer/queue in a state, that handles the rest, like writing to it.
I’m not sure. I’m hoping one of the Lemur users who uses Android might pipe in.
I sort of remember people having problems getting groovy to run on Android anyway so you might not be able to use the style language… in that case if there is some way to exclude those files then it might be one workaround. But a bit of a shame.
Also a shame if android doesn’t support the multiple files somehow. The Lemur style loader will combine them dynamically at runtime if it finds more than one. That way extensions can easily add the styles for the components that they add.
I kind of feel like there has to be a way to solve this, though.
Which seems a very dirty way to do this. However, I don’t get any errors anymore.
I do have another problem:
when using the dependencies stated in my previous post, I don’t seem to be able to import com.simsilica.lemur.GuiGlobals or any other class. This is probably more of a gradle problem than an android one, but it might as well be the android spacing out.
UPDATE 0:
For some reason, Gradle can build GuiGlobals without problem, but Eclipse can’t find it. That is a problem on my end, not of Lemur.
UPDATE 1:
It turned I forgot to press on ‘Refresh Gradle Project’.
I tried fairly recently, around 3 mo ths ago. If memory serves, android doesnt contain some kind of loader that it needed. Ill see if i can find the project and the error.
Well, there is one when the app is left in background and you go to it again (ie: home button → open task manager → select background running game). All the UI messes up (it do it sometimes when opening the game too). There is a problem on some devices too that crash the apps when loading assets on startup (however, I didn’t have time to check this and make a “good” report).
About the first issue… there is no any log message that could help so I still thinking a way to debug it.
Yep, and that’s why I didn’t file a bug report yet. However, lemur is the single thing that “breaks”. Just mentioning it here so the OP is aware of that possibility and if he finds a similar issue he’ll comments it back knowing he isn’t the only one.
What exactly breaks? I don’t remember. If there is another thread then feel free to link it.
I remember some issue with the GUI node getting drawn in reverse order or something. Is that the one? And things in the gui node don’t get badly sorted if Lemur is not initialized? (The thing is I sort of remember someone complaining about the stats view getting inverted in a similar way and I’m not sure lemur was involved in that case.)
Some investigation into what happens in the application life cycle when the app goes into the background.
But if I’m wrong in guessing what the issue is then none of that means anything.
I’m not sure, I remember it felt like if the styles where just messed up with positions and sizes. When the app goes to background, I can see how the game rotates while fading (The game is vertical and it rotates to horizontal). Then, when reopening, all is messed up. Maybe it has something to do with that rotation.
I’ll see if I find a moment this afternoon to test it and perform some further checks.
Ok, I’ve been trying it now on the emulator and nothing breaks. O.o, it was the last time I tried it some days ago. That’s strange :S. Were there a lemur upgrade the last few weeks?.
xD not really, I have the + wildcard on the gradle file and the stage of that projects are just very early so I like to have them always with the latest versions, it forces me to adapt the code so when it is time to release I’m in the latest versions.
Maybe that version fixed the problem. Currently the problem is gone, I’ll inform once I know the why and if is really gone or if it is just not always.