CDC finger-friendly - java

I've been working in a Java mobile project using j9 as a virtual machine. So far the project has been developed for an stylus interaction using AWT components.
We want to create a new version of the application more finger-friendly the internal logic is working OK so we wanna keep it, it is just the interface that we want to update.
From what I´ve read the alternative is the LWUIT library, however it is just for CLDC configuration or for JavaTV, and the implementation on Java TV apparently doesn't work on J9.
So, any suggestion? anyone have done something finger-friendly using j9?
I'm thinking in develop buttons as images and give the fight against the layouts to make it look good, In other words, create the finger-friendly library from AWT, but I still having doubts about this approach, because there are some things that i don't know if possible, like the finger drag&drop to move between pages.
Anyway, any Ideas of how should I approach this challenge will be very appreciated!
Thanks,
Gustavo.

As far as mobile java on mobile windows, J9 is the way to go. I've used it for a few projects and it fit the bill perfectly. I used it on a rugged hand-held device and developed a few applications for measuring shellfish. The interface was geared for both left and right handed people and aimed at the stylus as well fingertip interaction.
I think the toolkits you're looking for are SWT and JFace. JFace is what gives you the flexibility to create really slick UI elements without a lot of code. There will be some small differences between your GUI designer and the actual device display - but nothing horrifying. Installing and configuring the jars on the device is pretty simple, and if you integrate rapitools and the cab wizard into your ant build you can come up with some slick deployment and installer solutions.
Grab this book and get started.

Related

MDI in SWT on Linux?

