Web Application Framework - HTML5 with mobile devices JavaScript support - json

I searched for Java based web application frameworks the last few days. I have to build a Java EE backend and a HTML5/CSS3/JavaScript frontend which can be accessed with multi-touch capable devices. So I will need modern JavaScript frameworks like Sencha Touch.
My backend should be built upon with Java EE, Hibernate and MySQL. I have two kinds of data transfer: AJAX / JSON so the page does not need to be reloaded and pages and normal pages which reload the page by sending a form with POST (or do you think to have more the feeling as a application I should do all stuff with AJAX/JSON?).
I found several web application frameworks:
JavaSever Faces
Apache Wicket
Spring MVC
handle it only with jar files for JSON (and REST)
Google Web Toolkit
What do you think will fit best? Perhaps you can exclude one of them, that would also be great, so I can take a closer look at the remaining technologies.
Best Regards, Tim.

Interesting question.
Concerning exclusion: If you use a JS framework like Sencha Touch in the frontend I don't see the sense in using something like GWT which is for frontend-code generation.
I would probably stick with a more lightweight framework like http://www.playframework.org/.
You get your data from the backend and then hand it via JSON over to your frontend code i.e. sencha, sproutcore, cappuccino, gwt or what you choose to use.
Let me know what you choose :-)

Related

Xamarin: how to create views / UI of an app dynamically from a Json

Have you already developed a Xamarin app whose views are generated from a Json recovered when launching the application?
I met a client with this kind of need:
they are developing a web app to prototype the screens by adding and positioning some controls (TextBox, Label, ...)
this generates a Json that must be interpreted by the Xamarin app: this will build the different views dynamically
in a first version, the user's data would be stored locally (through a file or SQLite) and synchronized "manually" when the device is connected to a computer
the app will work on Android only in a first time, and then on WPF
The client has not yet decided between Xamarin.Forms or Xamarin native, but it's probably more interesting to do it through Xamarin.Forms, even if iOS is not required: this should make porting on WPF easier.
Have worked on similar cases? Have you some recommendations? Are there plugins or patterns that could be used to simplify this development?
I've found this one, but it doesn't seem to be the same use.
There is also this article on iOS, but there is not the same thing on Android.
This would in theory be possible using a massive code behind builder for a page but should NOT be done for a production app. Mobile apps have very specific requirements that need to be thought of before attempting.
Xamarin is great for simplifying code reuse, and if you use Xamarin Forms you can reuse the UI components for Enterprise apps.(the less fancy and pixel perfect the layouts need to be the better. )
Your client would be better served by making it a mobile compatible web page instead from the details you have shared.

Front end for an iOS web app using Django Rest API

I ve recently been asked to work in the front-end of a new app which will be written with Django for back end.(They said it will be for iOS).
Even though I have experience working with front-end I never wrote any code for iOS or Django REST API. What are the differences? Is it html/css ?
In another words lets assume that someone has a code in Django which asks user a question and stores the answer. The response will be in JSON(I think.) He wants me to write front end. Should I write it in html?
One more question: What will determine that our app will be working in iOS and will not work in android. They said the app will be for iOS at first but since it uses REST API what is the reason it cannot be available at the same time for android?
The usual process of using django rest framework is to have interactions with your backend exclusively using json.(most of the time, some people might use xml). So in general, all the information (requests and responses) will be JSON. Once you have that part setup, there are a number of technologies that will help you create user interfaces. You can use angularjs or JQuery to send JSON requests and responses to the endpoints and display the information obtained.(the whole interface is modified with javascript.)
Now, for your mobile apps. There are two approaches you either create what people call a native app using Java(for android apps) or Swift(for apple devices).
If you decide to use that approach you will have to mantain both apps in different languages. The other way of doing things would be to create an interface using something like angularjs and use a tool like ionic to convert that app into an android/apple app. Using that approach you will only have to mantain 1 application.
Here is a small diagram to represent the interaction.
(Django rest framework) <=JSON=> (front end app.)
I would suggest to start with django templates, it might just do the trick.

Delphi - Websockets and uniGUI

