Constructing rich web "desktop" environments - web-services

I am aware that this may potentially be an unsuitably broad question, but I am unsure where else to ask about it. Hopefully it can serve as a basis for information for me and other seeking to construct richer web applications.
I am very interested interested in the availability of frameworks that ease the construction of rich web "desktop" apps. The best single example I can think of is AirDroid (demo: http://web.airdroid.com/). I have tried to deduce from studying the HTML and JS itself what it is built by, but it all appears to be proprietary.
If I want to construct something similar in a robust fashion, what are some mature, open source technologies, libraries and frameworks I should be looking into?

I have found at least one framework with the necessary features for implementing the kind of system asked for in the question.
os.js is a Javascript framework with a "web desktop implementation for your browser with a fully-fledged window manager, Application APIs, GUI toolkits and filesystem abstraction.". As such, it has the essential features needed to craft a rich desktop environment, along with an underlying toolkit helping to tie it to backend functionality.
This is a good, extendable starting for crafting more basic solutions.
Reference:
http://os.js.org/

Related

Link C++ library to html front end

I do computational research with a C++/CUDA library that does intensive number crunching. Recently I was thinking to set up a little showcase of my library on my webpage where people could work interactively with the library and see the results (plots, animations, etc.) in real time.
I have very limited html and website creating expertise. Are there libraries out there to link the html front-end to the C++/CUDA back-end? I'm developing in Linux environment but obviously I'd like my webpage to be accessed by anyone independent of their OS and/or browser.
So after a little bit of research I found the Wt library which is written in C++ and used for webpage development. Based on the information on their homepage, it seems to be exactly what I'm looking for:
Typical use scenarios:
High performance, complex web applications which are fully personalized (and thus cannot benefit from caching), fully Ajax enabled and at the same time entirely accessible and Search Engine Optimized.
Web-based GUIs for embedded systems benefit from the low footprint of a C++ web application server.
Web-based GUIs that require integration with (existing) C++ libraries, for example for scientific or engineering applications, or existing C++ desktop applications
I did something like this. To do this, I used a simple library I wrote called jrb_node at https://github.com/kennethho/jrb_node
There are other libraries like cppnetlib http://cpp-netlib.org/
Basically you make a small http server that based on the request will perform some computation and return the results as an http response. You can then combine that with javascript and Ajax if you want to make it more interactive.
An alternative to consider is to use WebCL. CUDA is pretty similar to OpenCL and it should be pretty easy to convert your code to the latter. If you have other C++ code, that might be a bit of problem though.
Do you want to run CUDA on server (e.g. the users will input the parameters, push a button and your server will do number crunching) or on client (e.g. it will be user GPU that does computations)?
For server-side you should be able to use pretty much any server technology - PHP, JSP, etc. They all provide a way to integrate to "native code".
For client-side you will not be able to do with just HTML - you need to use some "fat client" technology - e.g. ActiveX, Java applet. I do not know if Silverlight or Flash have access to native code. IMHO, you might as well just write a Qt application and put a download link on your site.

Creating gui binding for c++ and YUI

I am planning to use yui or jquery ui as front end for native c++ applications. I found no bindings present for this purpose. Will it be feasible/possible to do this ? If it is so, then how shall i proceed? please suggest advice.thanks
#rwik - I can see your point and desire to do what you intend and I would presume it to be a wise move to be making at this point in time considering the vast facilities browsers bring to the table as well as other aspects... I know we are in September now and I have come across this pretty late, but this is also for others who have a similar problem...
As far as I know, descending from JavaScript in to C++ is pretty murky, mostly due to the heterogenous nature of Javascript engines [Rhino, Tracemonkey, Spidermonkey, V8, Caracan,Charka, etc] employed by different browsers. But there are indeed ways to do this - depending on how dirty you want to get your hands and, indeed, on your abilities...
If you were to go with Google as a browser, you should take a look at projects such as cproxyv8 - http://code.google.com/p/cproxyv8/ or v8-juice - http://code.google.com/p/v8-juice/ which both offer interesting facilities...
My preference however is with Mozilla - simply because of XML User-Interface Language (XUL) which, if you do not know, allows you to speedily create your own user interfaces by giving direct access to its layout engine. I.e., you can even do away with the browser look and have your own independent layout while still having all browser facilities at your disposal.
With respect to C++/Javascript interaction - projects should exist for all alternatives - it pays to check.
I wish you good luck if you haven't already solved this problem.
I'd recommend QT instead.
However since native C++ has nothing to do with GUI I'm going to assume you are making a library in C++. However Yui is basically just JavaScript as is jQuery. So if you're asking can a web page or script be a C++ application the answer is not really.
What you could do is create a web service which uses your C++ library and exposes an interface for your web based application to call it indirectly.
One way to accomplish this is to embed WebKit into your application and provide your custom C++ functionality via a plugin. Both the WebKit framework on OSX and the Chromium Embedded Framework on Windows allow this style of application development. This allows you to write a UI using local Javascript/HTML files without the need for a webserver.
There are no direct bindings in JQuery and YUI because these libraries run in a web browser. Thus unless you’re planning to write your own browser plugins, the integration with the C++ will happen at the webserver that serves the data to the browser.
You could feed the data from your C++ code directly into JQuery/YUI by building web services directly in C++. But you might want to build a web application that will be serving your JQuery/YUI pages and that act as user interface controller (like in the MVC pattern). Web application languages like Java, PHP, etc. all have ways to call native code. Java has JNDI and in PHP you build extensions that link to C++ code.

How to go about a platform independent E-Book Reader in C/C++?

I'm trying to develop an ebook reader(for mobile devices) which is platform independent. Currently my focus is epub only.
As a proof of concept, we were able to make a basic epub reader for android platform, using the functionalities provided by the platform itself(using webview, Xml Parser, Unzipper etc). But now we want to make it platform independent and we want to do it in C/C++. I know we have unzippers and xml parsers in C/C++, its the rendering part I'm worried about. My questions are...
1.How can I do the rendering, without using any of the inbuilt android views, so that it will work on other platforms also?
2.Is it better to stick to webkit for epub(the platforms which we're considering all have webkit)?
As of now I'm clueless. Any pointers on where to start?
BR,
Rajeev
Most likely you will have to split your application into the cross-platform backend and a platform specific front-end.
If you want to implement indexing and searching of all e-pubs in your app, this could be part of the cross-platform part. If the epub reader contains a catalogue of downloaded/transferred epubs, the database including its access methods could probably be cross-platform as well (at least partially).
However, the presentation layer, i.e., the user interface, will probably have to be platform-specific. The best case scenario is that you can come up with an intermediate UI description language that can be automatically translated into Android / iPhone user interfaces. That is a daunting task however, and it's probably not even worth trying if you don't want to create many cross-platform apps.
The only C/C++ development environment i found was MoSync.

How does one port c++ functions to the internet?

I have a few years experience programming c++ and a little less then that using Qt. I built a data mining software using Qt and I want to make it available online. Unfortunately, I know close to nothing about web programming. Firstly, how easy or hard is this to do and what is the best way to go about it?
Supposing I am looking to hire someone to make me a secure, long-term, extensible, website for an online software service, what skill set should I be looking for?
Edit:
I want to make my question a little more specific:
How can I take a bunch of working c++ functions and port the code so I can run it server side on a website?
Once this is done, would it be easy to make changes to the c++ code and have the algorithm automatically update on the site?
What technologies would be involved? Are there any cloud computing platforms that would be good for something like this?
#Niklaos-what does it mean to build a library and how does one do that?
You might want to have a look at Wt[1]. Its a C++ web framework which is programmed more or less like a desktop GUI application. One of the use cases quoted is to bring legacy apps into the web.
[1] http://www.webtoolkit.eu
Port the functions to Java, easily done from C++, you can even find some tools to help - don't trust them implicitly but they could provide a boost.
See longer answer below.
Wrap them in a web application, and deploy them on Google App-Engine.
Java version of a library would be a jar file.
If you really want to be able to update the algorithm implementation dynamically, then you could implement them in Groovy, and upload changes through a form on your webapp, either as files or as a big text block, need to consider version control.
The effort/skillset involved to perform the task depends on how your wrote your code. If it is in a self-contained library, and has a clean (re-entrant, thread safe) API, you could probably hire a web developer (html/php/asp etc) to write the UI interface to the library for a relatively small cost. The skills required would be dependant on the technologies you wanted to use. For Windows development I would suggest C#/ASP. The applicant would require knowledge of interfacing with native libraries from a managed language. This is assuming that you dont mind the costs of Windows deployment for your application.
On the otherhand, if the library is complex or needs to be re-written to support the extensibility you are looking for, asking here will not get you much.
BTW: here is a great article on Marshalling if you chose to implement using C#/ASP
http://msdn.microsoft.com/en-us/magazine/cc164193.aspx
First, DO NOT USE PHP :D
I used it for some projects (the last one with symphony framework) and i almost shoot my self !
If you are very familiar with C++, ASP .NET could be a good solution because if you like C++ you are going to love C#.
Any ways, I personally use Ruby on Rails for 6 months now and I LOVE IT. I won't write you a book here but the framework is pure gold !
The only problem is that Ruby is a very special language. You will probably be a bit lost a the beginning. But as every one you will learn to love it.
But that was only for the server side. Indeed, there 3 technologies you won't be able to avoid if you want to start to develop web applications.
HTML, CSS and JavaScript are presents every where. This is why i'm thinking you should start by HTML and CSS then JavaScript (with jQuery).
When you've got some basics with these 3 technologies you should be able to choose the server side language.
But you've got to tell you one thing, it's not going to be easy !
PS : Ruby on Rails uses HAML and SASS. These 2 languages replaces HTML and CSS you should have a look at them quickly because they are awesome.

C++/Qt vs Adobe AIR [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have to choose a platform for our product. I have to decide between The Qt Framework and Adobe's AIR. I am well versed with Qt as I have worked for the last two years. I looked up at the Adobe's site but all the info about flex, flash, ability to coding in HTML/ActionScript is overwhelming and confusing. I cannot understand the following about the Adobe ecosystem.
I have the following questions on Adobe AIR:
What language do I use for coding my application? (not just defining the looks of UI)
Like in Qt I use C++. Is it Actionscript?
Can we say AIR is only for making UI's for apps.
Where is the doc for the utility classes along with AIR?
e.g. http://qt-project.org/doc/ for Qt
Qt ships with a huge set of premade widgets that one can use. Does Adobe ship with any such widget set and if so where can i see it as in url?
I understand flex SDK is open source. Can I make commerical apps and ship them ? Does flex SDK ship everything (compiler, utility classes/widgets)
How much does AIR cost in terms of licensing?
Is there something in AIR that is equivalent to QGraphicsView of QT?
If you needs to access a lot of native libraries, you'll need to stay within your QT environment. Keep in mind that AIR is single-threaded and is run on the Flash Player (something that was originally designed for frame-based animations.)
However, depending on the style of application you're building, AIR might suit you just fine.
Beware that AIR can get confusing because there's a few different developer paths to creating AIR applications: 1) using html/javascript and the AIR SDK, 2) using Flash/Actionscript and 3) using Flex SDK and/or Flex builder. The last one is the most capable as far as coming from traditional desktop development background.
Small apps that are Web 2.0 for hooking into web services are good candidates for AIR applications. Things like the IM client Digsby would be great. My favorite AIR app that I've seen thus far is Basamiq Mockups. Other useful apps are TweetDeck. These are good examples of the types of things that are well-suited to solve with AIR.
You should visit the Adobe Showcase and look at some applications: http://www.adobe.com/products/air/showcase/
Also, if you're looking to just get out of the C++ game, I believe QT has some java bindings now...also I remember some python bindings, but never look at those myself.
As far as QGraphicsView, people have done similar things in Flex. I tried Googling right now but couldn't find them initially, but people have taken things like A large image, and then only displayed a current region in the window. Also, in the next version of Flex, they're acutaly building an official ViewPort component:
http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Viewport
Go spend some time with this AIR application and then ask yourself if Adobe Flex and AIR are worth investing your time in mastering (be prepared to ask yourself why something comparable doesn't exist for the likes of C++/QT):
Tour de Flex
Tour de Flex is a desktop application
for exploring Flex capabilities and
resources, including the core Flex
components, Adobe AIR and data
integration, as well as a variety of
third-party components, effects,
skins, and more.
Some of your questions:
Flex can be coded in MXML and
ActionScript3. AIR additionally
supports HTML/DOM/JavaScript
programming as webkit HTML render engine is built into
the AIR runtime.
MXML is an XML declarative DSL that
gets compiled into ActionScript3
imperative code. It is quite good,
though, for declaratively coding the
graphical forms of the UI (i.e., the
views of the MVC pattern).
ActionScript3 has a heratige that is
founded on JavaScript, but it has
been embelished to the point it more
resembles Java or C#. It has package
namespace, classes and interfaces
with inheritance, class member
access protection keywords,
constructors, static members, and
some very nice additions over Java:
properties, events, data-binding,
and closures.
Flex style programming is also a single-threaded model that relies on asynchronous I/O interactions. This is a simpler model to program than multi-threaded Java Swing or C# .NET Winform apps, yet permits achieving the same net results of program behavior. I elaborate on that here:
Flex Async I/O vs Java and C# Explicit Threading
Flex is open source, you can download the SDK for free, there are no licensing costs associated with it. (see their FAQ)
They do ship a 'flex builder', which is some custom Eclipse I think, and which costs money, but you can perfectly work without it.
The docs can be found at adobe's livedoc pages. (which to some, is enough reason in itself to dislike Adobe ;))
I do wonder, if you are well versed in QT, why are you considering something else? Which advantages do you expect AIR to give you over QT?
I have some experience with both QT and Flex, but not nearly enough to weight one versus the other. I do know QT/C++ is much, much more mature than Flex/ActionScript.
If you already know QT, I don't think the time spend learning a new framework (and programming language) will gain you enough to be honest...
I've used QT and Flex (not so much Air itself though) and have found that Flex is faster for getting apps up and running as well as modifying, while QT gives you more control -- particularly in the installer. The Air app installer is pretty awkward, or at least it was when I tried it, though it may have been improved since then.
The big advantage of Air is that much of the code for it can be run in Flash inside web pages. You can't access the local file system etc. from the web for security reasons but just about everything else is portable.
I made the opposite move. I started working on Adobe stuff and moved to QT. The main reason for doing it was about Adobe framework limitations. When you are using Adobe stuff, you are limited to the tools that they produce, it is hard to introduce external frameworks or libraries, if can not do what you want with Adobe stuff. Usually, the solution to do this is to use sockets, which transforms a supposed "stand-alone" application on a client-server architecture. In addition, if you are using many external stuff it can be hard to manage so many different clients.
Using QT you can code in C++ and add any external framework or lib you want. Even though, some times it can not be easy to code it, is doable and with no "strange" system architecture.
If your looking for some examples of "fun" UIs using Qt and SVG, take a look at the KDEGames [1][2] and KDEEdu [3][4] projects. There's lot's of nice code there that uses QGraphicsView and SVG to created scalable interfaces. Of course note that's it's GPL so be careful what you "borrow" if your app isn't.
[1] http://games.kde.org/
[2] http://websvn.kde.org/trunk/KDE/kdegames/
[3] http://edu.kde.org/
[4] http://websvn.kde.org/trunk/KDE/kdeedu/
I'll second #Pieter's comment - if you already know QT, moving to a whole new environment is going to take a LOT longer.
QT has the advantage of being cross-platform, and very mature: there are libraries for Windows, Linux, and Mac OS X. I'm not extremely familiar with AIR beyond knowing it's from Adobe, but the product site seems to indicate that it's for rich internet apps (http://www.adobe.com/products/air/). If that's true, then QT would be the far better choice if you're developing a desktop application.