Adding a button to activity

This is a pure java understanding problem. You may look at the javadocs or the source itself. Just call that method on a button object with an action as parameter.
eg:

myButton.addClickCommands(ButtonAction.Click,
myCommand );

You have the method Button.addClickCommands(Command) too

1 Like

Works! excellent. Thanks!

Now I have Lemur up & running and can start focusing on my application development.
Just one thing - Lemur & Lemur proto are generate some kind of duplicate file error which needs the following statement in the gradle file in order to resolve it:
packagingOptions {
exclude ā€˜com/simsilica/lemur/style/base/glass-styles.groovyā€™
}
It looks like a quick & dirty solution but it worksā€¦

Itā€™s not really a duplicate fileā€¦ this is the other unfortunate thing about android with respect to Lemurā€™s built in styles.

In a normal Java application, these style files will all live in their separate jars. When loading the glass style, Lemur will look for all of them and run them all. This means that add-ons can extend the existing styles to include things for the new add on components.

Unfortunately, because I guess an android app collapses all of the jars, these show up as duplicates and ignoring the extra ones is basically breaking the style resourcesā€¦ which is ok because they donā€™t work anyway because they require groovy.

Something I will have to figure out if/when the groovy support starts working on android and/or someone figures out the magic incantations to make it work.

Iā€™m not a Java expert and really donā€™t know what Groovy is but it looks like there is a support for Android since 2015
http://www.mscharhag.com/groovy/creating-android-apps-with-groovy
https://github.com/groovy/groovy-android-gradle-plugin

What do you say?

I say ā€œI donā€™t do android developmentā€ so I have no idea why others canā€™t get it working.

If someone figures it out then Iā€™m sure a bunch of people would love to know it here. And then we can work on fixing the duplicate resource problem.

Iā€™ll do my best to figure it out and when I succeed, Iā€™ll post it here or make a pull request to JME
BTW, what is the main target for JME applications? Desktop/WEB?

Do the tutorials and youā€™ll find out by yourself, I wonā€™t spoil the surprise.
Donā€™t want to do the tutorials? Youā€™re in the wrong place my friend. :slight_smile: