Is ZK open source edition "write once, run anywhere"? [closed] - java

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I've been looking into using zk for my upcoming Java web project, but am a little skeptical because as awesome as it seems, it has an expensive licensed edition as well as a free open source edition.
I could only use ZK Open Source edition but need the "write once, run anywhere" functionality (otherwise I will probably go with GWT/Phonegap).
On their feature comparison page, they don't mention write once/run anywhere, so I'm wondering if any battle-weary ZK veterans can weigh-in on whether this feature runs on the free version or not, and how well.
I need to support all web browsers, mobile web, all Android devices (including Nook/Kindle), all iOS devices, Microsoft devices (Surface, etc.) and Blackberry.
Also, if the free/open source edition does support this feature, how does it work? Nothing in the tutorials seems to indicate how it generates native executables for the various platforms in addition to a WAR...

No.
ZK only builds Java web archive files (war), it does not build native applications for Android, iOS, Nook, Kindle, or even stand alone applications for the desktop.
ZK web applications only run in a Java application server like Tomcat, JBoss, Jetty, Glassfish, etc.
In this sense, ZK is very similar to GWT and very disimilar to PhoneGap.
With PhoneGap you build phone applications using HTML, CSS, and JavaScript. Your application is then displayed inside a native wrapper compiled for each phone platform. This is not intended for the web, per se.
With GWT you build web applications in Java code. Some of this Java code actually gets compiled into JavaScript so it can run on the client side when appropriate, offering performance advantages if used well. Writing JavaScript code as Java has the advantage of going through the Java compiler for type safety and the like.
With ZK you build web applications in Java code. Unlike GWT, this never becomes JavaScript - all your Java code runs on the server. ZK handles setting up the AJAX calls.
Programming in ZK feels as though you have a copy of the DOM as Java objects. ZK deals with initializing your Controller for a particular View and you can ask it to wire up any Component from the view. You then have those Components as objects and any changes you make are immediately (more or less) reflected on the client.
Now, ZK aside..
If you want to write code once to run on all web browsers as well as on all phones, the only option is to write a web application. At the curent state of technology, you will not be able to get native executables for all phones and a get a web application from the same code base. If you develop a web application (using ZK, GWT, IceFaces, Lift, Grails, whatever) you can expect the maximum penetration into the market as almost all devices have a web browser.
Finally, some personal opinions on ZK..
The development cycle is fantastic, I love programming with ZK.
The team and community is great also, lots of momentum.
The framework is actively evolving, new core features and improvements all the time.
I'm not sure how it would stack up against the others under heavy load.
The DOM they generate is very heavy
There is a lot of chatter between the client and server
Edit:
PS: I found this old reference to something called ZK Mobile which I think is now a dead project. My impression is that it was probably aiming to be something similar to PhoneGap in that it would just wrap your ZK website in a native Android application. Everything would still work over the internet but the user would have an icon on their phone. You wouldn't have access to any native functionality like alarms or the like.
Anyway, just thought I'd put it here for the sake of completeness.

Related

Are Java and JSP really so different? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am planing to rewrite my desktop finance application (written in Delphi) as web application and am thinking which technology to use. Other possible requirement is to transfer as much code as possible to shared library which could be used in desktop version of the application too. There is no such parameter as total cost of owhership. I can rewrite it as long as I want.
I need a cross-platform technology which is able to handle UTF-8 natively and connect to PostgreSQL as well as Microsoft SQL Server.
I have programmed enough with Ruby on Rails and will say that it is quite good for commercial websites but does not fit for my own web application, as I do not like its "magic" and inability to write .rb files in UTF-8.
PHP seems to be similar to RoR although I haven't tried it.
ASP.NET / .NET MVC meets my requirements except it is for Windows only.
So, I've chosen Java. But they say in Internet that Java and JSP are different technologies and I can not take Java desktop application and with very little changes convert it to JSP. Are Java and JSP really so different? For example, in .NET I could write a database- and business-logic-library which could be used in desktop application as well as in ASP.NET application.
Java and JSPs are not different. JSP gets compiled into Java Servlet before execution.
JSP is meant for writing HTML/ASP like code dealing with presentation. In other words, it gives segregates presentation detail from Java coding, but in the end, server compiles your JSP files into Java Servlets.
What you want to write in JSP, can be written through Servlet.
If you plan to use JSP over Servlet, please make sure you are not writing entire code in JSP itself e.g. reading data from database. All the business logic should go in JAVA classes and used in JSP through your JAVA classes. Your Java classes can be reused if designed appropriately.
If I understand you right, this is what you are trying to achieve i.e. achieve re-usability of your application logic.
They are not that different besides you can reuse your services, logic etc. in the same way .NET does it.
The only problem is the view, there are many ways of doing it in java. If you've chosen JSP you will need to code all your presentation (you can invoke your services, logic, etc.), but if you want reuse as much code as possible in a Desktop java application an take it to the web perhaps your should take a look at java Applets which are relatively simple to turn into a java application.
For the situation that you describe it should be pretty easy to have a lot of shared code for both the desktop and the web application.Think of the application as consisting of 2 layers:
Layer 1: Business logic and Database access code, this layer just pure java it should not depend on any technology that can not run outside the container. For example, you can use JPA for database access, and Spring to organize your business logic into nice modular units. If you write a comprehensive test suite for this layer, then you would have confidence that your business logic works correctly and it would it make it easier to figure out if a bug is a web app bug or a desktop bug.
Layer 2: UI logic, you will need two instances of this layer, one written using a desktop UI technology like Swing,or JavaFX and another layer UI layer written in a Web application programming technology such as JSP / Servlets, JSF, SpringMVC, .... etc. This UI layer will depend on the Layer 1 and because of the comprehensive test suite for layer 1 you can be confident that the operations it calls upon on layer 1 are good.
As far as web development technology I would recommend that you consider higher level frameworks that JSP and Servlets, because that will save you a lot of time.
There is a possibility to be able to write a single UI layer using JavaScript, HTML 5 which is a web app but behaves like a desktop app for many features. You can then make a desktop version of your product that basically launches a browser windows without the chrome and runs the app within it. If you do choose to go down this road of using JavaScript and HTML 5 there are plenty of frameworks to choose from, I would recommend that you watch the videos on infoq.com from the ThroneOfJS conference http://www.infoq.com/throne_of_js/ to get an idea of what frameworks are available my biased recommendation would be for using AngularJS.

What do you use to write cross-platform client apps? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm writing a client app, quite old school, quite conservative. On Windows, I'd probably use .NET Forms, or maybe WPF, I'm not sure. On the Mac, I'd use Objective-C, Cocoa, and all that stuff. But I want this app to work on both, and I'd rather only write it once.
Should I write it in QT? I heard that when you get down to it, QT is buggy when you use it across platforms. Do I have to worry about continuity, what with Nokia's recent troubles? What does the community think about Digia?
Should I write it in Java? Newer Mac OS doesn't come with Java anymore, and Windows never has. How can I create a good setup experience like that? What about USB devices? There are some Java USB projects, but they're all Windows or Linux based, no Mac. I'm also worried about getting a native look&feel, but I guess Swing has me covered there.
Should I write it in Python? I'm worried about performance here. Also, I've written large Python apps before, and I found that Python scales poorly to large code bases, because of the lack of static analysis.
What do you write yours in?
I asked a similar question a few weeks back Building a Mac and Windows GUI Application.
With regards to "native look & feel": If you want this, don't use a cross-platform GUI library. Write the GUI layer once for each platform. You can share the core application logic. You can probably get away with using Qt or wxWidgets on Windows and Linux since requirements for look and feel are more relaxed, but it will look rather out of place on Macs.
If "native look & feel" isn't essential, I'd say go with Qt or wxWidgets and save yourself the headaches. I wouldn't worry about continuity for Qt. Its desktop framework is very mature and isn't maintained by Nokia (they maintain the mobile part). The open source community will keep it alive. Don't know how buggy it is, but what cross-platform framework doesn't have its share of bugs?
If "native look & feel" is essential, read on for languages choices for the core application logic.
Java: Don't. Swing doesn't actually provide a native look & feel. Just try and make any comprehensive GUI with it. Swing is also very painful to program in. There are plenty of alternatives to Swing, but I doubt any of them will be better than Qt. In addition, most apps will probably need to hook into the OS. Java bridging on Macs is deprecated. You'd have to use JNI for any extensions. Probably the same for Windows.
Python: That's the path I took. Python is not only cross-platform, it comes with a rich set of cross-platform libraries. Also easy to write C/C++ extensions on any OS. Downside is that it's relatively slow to start and takes more memory than a native C++ app. Trying to set up a deployable application is rather painful too. I wouldn't worry too much about performance though unless you plan on doing serious data processing.
C++: Also a good choice. It's not too hard to write a cross-platform app with C++ if you use cross-platform libraries like Qt or Boost (haven't tried, conclusions from questions and research). Also compatible with xCode, Visual Studio, etc, so it's easy to set up the project.
Being mainly a Java dev I lean heavily to java. Your concerns with java can for the most part be handled.
One I would JavaFX instead of Swing. It is still fairly new, but I have been playing it recently and it is pretty nice. You should be able to create what ever look you like, and it be pretty consistent. The other added benefit, is that they are adding Native packaging for JavaFX. It is still early, and that is not in the stable releases yet from what I understand.
No matter what you go with there will be hurdles and issues. So regardless of what I said above, you should pick whatever you are most comfortable in. Heck you could if may even be able to go the .net route and use Mono. I hear Mono works well, especially with projects built using it from the beginning.
There are number of options available to you
Java application
Web application
Use a wrapper like App Accelerator
Java Application
Writing a Java application which is platform independent would suite your need. But development wise you might face problems. Specially GUI experience.
Web Application
Web application is the right way to go but installing it and setting up a web server in local machine might be bit tricky. Moreover if you want to host the application this is the way to go.
Application Wrapper (App-Accelerator)
If you can use an application wrapper it will work in pretty much any platform - windows, mac os. A good example might be Wunderlist.

How to port Android application to iOS platform? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm developing an Android application and I would really like to deploy it for the iPhone as well.
However, I do not know Objective-C and I think it would take an annoyingly long time to figure that and the Apple framework out.
Is there a recommended way to port an Android application to iOS? Would the best bet be to hire a freelancer?
On the run now (home time ;-) ), so my answer will be concise (sorry)
Take a look at/Google (in no particular order):
MoSync <- Compiles C++ native apps to several mobile platforms, including Android and IOS, GPL for non-commercial projects.
AirplaySDK: Similar to MoSync, mainly commercial, has some free licensing for one of the 2 environments you're after (believe that's IOS, please verify yourself). Has been used comercially by Konami, Activision etc.
OpenFrameworks (OF) - Collections of C++ 'wrapper' code which enables unified cross-platform development of Audio/Visual projects (could be used for Games etc). The Android port is beta, see Android/Eclipse/OF Installation and the Android port's GitHub repository/developer (branch 0062_Android). The iPhone-specific code is quite complete (accelerometer access, etc. etc.).
XMLVM - It allows some level of porting from Java to a native IOS executable. Not sure how far forward this project is, and you might need to implement some of their framework classes (relatively trivial if you've got good separation of your existing Java libs).
Personally, I'm looking at OpenFrameworks right now, mainly as I like the 'One API' concept and I'm avoiding Objective-C for the moment (Want to ease myself in, I'm a Java/C# dev).
Edit: Notice that since this answer was written XMLVM development has stopped. Also Codename One came out in the interim and provides a path for Java developers.
Cheers
Rich
Your best bet for X-plat is HTML 5.
You will not be able to automagically port your native code because Android and iPhone use completely different patterns for developing all aspects of "the app".
Right now I've only seen MonoTouch (now Xamarin) available for cross platform development, which allows you to develop in .NET targetting the iPhone.
I have not seen a similar product for Android, but would a .NET based conversion process be feasible? The pricing is not outrageous.

Are there any new/updated Java web development frameworks to watch for? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I know recently Spring 3.0 was released which brought about a nice new set of features and ease of web development with their MVC package. However are there any new frameworks on the horizon and/or new versions of other frameworks that a web developer should have their eyes on?
I heard about the Stripes framework, but it seems as though development has stopped. It also seems grails has a new release coming out as well which that looks like it is just an update to support the new features in the latest groovy release.
Apache Wicket - light-weight component-based web application framework with strong separation of presentation and business logic.
Look also at the Spring Roo and Play framework and I almost forgot about the Vaadin. There are often enough new/upgraded java web frameworks:)
Have a look at JSF with JSR-299 in the Java EE 6 standard. You can do quite a bit, and it is standardized.
Version 2.0 of the Google Web Toolkit was released back in December. Some of the new stuff:
Development Mode: Previously you needed to use a "hosted mode" pseudo browser to quickly test your code (i.e. avoid a compile/deploy step). In 2.0, development mode allows on-the-fly running and debugging in any browser. This give big wins in speed and tooling (you can use Firebug etc.)
Speed Tracer: A plugin for Chrome that gives you highly detailed performance profiling for your GWT (or any) client AJAX code.
Compiler Optimizations: One of the great things about GWT is that the compiler is improved almost with every release meaning that you get a performance boost just by recompiling your code.
Code Splitting: You put 'splits' in your code, allowing the browser to download just the code it needs to get started and download the rest when it's needed (great for apps with very large amounts of client code).
Declarative User Interfaces: Define UIs in XML. Much less boilerplate code. XML<->Java integration via annotations.
Layout Panels: Improved, standards-compliant, base panels.
Bundled Resources: Image bundling from previous resources has been generified to allow any type of resource to be "bundled", reducing the number of requests the browser makes and allowing your app to load more quickly.
GWT works especially well with a good IDE (Eclipse or IntelliJ) since the IDE can take advantage of compile-time information from GWT, validating, on the fly your client code (since it's Java) and also things like CSS class name references and references between XML UI definitions and backing code.
I thought it was worth noting this as I just heard about the new release on java lobby. The
lift framework. It is written in scala, which is java per say.
Appfuse - Not really a framework, but it might be worth a look if you're looking for something to ease the initial ramp up effort on a Java EE project. It provides a bunch of Maven 2 archetypes that will create a "ready to run" application based on any of:
Struts 2
JSF
Tapestry 5
Spring MVC
Struts 2 is also very much worth a look. Totally different animal to Struts.

How do you make websites with Java? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
This might be a really trivial question, but I've been writing Java programs at my school and I just found out that I can create websites with Java as well.
How can I do that? Any good books/tutorials for that?
Which is better for Web development, Java or PHP?
Also, when using PHP, MySQL comes into picture and while writing Java programs for desktop, we just use File I/O, so what is better for web dev, File I/O or MySQL?
You are asking a few different questions...
How can I create websites with Java?
The simplest way to start making websites with Java is to use JSP. JSP stands for Java Server Pages, and it allows you to embed HTML in Java code files for dynamic page creation. In order to compile and serve JSPs, you will need a Servlet Container, which is basically a web server that runs Java classes. The most popular basic Servlet Container is called Tomcat, and it's provided free by The Apache Software Foundation. Follow the tutorial that cletus provided here.
Once you have Tomcat up and running, and have a basic understanding of how to deploy JSPs, you'll probably want to start creating your own JSPs. I always like IBM developerWorks tutorials. They have a JSP tutorial here that looks alright (though a bit dated).
You'll find out that there is a lot more to Java web development than JSPs, but these tutorials will get you headed in the right direction.
PHP vs. Java
This is a pretty subjective question. PHP and Java are just tools, and in the hands of a bad programmer, any tool is useless. PHP and Java both have their strengths and weaknesses, and the discussion of them is probably outside of the scope of this post. I'd say that if you already know Java, stick with Java.
File I/O vs. MySQL
MySQL is better suited for web applications, as it is designed to handle many concurrent users. You should know though that Java can use MySQL just as easily as PHP can, through JDBC, Java's database connectivity framework.
Read the tutorial on Java Web applications.
Basically Web applications are a part of the Java EE standard. A lot of people only use the Web (servlets) part with additional frameworks thrown in, most notably Spring but also Struts, Seam and others.
All you need is an IDE like IntelliJ, Eclipse or Netbeans, the JDK, the Java EE download and a servlet container like Tomcat (or a full-blown application server like Glassfish or JBoss).
Here is a Tomcat tutorial.
I'll jump in with the notorious "Do you really want to do that" answer.
It seems like your focus is on playing with Java and seeing what it can do. However, if you want to actually develop a web app, you should be aware that, although Java is used in web applications (and in serious ones), there are other technology options which might be more adequate.
Personally, I like (and use) Java for powerful, portable backend services on a server. I've never tried building websites with it, because it never seemed the most obvious ting to do. After growing tired of PHP (which I have been using for years), I lately fell in love with Django, a Python-based web framework.
The Ruby on Rails people have a number of very funny videos on youtube comparing different web technologies to RoR. Of course, these are obviously exaggerated and maybe slightly biased, but I'd say there's more than one grain of truth in each of them. The one about Java is here. ;-)
While a lot of others should be mentioned, Apache Wicket should be preferred.
Wicket doesn't just reduce lots of boilerplate code, it actually removes it entirely and you can work with excellent separation of business code and markup without mixing the two and a wide variety of other things you can read about from the website.
Also be advised, that while Java is in general very beginner friendly, getting into JavaEE, Servlets, Facelets, Eclipse integration, JSP and getting everything in Tomcat up and running is not. Certainly not the easiest way to build a website and probably way overkill for most things.
On top of that you may need to host your website yourself, because most webspace providers don't provide Servlet Containers. If you just want to check it out for fun, I would try Ruby or Python, which are much more cooler things to fiddle around with. But anyway, to provide at least something relevant to the question, here's a nice Servlet tutorial: link
Look into creating Applets if you want to make a website with Java. You most likely wont need to use anything but regular Java, unless you want something more specialized.
I'd suggest OOWeb to act as an HTTP server and a templating engine like Velocity to generate HTML. I also second Esko's suggestion of Wicket. Both solutions are considerably simpler than the average setup.

Categories