Client Technology Choice - Any HTML5/Canvas libraries as capable as Flash/Flex? - apache-flex

I know similar questions have been closed for it being "impossible to answer objectively", but stick with me here.
I built a prototype in Adobe Flex, they (customers) liked it. Everything was fine until they later told me that iPads / iOS needs to be supported too.
I checked out Adobe's Packager for iPhone. We're evaluating that and we will know if it works out in a couple of days. (We need to get through Apple's red tape and certificates raj so this angle is delayed by a few days!)
There is a growing voice for using HTML5/Canvas as a technology platform itself. And despite being quite proficient in Flex, I think this makes sense.
I'm in need of a HTML5 library that can:
Render "widgets" i.e. containers with forms and components (this should be easy and possible using POHJC - Plain old HTML, JavaScript and CSS ;-) )
Provide a Tree like control for laying out some data
Provide a Canvas where data structures can be represented as basic shapes
Provide drag and drop capabilities between Trees, Buttons and Canvas
Provide some sort of Tab Navigator container (I guess JQuery works here)
Interact with back-end services (JSON/XML calls will be okay, but mapping directly with back-end entities will be awesome!)
Renders on latest versions of major browsers, Android OS and iOS (WebKit for mobile?)
Am I asking for too much?
I'm ready to give JQuery & JQuery UI a try.
I looked at Sencha / ExtJS but it seems we need to maintain two code bases one for normal browsers and the other for mobiles (is that correct?)
Are there any other JS libraries worth trying out?
My concerns areas are
Single code base, I don't want to suggest to them that multiple code bases for the client need to be maintained. That's a last resort option and would lead to complete ruling out of HTML5 with Flash apps and native apps being developed.
Canvas capabilities - I don't want to work with raw canvas and shape tags. This too is a last resort option. Is there any abstraction available?
Integration with back-end services, obviously I need some capability here!
Help me out. Communitywikify this if required.
Thanks,
Sri

How about trying Vaadin?
http://vaadin.com/comparison
I do construe its irrelevant to your question, but still this framework can help in great deal. I still use Flex and PHP as main base for many application, but actually fell in love with Vaadin and started using it for my new projects.

Grant Skinner the flash guru is working on a html5 libary. It has some features you requested. It is still in development.
The new Canvas element in HTML5 is powerful, but it can be difficult to work with. It has no internal concept of discrete display elements, so you are required to manage updates manually. The Easel Javascript library provides a full, hierarchical display list, a core interaction model, and helper classes to make working with Canvas much easier.
The libary is called easeljs, you can find it here : http://easeljs.com/
For the normal html and css manipulations without html canvas JQuery is very easy to learn.

Related

Use of spark.core.SpriteVisualElement in a mobile application

The question is: Is it a good practice to use SpriteVisualElement instead of UIComponent to create custom components? The reason being I can't add Sprite or FlexSprite as direct children of View and I see that UIComponent is quite heavy then SpriteVisualComponent from code point of view.
I searched extensively to confirm if there are certain examples elsewhere which shows use of this control as the base to create custom controls but could only find this. So actually I was little less confident about weather this is Ok or not.
Below is the supplement information:
Nature of application: Educational game application for children
Target platform: Mobile device (currently only Android platform)
Application environment: Flex SDK4.6 with AIR 3.8. Blank Spark application with spark.components.ViewNavigator. PureMVC framework used. Multiple Views to contain custom components which mostly use graphics package to draw themselves and to draw child controls within them (This is where I actually extend SpriteVisualElement for custom drawing as well as containing and displaying other custom controls).
Please suggest me if what I am doing is a good practice for a mobile app or not.
Thanks in advance and regards,
Sachin.
I use it often as SpriteVisualElement is lighter. I always try to use lighter things if it's fit my needs so I think it's a good practice especially for mobile development.

Does JavaFX have a "native look and feel" option like Swing?

