Android UI Components for Flex 4.5
- May 13th, 2011
- Posted in Flex
- Write comment
Back during the public beta of Flash Builder and Flex 4.5, I realized I was going to need some Android UI components. I wanted the ability to have a stock Android look and feel. So I went about building my own, and with the release of Flex 4.5 SDK, I’ve gone back and updated them a bit. Big disclaimer: I built them for my needs, so I didn’t handle every possibility but I think they are decently robust, and hopefully it will save others some time. I went ahead and put the component library up on github, along with a sample project using them. Free free to use them, modify them, etc. If you find them useful, maybe just send a friendly link my way back to this post.. or leave a comment. Also, definitely leave comments for me here if you have suggestions or come across a huge bug I may have missed.
Screenshots:

Github link: https://github.com/olsonjj/Flex-4.5-Android-Component-Library
Thanks for sharing these. I’ll let you know when I use them.
Many thanks for the Alert component (among others). I was so surprised to see it was not part of the FB 4.5 release, though obviously one clue was that it was not in the betas. This is going to help me a lot!
I see that your components rely on the FlexOOPUtilities.swc. Are you just using that for Date methods, or something else as well?
@Jonathan,
Glad the components will help. With Adobe supporting dev on Android, iOS, and Playbook, I can understand them not building UI components, but at the same time, it would have been nice too. I hope to build some iOS components soon as well and get those posted up.
re: FlexOOPUtilities – Using that SWC for the various Date methods. Source was from here: http://code.google.com/p/flexdateutils/ I was going to write my own, but figured it was easier.
This is awesome. Thanks for putting these out.
These are great! I definitely find these useful and will try them out.
These are beautiful!
Let me know if you start working on components for iOS. I’m doing essentially the same thing, reimplementing some of the iOS components in AS3 (as pixel-perfect as I can manage).
Just like you, I’m only implementing them for my own needs, so I’m not implementing the full API. But if someone wants to work together, I think it’d be a worthy project, and I’d be happy to contribute some of the code I’ve already written.
Great components, Congrats!
John — Many thanks again for sharing the set. As a Flex newbie (but experienced Flash developer), your components are great for me to get a real-world perspective on SkinnableContainer.
One thing seems to not be working correctly — I use the Options Menu in my app, which I have forced to landscape mode. When I open the window [ menu.open(this, true) ], it is too big vertically — the top and bottom get cut off. I suspect it has to do with the setting of the default size of the skin in an un-id’d Group within Content Group (height is set to 580, whereas my landscape height is 480), but I don’t know enough to override that, if it’s possible to fix using the SWC version of your components.
Do you have a suggestion to fix this?
Jonathan, Yeah.. I didn’t design the components for switching orientations, however, it should be pretty easy to set constraints. I just haven’t had any time to go back and tweak these.
Hey, any chance you can create a login popup and a menu for the android menu button.
Corey, I haven’t created a login or menu try for the component set. I’ve been swamped with a clients project and really haven’t had a chance to update anything. However, there is this MenuTray you might try http://devgirl.org/2011/05/04/using-menus-in-your-flex-4-5-mobile-application/
How does one set the labelField for the OptionsMenu? I have an arrayCollection passed to it but I need to set a certain property as the labelField for the list.
menu.labelField doesn’t help
Aaron,
menu.title to set the title string of the options menu.
Definitely take a look at the example app I put on github at https://github.com/olsonjj/Flex-4.5-Android-UI-Example as it shows a decent implementation of everything that is enabled.
Thanks man. Good stuff!
As a newbie to Flash Builder and Flex, your example is one of the best study case for mobile development. Thank you very much for publishing your code.
I have a question as well. I am having trouble attempting to convert the options menu to allow multiple selections. Could you provide me a quick brain dump on how you would do it? I’ve been struggling with it for a while and still running into problems.
Thanks a lot.
How would one incorporate this into a Flash Project. I’ve included .swc, and external libs before, but not exactly sure how the mxml files work?
Thanks in advance