I am really a beginner in delphi, as the client request the project to be done in delphi, so I have to ask to get some help as possible as I can. This project will be involved in HTML5 and websockets as well, so there are some questions I need your advices.
Sorry let me explain more, this application have two parts mainly, one is HTML5 client web app (this app will be loaded from web server, and run locally in browser), and the other is its service located in server. The HTML5 web app is doing some product editing job, as well send its final output to server, during this process, there will be many communications between client app and service, and I planed to use Websockets.
I did plan this application in HTML5 and Node.js before, but as client send request to ask for the Delphi XE as primary development tool also it will be compiled to DLL (ISAPI, have to be) at last. For consistency of UI, I also was required to use uniGUI (http://www.unigui.com/demo)for Delphi. Now I have these questions:
Is there any other way to do this application with HTML5 as web front exclude uniGUI in Delphi?
What good libraries support Websockets in Delphi?
What book you can recommend me to read, as I don't know Delphi at all.
Thanks.
1: yes, make a "single page app" (static html + js) and communicate with server using xml or json.
At least with indy 10 it is quite straight forward to implement static file serving (response.contentstream := tfilestream.create(sfilename) or something like that)
2: yes, if you search for it on google you will find some :)
WebSocket server implementations for Delphi
btw, I'm busy with delphi socket.io implementation, which makes it easier to use websockets instead of plain low level tcp-like websockets itself
Is there any other way to do this application with HTML5 as web front exclude uniGUI in Delphi?
First concept : HTML5 applications are a bunch of HTML files and JS's wich can be processed by browsers.
Second concept : You need an application that can bind HTTP queries and return files from the first concept.
Third concept (paradigm) : With first two concepts, a third concept arises. Dynamic HTML. What is dynamic HTML? HTML that generates at runtime at the backend server and/or at frontend with JS.
Solution :
Yes, with Delphi as a backend server you can manipulate and return HTML5 views, if you know (MVC paradigmn for example) you can program an HTTPServer application that binds HTTP request from network and responses your HTMLs and JS.
What good libraries support Websockets in Delphi?
You need a multilayer library. The best library I know is mORMot. mORMot is like a swiss razor for Object Pascal.
You can create an HTTP server with websocket published interfaces. mORMot's Site
What book you can recommend me to read, as I don't know Delphi at all.
I have more than 10 years with Delphi and Free Pascal and I didn't read a book at all. But I read a lot from internet and a lot of computer architecture and another languages like C and C++.
If you like Delphi there are tons of documentation via Internet. I cannot recomend you a book because I will lie you.

TideSDK with Spring MVC

Just wondering, is it possible to turn spring mvc web development content into a desktop application using TideSDK? Both are using HTML5 as the front-end. Then, as for the back-end process, it should be able to reuse the java code inside spring mvc.
I just finish a web project that was developed using spring mvc, and there is a request to turn it into a desktop application. I was looking around and found that you can use HTML5 for creating desktop application. It would be nice if I can directly convert it to desktop.
Thanks for the response :D
Unfortunately the answer is no. TideSDK has support for different server languages, such as PHP and Python, but Java is not one of them.
What you could try is to make the app a shell for the webpage. So when the app starts it immediately loads http://yoururl.com, the behavior would be exactly the same as in a webbrowser.
Note that when you load any remote URL, all native functionality would not be available to the page.

Web application architecture design - HTML/CSS/JS frontend + REST Backend

I have some experience developing websites, but none with proper web applications.
But this time I'm creating more of a web application, my server will surely handle API calls from a mobile app (iPhone/Android/MeeGo (...or not)) or even from third party clients.
So I'm thinking, is it really necessary that the "website" --the frontend part of my application using HTML (5)/CSS (3) and JS--interacts with my backend in a different way than my other "frontends"?
Am I thinking wrong? I think this is a common problem, and I need some experimented advices on that. Thank you for your help.
Actually No. You're thinking it the right way. You can Javascript to interact with your Rest API, so you can focus only on writing a scalable API, and the UI.
That's the approach taken by Twitter. Their web site, is a Rails application that uses the twitter API, written mostly in Scala, and uses by the hundreds of twitter clients out there, whether mobile or desktop app.