It's been a couple of years since I've done any Java work, my last efforts were using Swing. I'm poking around with a cross-platform client app that will interact with a Rails web service. JavaFX is one of the options I'm considering, but I'm concerned at the out-of-the-box aesthetic. Does JavaFX have a native look and feel option for the JavaFX controls (not Swing)?
I'm getting the impression that if I want to build a line of business application in Java, I should probably stick with Swing which is a shame since I like some of the features of JavaFX like binding, a terse syntax, and easy support for REST client programming.
I haven't see that. At best, you can use the extensive support of CSS styling we got with 1.3 to mimic native look and feel, but that's a big job! Not even sure how to deal with various themes we got on modern systems...
I suppose the point of RIAs is to bring their own look or to be flexible enough to allow to do your own shinny look, not to look like a random bland application on your platform... :-)
(Now, if I like skinnable applications, I also appreciate GUI frameworks using native controls or looking as such, like Qt (vs. GTK+ for example), precisely to provide good old "bland" applications not breaking user experience.)
JavaFX 2.0 has only one Look by default that is called "Caspian".
With Java 8 a second one was introduced, called "Modena".
Both are cross-platform Look&Feels.
See announcement of Modena, with screenshots.
At the moment some developers create native Styles for JavaFX as OpenSource projects. You can find an overview here:
http://www.guigarage.com/2013/01/this-is-for-the-native-ones/
If you are interested in the Mac OS L&F (AquaFX) for JavaFX, here are some posts with previews:
http://www.guigarage.com/category/aquafx/
Native look and feel is not supported by Oracle in the default JavaFX 2.x distribution.
A proof of concept on button styles by one of the JavaFX developers demonstrates that JavaFX is flexible enough to generate widgets that look like native widgets.
For OS X, you can try the third party AquaFX style for JavaFX, which makes JavaFX applications look like native OS X applications. AquaFX appears quite complete and comprehensive to me.
There have been other 3rd party projects which partially create native look and feels for other platforms, but their coverage is currently nowhere near comprehensive.
Some third party projects (all of which seem currently experimental and incomplete) are:
JMetro in jfx-styles
javafx-native-themes (JavaFX look and feels for: default swing, iOS, windows 7...)
you could definitely embed some css in your application to make the javafx components look more like the standard swing look. With scene builder its actually really easy to get all your tags setup correctly.
Check this out
http://docs.oracle.com/javafx/2/css_tutorial/jfxpub-css_tutorial.htm
Interesting thing is in javaFx is, you can give the rich look and feel to native application also.You can apply css to the javaFx components. Not only that you can embed the HTML Css and pages in JAVAFX application.Which i can feel great revolution in terms of UI building for Standalone applications.

Common Web UI Styles

