Using R resources in Duby android apps

Not being able to use resources via R.stuff was the main caveat in Duby (atleast thats what i think). But there’s a work around for that as per alexsuraci on the #duby channel. Suppose you want to get layout working, then use this snippet

import "Layout", "singalong.helloduby.R$layout"

And then start using Layout.main to refer to main layout and so on. It seems that this doesn’t have to be done once nested classes start working, So until then this trick should help.

Just in case you want to clarify things… refer the readme here

P.S: Constants aren’t yet working in Duby. So that’s another noticable caveat.

Update: Duby has been renamed to Mirah.

Posted