I'd like to create an MDI application using SWT.
I've done extensive searches and reach that the Decorations Object is the one responsable for trying supporting behavior. However, I've a Linux box, and the example provided
doesn't work for me.
The output of the example provided by the above link is:
Image
However, on Linux (GTK), I see only labels without control bars or boxes!
You might want to take a look at the Eclipse Rich Client Platform. It's built on SWT and gives you the full flexibility of the Eclipse User Interface (with views and editors) - and lots of other interesting stuff like a smart plug-in and modularization system or a full-fledged online help. Take a look at the RCP Mail Demo - it's a simple demo program that shows you how to create different views and move them around. (I'd offer my tutorial, but it's written in german. You'll find lots of good stuff around the net.) If you're still interested, there's a book named Eclipse Rich Client Platform available by Jeff McAffer - excellent guide.
Use the Novocode Application Framework. It has a Desktop Form for exactly that, and I like it, even if tabs are all the hype now. I already used it with great success!
(source: novocode.com)

How do "professionals" make a GUI in java?

Thanks for your answers to my previous question about GUI in java. I now wonder what are the solutions chosen by professionals to get a nice GUI, for "real" applications. Do you use swing and JComponents and just change the "look and feel" ? Do you prefer awt or another library ?
Sorry if that question sounds weird, I'm a student and I don't really know how java is used in the real world...
In our company we use Swing, as that is supported by the JVM out of the box, but we do use color coded background colors for some panels and buttons.
If we'd use something different, like SWT or Jambi we'd also have to roll out those frameworks for all platforms, and test those frameworks for all OSses and (supported) java versions. Not nice at all.
It is however fairly tricky to create a nice responsive application with Swing; so you really need to use SwingWorker and the like. With a bit of experience however you can create a nice application that way.
And even if it isn't the fastest framework to develop in, development time is really small compared to defining the functional requirements of the user interface, and testing and support when the version is released.
That said, our target is desktops. If you target mobile devices or also need a web frontend your choices may vary.
I don't believe anyone prefers AWT anymore. Swing supplanted it entirely eleven years ago, building on top of it to correct flaws in the AWT 1.0 design.
Swing isn't the only way that professionals make Java UIs. That works for desktops, but there's also JavaFX now. For the web, UIs are built using HTML, CSS, JavaScript, and JSPs.
My experience is that most organizations that want to create rich GUIs still use Swing, and manually go through all the annoyances of layout managers, etc.
The use of SWT is fairly limited to organizations that are using the Eclipse RCP as their platform. I'm not sure why it hasn't caught on outside this platform.
It's sad to admit, but Java Swing GUIs don't generally look good unless you spend a lot of time creating a more native feel for them. Even then, they often lose out on aesthetics to equivalent programs written specifically for Windows and which use Window APIs like WinForms.
The most decent Apps I saw in the last years were build using Eclipse Rich Client Platform
Eclipse uses the Standard Widget Toolkit
and provides Graphical Editing Framework (GEF)
We typically use Swing becuse it's supported in standard JREs out of the box. Normally we do the initial form design and event hookup in Netbeans and then export it to whatever we wish, Eclipse, for example.
Netbeans spits out pure Java using standard libraries (plus a jar or two you have to include) so it's no big deal designing the form in Netbeans and later moving on to something else.
Some people suggested doing form layout by hand using a layout manager. I see that as an option only if you are doing something big and very well budgeted that has to be maintained ad infinitum. Otherwise it's just too time consuming to be worth it.
We rely on SWT for our Java GUIs. Yes, you have to include an external native library, but the look and feel is native, more responsive (although Swing has become much faster in the past few years) and seamless with other apps on the target platform.
Macintosh OS X creates their own Java runtime. They give Swing components the same look and feel as native applications.
I use strictly Swing. I distribute "real" desktop applications via Web Start for both Mac and Windows that interface with the user's smart card reader.
The NetBeans IDE gives you a WYSIWYG way to create your forms. I've tried it out, and it's pretty neat, but we still use Eclipse as our IDE and design the forms in code.

What should I choose SWT or Swing to program GUI in Java?

I need to create a GUI application in Java. I just realized that I have different optional ways to go (SWT and Swing are among them).
I have already found out that there is a lot of discussions about what way is better and I do not want to go to deep into these discussions (I am a newbie).
I do not care about all aspects of the dilemma. I just have a few main requirements listed bellow:
It should be easy to use (easy to create what I want).
In the end I would like to have just one file which can be easily executed (without any additional tricks, settings and installations) like a standalone application.
It should be platform independent. Or more specifically, the application should work fine on Microsoft-Windows and Ubuntu (Linux).
Based on your requirements, I would say Swing. SWT has a more platform-specific look about it but Java ships with Swing built-in, there's no messing about with external libraries as with SWT although the use of Eclipse may make that much easier (I still develop quite a bit of my stuff from the command line unfortunately).
They're both easy in terms of use (well, easy once you get used to layout managers) and will work fine under both your desired platforms but since the only differentiator you seem to care about is the "without any additional tricks, settings and installations", I would stick with Swing.
That's my advice. Feel free to accept or ignore or even call me an old coot. I won't take offence :-)
I just completed a two year project creating a buisiness application, so my focus was clearly on usability and speed.
My decision in the end clearly led to SWT, for the following reasons:
Buisiness users tend to use Terminal Servers and RDP for their apps. Every Swing app is very slow over RDP, because the app has to render every pixel again and again. Try using Photoshop or Gimp over RDP and start scrolling in an image. That is the performance you have with Swing in tables.
Some very good gui components are only available as COM objects. I wanted to be able to use those, and since 100% of all buisiness customers are Windows users, they accept the fact that your software only runs on Windows. (We have linux clients, too, but only for machine input terminals, that don't need the full blown Windows GUIs)
We use SWTDesigner as a GUI designer, which is as good as SwingDesigner für Swing (which both are the best GUI designers at all). They are worth the price tag if you have to create a few hundred masks.
Our GUI looks 100% native, honors the large fonts they use on their desktops, and feels fast.
We are very satisfied with SWT, but it has some downsides:
Native Java components are a bit rare. There is more on the Swing side of life.
I would suggest that you use Java's Swing libraries if you are not familiar with Java GUI development. They are very well documented, and there are lots of tutorials on-line, including on Sun's Java website (here).
GUI development in Java is not very straightforward, but the tools available are getting better all the time. I would suggest you try out the NetBeans IDE that has a nice visual designer for GUI components. I have not used the Eclipse IDE's GUI designer, but I gather its good as well. You will need to get your head around the MVC pattern, but it should be a good learning experience.
In short, my vote goes for using Swing/JFC, especially if you are new to Java GUI development.
EDIT - You can control the look and feel of a Java APP very easily. If you use the platform independent (Metal) look and feel, your GUI will look pretty much identical on Windows and on Linux. Of course, a Java app will run just fine on Windows of *nux as long as there is a supported JVM installed.
I cannot add comment yet because I'm new here (please mod me up so I can comment) but choosing Swing or SWT depends on the IDE you're using.
If you're using Eclipse, then both are fine.
If you're using the free IntelliJ IDEA community edition, you'll prefer to use Swing because the IDE's GUI editor is "Swing only".
I take it you're using Eclipse?
Based on your requirements, I recommend using Swing:
SWT requires additional native libraries (violates item #2),
You are likely to find more instructional material on Swing (since you are a newbie),
Both solutions are somewhat platform independent and supported on both platform you mentioned but SWT is not equally supported on all platforms,
There are more WYSIWYG tools supporting Swing which may help with the learning curve.
Note that the APIs are similar and sometimes identical so learning one gives you a head start on the other.
I find Netbeans' drag and drop visual editor and pre-wired Swing Desktop Application template much easier to use that what comes bundled with Eclipse, so I'd suggest that.
It'll automatically create an executable jar, and let you create a Java Web Start launcher if you wish as well. And being Java, it's OS-independent.
Here's a link to the quickstart tutorials.
Swing,
SWT works on Ubuntu but not nearly as well as on Windows, that's at least my experience. The main reason to choose SWT is if you want to build your application on the Eclipse RCP framework( where you get a dockable views/editors, plugin mechanism, automatic updates, user roles. help browser, preference mechanism etc) or if you want your application to have that polished native look.
From my experience, if you want easy to develop Swing is the way to go. If you need good performance, then SWT is a better bet.
NOTE: The last time I did GUI development in Java was 4 years ago.

Android Framework?

Are there any frameworks out there which make it even more easy than it is to build Android applications and would you be interested in one?
Soon there will be!
I am working on DroidFu, an Android shared library which will give you:
tons of utility functions available directly in Activities (and Services), such as spawning list and error dialogs, checking for Intent availability, and other workarounds/replacements for cases where Android lacks desired functionality
easy handling of asynchronous tasks (takes care of resurrecting dialogs after orientation changes)
Easy XML parsing using a convention over configuration based XML pull parser
new adapters and widgets, such as as ListAdapterWithProgress (rendering a loading spinner as the last element when loading something) or a GalleryItem widget which will lazy load an image via a URL while rendering a spinner
an ImageLoader which can load images from the web asynchonously, backed by a FIFO cache, great for rendering avatars in lists and stuff
I plan to make this available on GitHub.
stay tuned.
update (Feb 2013)
Sorry to say that no one is working on this anymore. All people involved in the project have moved on, and since the lib was mostly used in the Qype app, no one feels like maintaining it anymore (Qype got acquired by Yelp btw, so I'm not even sure if we would be allowed to, since most of it was developed during my working hours at Qype.)
For anyone who feels like salvaging it, sources are here.
I just found out about App Dev Wiki. As described on its website:
This wiki is meant to collect links, tools, libraries, and anything
that is useful for mobile development.
Currently listed android frameworks are:
ignition
droid-fu
RoboGuice
Commonsware
ActionBarSherlock
Spring Android
DroidParts
One of the best right now IMHO is Appcelerator
Free and open-sourced, develop one app for all major platforms (cross-platform), compiles the app to native code, has a rich API...
I enjoyed playing with it.. very easy to learn :)
Hope this help!
P.S.: even though it sounds like I work there, I don't... unfortunately for me :(
Not really a 'software framework', but a tool to create simple apps easily (that's what Google says):
http://appinventor.googlelabs.com/about/
I don't use this tool since I'm not a big fan of this approach, but you could give it a try.
You can build many different types of
apps with App Inventor. Often people
begin by building games like MoleMash
or games that let you draw funny
pictures on your friend's faces. You
can even make use of the phone's
sensors to move a ball through a maze
based on tilting the phone.
But app building is not limited to
simple games. You can also build apps
that inform and educate. You can
create a quiz app to help you and your
classmates study for a test. With
Android's text-to-speech capabilities,
you can even have the phone ask the
questions aloud.
To use App Inventor, you do not need
to be a developer. This is because
instead of writing code, you visually
design the way the app looks and use
blocks to specify the app's behavior.
There's also phonegap, which you can use to write android apps using html+javascript.
http://www.motherapp.com/ apparently converts 'HTML' to 'applications'.
There are several frameworks of different scope and purpose to make mobile application development faster, or cross-platform, or code-free.
Technology thrives on competition and new ideas, so please don't take the presence of several other solutions as a deterrent from making your own if you think you can build a rounder wheel.
The Simple framework is fully compatible with Android. Its an annotated approach for XML serialization and data binding, and is fully bi-directional. So you can read or write XML on the Android platform. Whats more is its really lightweight and has no external dependencies. In essence its like a JAXB substitute for the Android platform. For more information check out the Tutorial.
To continue the list :
I am working on the BARACUS framework, which focus is to ease the pain of Android component development.
Current features:
Bean Container with Dependency Injection (type based on Interfaces or Implementations)
pure Java Configuration
Bean lifecycle management
Tiny OR-Mapper solution to have basic ORM w. lazy loading and automatic Row Mapping
Declarative form validation
Database hot backup and recovery
Automated database version management + automated migration
The library is available through maven central repository (including a maven archetype).
Also, a set of tutorials is available on blogstpot
The library is Apache2 licensed, open source (on github) and free usable in any projects (commercial+non-commercial).
I have completed developing an Android Framework for everyone to be able to use easily and quickly. I already developed several applications with that and it is called appFramework and as you can see, you will be using almost every feature and latest libraries in seconds with just extending or implementing the classes i have already created in the library. Setup process is already included, rest of using roadmap is up to you!
Already Created Classes of Features:
Google Map
Recycler View
Retrofit
Firebase Auth
RunTime Permission
CircleImageView
BottomBar
Tag Styled Picker
Right or Left Swipe Actioned Layout (FlingCard)
Material SearchView
AppCompatActivity
Drawer
Tag Activites of Fragments
ConfirmationDialog
Have a nice coding!

Java ME UI libraries

I'm developing a Java ME app & need pointers to some really good UI libraries. I did see a few such as Java ME Polish. Are there any more out there? For e.g. ebuddy's java ME app has an amazing UI and so is gmail's java ME app. What libraries would they have been using or would have they have developed it on their own?
Sun recently released and opensourced their solution to crappy looking lcdui. It is called LIghtweight UI Toolkit and can be found on lwuit.dev.java.net
We have been trying lately on kuix.. So far so good and more light weight than LWUIT
code.http://code.google.com/p/kuix
eSWT would be available for MIDlets on the latest J9 VM, as used by the Series60 3rd Edition feature Pack 2 handsets (Nokia N78, 6210, N96...) but we're mainly talking about nicer looking UI controls. Basically, a MIDlet can look much more like a native application now.
Sun has recently open-sourced LWUIT.That could also be worth a look.
Nothing beats drawing your own images on a Canvas,though. Generic layout managers in any kind of library will only get you so far. You should only look at the available technologies once you have a good idea of how many different kind of screens your application should have and what they look like.
Most of the apps with amazing UIs (Opera Mini, Gmail, any game from an AAA developer) use custom UIs developed in-house. These developers take the task of developing an UI as one more in their projects and give it personality, involving professional graphic designers. Going with a packaged library would quickly accomplish the task but it would make the application look generic and bland (less bland that with the default UI, but still bland and limited).
In short, go with a packaged UI for quick development, but don't expect the level of quality to be near the apps you mentioned.
I'm facing a similar dilemma right now. We're currently using the default, high-level LCDUI framework for the speed of development, but its severely limiting what we can do. I had thought our best option would be to use a third-party UI framework, but I'm now coninced that if we're serious about the application we should write our own. Its like anything in software, if its mission critical to your application you should write it yourself, even if it that means re-inventing the wheel.
Digitalapes has developed a framework for J2ME application development that includes a high level UI library.
The library is lightweight and well documented, you can get have a look at the Gear framework page for more information, or you can directly download the JAR and javadoc from Gear's sourceforge page.
Digitalapes blog includes also a series of tutorial about how to use the framework.
Polish has really nice set of UI components, which are skinable with css style comments.
It also features a device database for compatibility purposes.
Some tipps if you decide to go with polish (as i did):
Use eclipse and the mepose plugin. The netbeans integration is really nerve wracking.
The bulletin board is dead, so by all means !use the mailing list!.
If you are not familiar with the ant building system, you better start now.
The J2ME Polish book is not worth its money. (My opinion). The documentation on their website and the sample coded are enough to give you a solid start.
I've used SWT when deploying to a full profile J2ME (IBM J9 on PocketPC), I don't know if it is usable by MIDlets however. It's quite a nice GUI library in its own way, and far better than AWT.
Unfortunately companies usually end up designing their own GUI's when it comes to mobile development. It's the only way to have full control over your interfaces, but you should consider if it's worth the additional development time, and you're also on your own when it comes to device compatibility issues / handset bugs - of which there are plenty.
If you are happy with a less flexible interface, you can go with one of the existing libraries. I currently use J2ME GUI from http://www.garcer.com/. We get the same flexibility as with desktop development and it also features custom styling, so with a little extra effort you can make it look the way you want it to.
You can use LWUIT for the UI development in J2ME framework.

Categories