I have to present a prototype of an web app in the following days to one of my clients, the thing is I'm not so good at CSS and worst of all I'm almost never happy with the results I get.
Coding the business logic poses no challenge to me, the UI design however takes more than 80% of my time. I don't need nothing breathtaking, just a clean, nice and presentable environment, an example:
This is a recurring problem I've been having, I wish web UI development could have a less naked default style, an approach similar to Visual Studio or iPhone SDK would be very useful to me.
The above mockup created with Balsamiq Mockups is a great example, all the most common "components" are available to use, and best of all: there is only one good-looking style to choose from.
Is there something like this for the web? A neutral yet nice CSS or Javascript UI framework?
Options so far:
Bootstrap
Qooxdoo
jQuery UI
jQuery Tools
MochaUI
Ext JS
Yahoo! User Interface Library
BlueTrip
BluePrint
Uki (Demo)
Napkee
YAML
Baseline
iPlotz
Sproutcore
ForeUI
I'm interested in knowing if there are any CSS-only UI frameworks.
I found this page with a very nice list of Web UI Libraries, but most of them (at least the good ones) seem to be specific to Java, are there any equally good alternatives in pure CSS or JS?
PS: I'm not interested in AJAX, effects, behaviors and so on... my main (only) concern is style.
Thanks for all the suggestions everyone!
After a very careful consideration of all the UI libraries suggested, I've come to the conclusion that ExtJS and Qooxdoo are the ones that most closely fit my needs. jQuery UI seems promising but only offers a reduced amount of elements.
As far as CSS-only libraries go I've found BlueTrip / BluePrint and the themes suggested by tambler to be the best. Aside from that, Flex and Napkee also seem to be worth exploring.
Time to learn ExtJS now! =)
A combination of 960gs for layout and jQuery-UI for styling is probably what you are after.
You could also consider the blueprint CSS framework instead of 960gs.
I can't believe nobody has mentioned:
http://www.extjs.com/
Its a commercial js frameworks, but pretty affordable, and makes putting together a nice UI a breeze. There's a much more complete set of elements then jqueryui, and its designed to make an entire app. I've only played with it a little, but I really love it so far. Free for personal use.
If you really want to get a feel for a complete UI developed with EXT, try this url:
http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/feed-viewer/feed-viewer.html
What about using dojo and dijit?
Dijit is a fast way to create widgets and elements. It also comes with 3 default themes which are easy to modify.
A good list of different widgets here
Pair up with someone who specializes in UI design.
If you are better at dealing with business logic, your time is better off spent exclusively coding business logic so you can master it. This will require you to learn how to interface with someone else who excels at presentation. (xml and json are common means)
Business logic and presentation are very different. Designing a system that not only looks good, but is intuitive and easy to use is quite difficult. Equally as difficult and time-consuming as establishing the inner workings of a complex application.
A good interface is not as simple as including a css framework.
I consider myself to be a more 'creative' programmer who does excel in presentation. I happened to be lucky enough to cross path's with someone who was, first of all... very motivated, and second of all very good at 'business logic'. He had a lot more experience planning and implementing complex systems, while I mainly have been focusing on interface design.
If you are more productive doing system architecture, planning, developing, whatever... you should push yourself in that direction. While solo development projects can be rather fulfilling, I view it as inefficient. It is very rare that someone possess skills to develop top-level applications solo.
The challenge is finding someone who you work well with.
Check out Google Web Toolkit. It has a pretty clean default look. They have examples . In particular, their Showcase example demonstrates all of the available widgets and the css styling used to achieve the look.
There are a few frameworks aimed at (G)UI Design; Qooxdoo, JQuery UI and MochaUI being a few of them (although the last is more a proof-of-concept than a usable framework). These frameworks usually offer a variety of JS-powered elements (form elements, such as input fields and submit buttons, but other elements like tabs as well). However, it will still be up to you to position these elements, and perhaps style them, to your liking.
Perhaps familiarizing yourself with a CSS framework (such as 960GS) might complement the above JS UI Frameworks.
(As a personal disclaimer; I have very little experience with any of the frameworks mentioned above. But I'm sure either Google or SO can provide answers I can't.)
This won't help you out for your current project, but it's worth considering for future projects. After spending many years creating GUI applications in HTML 4 and constantly wrestling against the limitations of CSS and HTML, I thought I'd try out Adobe Flex. What an improvement!
Rather than faking a tabbed page control or data grid, with Flex or Silverlight, your markup can simply specify a tabbed page control or data grid. And the frameworks come with default styles that are boring but not at all bad. I'm not saying these completely replace HTML, but if you need widgets and GUI layout, I believe they're a much better alternative.
You might consider browsing the following site:
http://themeforest.net/category/site-templates/admin-skins
There are several "Administrative" themes available for purchase here that may suit your needs.
wireframe mockups like that are a brilliant way to start.
Having used most of the UI framewroks discussed here, I'd liek to steer you towards jQueryUi for the following reasons:
jQueryUI CSS framework takes care of the consistent and cool looking CSS for you (it's really easy - just make some markup and apply the classes)
jQueryUI has tabcontrol, and heaps on neat quick easy ways to style forms.
If you are targeting modern, non IE, browsers, then you should check out Sproutcore. For mockups I use mockingbird.
A relatively new PHP framework specifically designed for development of UI-focused software. Elements you have here including Tabs, Filters and Grids are included and will take you about 20 lines of code to implement.
http://agiletoolkit.org/
Have you tried Axure? It's a tool for rapidly creating wireframes, prototypes and specifications for applications and web sites.
It works in a similar way to Balsamiq, but it allows you to export your wireframes/prototype as HTML, CSS and Javascript.
You can then upload this to a server or run it on your computer as a working example.
You can create forms, links, tabs, rollovers, Javascript effects.
If you are already using Balsamic Mockups for your prototypes then you should consider Napkee. To quote the website "Napkee lets you to export Balsamiq Mockups to HTML/CSS/JS and Adobe Flex 3 at a click of a button."
I ran into this awhile ago, and couldn't find anything, so I took it as an opportunity to learn css. But since then it seems great strides have been made towards this subject.
Summarizing your problem, there is a wikipedia page.
There is yaml-css, which takes yaml and turns it into css
There is baseline, but it assumes some css knowledge.
I'd also suggest looking at Adobe's Dreamweaver. They have a lot of css and style generation tools which produce very readable and w3c compatible code.
I hope that helps.
A combination of 960gs for layout and jQuery-UI or Jquery tools is great
i use them almost in every project but i'd like to add to http://easyframework.com/
although its not a business friendly so
make sure to check out its license
but i like it
I recently discovered a nice website called iplotz.com where you can create a mockup of your application/website/project online without installing anything.
It also has most of the common controls, along with much more features for managing thw whole project and sharing it with others online.
I must admit, i didn't try it yet myself, but i looked at it a bit and it seems pretty cool. I'll probably be using it soon enough.
Sass looks like it has potential as a way to mitigate some css headaches.
I like to add Bootstrap it's intuitive, and powerful front-end framework for faster and easier web development.
I like RocketCSS. Nice clean design, give it a go.

Flash versus Flex

I've tried looking everywhere for a concise list of the advantages and disadvantages of using Flex vs. Flash.
Coming from a programming background, I absolutely love Flex. It's easy to pick up, and since it can use flash classes, why would I want to use Flash without flex?
Flex:
Pros:
good for RIA development
provides many user-input options out of the box
Build in lay-outing system
the MXML is easier for non-programmers
You can quickly combine components to create small applications
components can provide an advantage in large-scale projects because of their modular
nature.
can be developed using linux
has a nice component lifecycle for validation, etc.
Cons:
increases the size of your .swf
Customizing the look of components can take a lot longer than anticipated, depending on the visual style you're looking for
when you find out you need a custom component that doesn't exist, you might need to go back to Flash to do the real programming work and packaging of the component
The "flexibility" of Flex means you will be reading a lot of documentation
Bugs in the Flex framework
You eventually will need to compromise with the architecture of the Flex framework
Flash
Pros:
good for making movies/animations
Timeline can be easier for designers/animators to conceptualize
when working from scratch, provides a great deal of control.
easier for someone with a programming background
You can program whatever you like; no compromises with existing frameworks
Cons:
only provides basic user input (text box) out of the box.
timeline can be daunting for programmers (although you can quite safely ignore it)
Development of certain types of applications will be slower than with Flex
can't be developed using linux
user input validation must all be handled in the code. No built-in validation.
need to implement your own lay-outing system
Please correct me if I missed anything said so far.
Flash and Flex both use the same underlying rendering engine, just with different front-ends. Flash is better suited for making movies and animations. Flex is better for application development.
From a programmer's viewpoint, the big difference between Flash and Flex is not so much which IDE/application you use for programming, but whether you program in ActionScript (AS) only, or use the Flex framework and MXML to program your applications.
I would say pure ActionScript is better for programming (whether you use Flash IDE or Flex IDE is not that relevant), and MXML is better for non-programmers to combine the components programmed in AS.
I would add to your list these pros/cons:
Flex:
Pros:
Easier for non-programmers to get into application development
You can quickly combine components to create small applications
Components can provide an advantage in large-scale projects
Cons:
Customizing the look of components can take a lot longer than anticipated, depending on the visual style you're looking for
When you find out you need a custom component that doesn't exist, you might need to go back to Flash to do the real programming work and packaging of the component
The "flexibility" of Flex means you will be reading a lot of documentation
Bugs in the Flex framework
You eventually will need to compromise with the architecture of the Flex framework
Flash (or Flex IDE in ActionScript project mode):
Pros:
Easier for someone with a programming background ;)
You can program whatever you like; no compromises with existing frameworks
Cons:
Timeline can be daunting for programmers (although you can quite safely ignore it)
Development of certain types of applications will be slower than with Flex
In short: pick the right tool for the right task.
Flex is a library of code written in ActionScript3, so it adds lots of capabilities and standard-library-like stuff to Flash. The downside is that it a is a huges amount code that gets included into your application. If you use any Flex at all in your app, the download size of the SWF goes up by 100's of K.
If your application has any kind of user interface widgets, then you almost have to use Flex as Flash itself only has the most basic things like text boxes. Flex has a whole XML GUI with layouts, data binding and XML setup etc.
Doing that in flash, you end up having to write from scratch things like list boxes...
In my opinion, the most important feature of the Flex framework is the component lifecycle, which provides a really elegant model for validation/invalidation of properties, component size, and hierarchical rendering.
The benefit to developers is that it creates discrete application phases for business logic and rendering, avoiding expensive geometry & rendering code until the last possible moment before drawing a frame.
Here's a really good presentation, explaining how it works:
http://tv.adobe.com/#vi+f15384v1002
The model is so well-designed that the component lifecycle remains almost entirely invisible during the majority of Flex development, when you're using the framework default components and containers. You only need to learn the inner-workings when you start developing your own components.
Developing in the Flash environment, or in pure Actionscript, you don't get any of that. Anyone developing pure AS3 applications either needs to code very carefully to separate business logic from rendering, or will suffer severely decreased performance.
[...] why would I want to use Flash without flex?
Flex is a new product, whereas Flash existed from the Macromedia days. Designer, animators and most anybody who is not brought up on a staple diet of programming education will probably find Flash easier to master than most other such solutions.
Target is different.
Flex is more dedicated for programmer while Flash is more friendly to Artist / web designer.
Flash is the IDE used (generally) to create animations and things that work well on a timeline.
Flex works better for creating internet applications which have interactions more akin to a desktop.
Why use Flash? Well, if you need to do something more specifically attached to a timeline, of course!
I see Flex as more of a solution for doing RIA applications where you need to develop application based solutions. There's quite a lot you get right out of the box with using Flex but it also comes at a price in terms of file size, granularity, etc.
If on the other hand you are working on a totally custom solution such as a game then perhaps Flash is the way to go because you can start fresh with a blank canvas. Many people still use Flash because they don't need all the app based bells and whistles of the Flex platform.
I like the freedom of Flash, and its really simple to embed assets in Flash, a little more confusing to do in Flex.
One thing that I love about flex is the ability to make a fluid application with minimal effort. Which would take forever in Flash.
Anything you can do in flex you can do in flash, just may take a lot longer to do. You can't do everything in flex that you can do in flash though.
Flex takes care of all the UI programming for you and lets you focus on the business logic, with flash you will spend a majority of time programming the UI.
You can develop Flex applications under Linux easily but with Flash you simply can't.
Another solution that was not suggested at here, will be to use them both. You can add flex components to flash movie clips using ContainerMovieClip. And you can add flash movie clips to flex components using SpriteVisualElement. Another thing that wasn't mentioned was lay-outing your application. It will be flex pros against flash disadvantage, because you got build in flex lay-outing system. But again when you are using them both, you can layout your movie clips with flex lay-outing system.
Also flex become Apache top-level project. And it become more and more excepted by the community now.
Flash and Flex are 2 complete different things, one is a design tool with support for action script, the other one is a framework that also has action script but is maily built around MXML which is a XML based UI definition "Language".

What features distinguish Flex from DHTML?

I just got started using Adobe Flex SDK. I was very excited because it's the first time I've found a good, free way to create Flash applications. But then I noticed something: Flex doesn't seem to be much about making animations or designs. It seems more like an application to build forms and menus and the like... which I can already do in (D)HTML.
What features does Flex have that make it better than HTML in some cases?
Also, are there any techniques/software programs that would allow me to add the flash/design components that I mentioned earlier?
Thanks!
Flex, like Silverlight, is marketed for the creation of something called RIA = rich internet application. The idea being that (D)HTML isn't really well-suited to create large-scale, well-responding applications on the web. I'm not sure whether this is really (still) true but historically, it fits.
Flex and Silverlight attempt to correct this by providing two things: a different, extensible technology along with a large library and an adapted toolset for the creation of applications. The disadvantage in both cases is the dependency from further (non-free, non-standard) components. The advantage is a potentially much more productive workflow and better performance.
Flex has a cohesive component model, and the basic building blocks were designed to support applications. HTML, on the other hand was designed for displaying text, and the DOM is a sorry excuse for a component model -- and it was most definitely not designed with applications in mind.
There is a plethora of JavaScript libraries that try to implement a workable platform on top of the DOM, and to even out the differences between browsers. While these work fine in many situations most of them don't come near the richness of the Flex component model, or even the more basic Flash API:s.
However impressing libraries like Dojo, YUI and jQuery are, they are limited by the platform, and it is limited indeed. Flex has all the benefits of the Flash Player platform, like vector graphics, remote objects, video support, cross-domain loading, sockets, font embedding, etc. but also a very good component model, data binding and skinning capabilities, to name but a few. If you're writing rich internet applications Flex is as rich as it gets.
Flex is a layer on top of Flash, and was designed from the ground up for building applications. As such it has very powerful capabilities when it comes to interface construction and data manipulation. If you are interested in movies and animation sticking with Flash is more appropriate.
The advantages of Flex over DHTML (AJAX) include:
- Faster prototyping
- Better cross-browser support
- Better support for data management
- More "serious"
Disadvantages include:
- Stuck with a single vendor
- Requires the Flash plugin
You can do audio and video in Flex/Flash vs DHTML.
Some more details and comparisons are in this The Top 10 Things You Should Know About Flex article.
If you're interested in leveraging the graphics potential of Flex, why not go check out Degrafa which is an open source graphing and general graphics api. It's pretty cool, very well documented, and quote - "Adobe has asked if the Degrafa team would consider helping directly contribute to the Flex Graphics open source effort." - which they are!
It's not just all about charts and graphs.
Just a quick clarification - to be clear, Flex is built on top of Flash. What that means is that anything you can do in Flash, you can do in Flex when it comes to programming. Flex Builder does not come with any tools that let you make animations with timelines or vector art or anything like that, but all of those elements are still usable provided you have the tools to make them elsewhere.
Flex is really about bridging Actionscript 3 as a language and Flash as a runtime into an environment where application programmers can feel truly comfortable with it.
As stated above, "Better cross-browser support." That's probably the biggest factor right now for me.
A few more...
It's a lot easier to get "pixel perfect" designs in place.
It's really easy to integrate Flash content into Flex. Which makes it easier to work with designers.
Actionscript is better than Javascript (go ahead and flame me!)
There aren't any really good alternatives to buying the Flash product for making timeline based animations.
The bad sides:
Sometimes, html is just plain easier / more powerful
Make sure to pick the right tool for the right job. Sometimes DHTML, sometimes Flex, sometimes Flash, and many times a combination of those.
What you're talking about is Flash versus Javascript. Flex is Flash, DHTML is Javascript.
Flex allows for rapid prototyping, an alternate IDE for building Flash .swf s, and fits nicely into Air - Javascript only runs in browsers, includes less animation support by default (although there are plenty of well-established libraries that provide that functionality) and doesn't require a plugin to work.
Also with Flex you don't have to deal with JSON, XMLHttpRequest, compatibility issues and the likes... Everything works like magic.
Unless you need a lot of animations, HTML will feel more lightweight than Flex.
No "loading" screen.
On OS X performance of Flex is abysmal. Even DHTML animations are faster! (see GUIMark).
HTML has wider compatibility than Flex. It may not be as easy as writing for single implementation from single vendor, but OTOH you're not limited to that single implementation:
No problems with iPhone or 64-bit Linux.
With graceful degradation basic functionality might even be accessible from Lynx or BlackBerry browser.
HTML is better integrated with the browser and OS:
Form elements can have native look'n'feel.
Text has preferred type of anti-aliasing, no problems with ClearType.
Keyboard shortcuts, context menus and text selection work as expected.
Browser extensions can improve DHTML apps, but Flex is impenetrable.
Accessibility tools have better support for HTML.

Resources