Bundling a browser in my Java application - java

I have created a Java app (deployed by Java Web Start) which needs to use a browser to display HTML5 content. Due to such browser not necessarily being on the user machine, I'm bundling a portable version of Chromium in my JAR. This has two problems:
The Jar is going to be almost 70 MB, Chromium taking up 64 MB.
There doesn't seem to be an easy way of creating a communication channel between my app running in the background and the browser window, short of bundling a web server as well, like Jetty or Jibble.
The size of Jar isn't such a huge issue, unless it is way over 100 MB. However, the portable Chromium app seems to be windows only and I need to deploy on Mac OS desktops too. At the moment I'm launching Chromium in app mode (with --app="http://..."), because I just need a browser window with no interface.
So my question is, is there another browser I could bundle instead of portable chromium? Something that would preferably be lighter but it definitely has to support HTML5, and that I could control programatically from the Java background app (although a bundled webserver is a viable option, not sure how that would play with various firewalls). Maybe there is something lightweight and cross-platform based on WebKit?

JavaFX2 (this comes with Java 7) comes with a light weight html5 browser.

Related

Screenshot Entire Environment from Browser

I have an internal web application and I want to be able to take a screenshot of the user's entire desktop environment through the app, not just the browser window. In my research, I've found that I could do this using a Java applet. However, Java applets are no longer supported in Chrome as of v45, and they tend to be slow and dated. I've explored the possibility of using flash or a browser extension, but it appears that I would only be able to capture the browser window through these means. I'd prefer not to use a native application, as the screen capture is to be a feature of the web app, so I'd like to keep them as tightly coupled as possible.
Specifically, are there any other methods that I am missing to achieve what I'd like to do? I've sort of resided myself to a java applet sans chrome support or a separate native app, but I've had trouble finding literature online about my use case (assumably due to the security concerns).

Java Raspberry PI Help is Vaadin the best way?

I looking to make a web app that has a login page and has 1 button and a image of a LED that will flash.
I started to do this in Vaadin and latest version is so big (32MB in Vaadin files) it take a long time on start on Raspberry PI.
Is there a better way?
Then the button is pressed in software or triggers from the hardware, the hardware could take 1min or more before doing it stuff and flasher LED.
Flash good
Flash's poor
Flash's bad
etc
I assume you want to run the server portion (i.e. the application server) on the Pi?
In that case, Java is not a good choice (though possible), and Vaadin certainly doesn't help as it is a server-side application framework.
Why not use a client-side solution for the UI (i.e. using Angular JS) and a python-based solution for the server-side, based on SimpleHTTPServer (https://docs.python.org/2/library/simplehttpserver.html)?
The accepted Answer by miw is correct. I'll add a bit of explanation.
Vaadin is a great tool for being able to quickly write web apps using only Java programming but rendered using regular web browser clients (no applets).
The Vaadin app actually runs on the server-side. The user-interface is rendered remotely on the client-side (web browser) but the app lives on the server and reactions to the user’s actions are executed on the server.
This server-side execution means a Vaadin web app often needs much memory, enough to maintain the current state and enable the user action-reaction executions for each user, all in the same JVM on your server. Multiplying the users means multiplying the demands upon memory and upon the CPU of the server.
Between both a JVM (Java Virtual Machine) and Vaadin, you would be placing much demands on a resource-limited computer such as Raspberry Pi. While I've not tried it, you should be able to run a relatively simple app with relatively few users. The latest Pi models with more memory (a gig) should work much better. Some competitors to the Pi come with even more memory and so might work better for Vaadin.
So, no, running a Vaadin app on a Raspberry Pi is probably not the most optimal scenario. But it would be fun to try. ;-)

java to access webcam and pen tablet (standalone app vs applet)

i need to develop in java an application that accesses local resources, mainly a webcam, and possibly a wacom bamboo pen tablet. It should take pictures and notes and then post them to a web server.
The ways i can think of are:
use applets
use some kind of standalone app created via JavaFx (or swing or similar)
Which way would you go about it? Are applets considered a viable/secure way to achieve this?
Thanks
I would go the standalone app route. I always turn Java off in my browsers because I can never remember which specific version has security bugs.
If you build it as a desktop app I think you could quite easily convert it to be an applet later on if you wanted.

Java web start on iPad

Can I run Java applications (Java Web Start) on iPad?
Looks like this is not possible, but someone suggested using Cloud Browse (an application I couldn't' find) to run Java.
Any solutions?
UPDATE: Cloud Browser is an application that was available on the App Store but it was removed my Apple. Cloud Browse would process the web site externally and then stream the web site content to your iPad screen (something like video streaming).
No, you cannot run Java programs on the iPad (or any iOS device). Apple's license terms forbid running applications that can execute code downloaded from the Internet (which is what Java Web Start is all about).
No, as staffan said, Webstart will not work. However using CloudBrowse, an applet can work. It looks like the idea behind Cloud Browse is that the browser gets rendered on the server and video of the web page get streamed to your phone. This way, it appears to the user that applets or flash are running on the ipad.
I tried CloudBrowse on my IPAD as I've got a Java Applet that runs inside a brower and wanted it to work on my Ipad.
I found that it works pretty well. The Java Applet has a 3D animation, it's not as smooth as running on Windows/Mac through a normal web-browser, but it's pretty good.
I paid for full version, wasn't that expensive and to me, worth it. Opens up the power of using Applets but within Ipad!
Check it out here ... 3D sailing replay.

Developing a mobile version of a site

I'm working on a large website project that makes heavy use of in-page graphing of data. To make the graphs interactive (the old paradigm was to post data to the server, have the server render the graph as a jpg, then send it back to the browser) we've started building the graphs in Java. It's a smooth system, but the website is still very much computer-dependent.
I'd like the site itself to work as a device-aware web application - switching layouts based on user agent strings to render a mobile-optimized version for cell phones and PDAs. But I'm concerned about the nebulous support for 3rd-party applets (Java, Flash, etc) when it comes to platforms like the iPhone.
So if you were building a web application that could be accessed either through a standard web browser or an iPhone/Blackberry/Palm device, what would you do to still display interactive graphs? Is there a workaround for using Java on the iPhone? Is there another platform we should pursue all together?
If you want to support more browsers, you may want to look at using Javascript to help decide what to do.
You could generate the graphs using the canvas element, and if the browsers doesn't support that element then you could use a Flash app, and if that doesn't work, have the graphs developed on the server and use the <img> tag and just refresh.
This third approach could also work if the browser doesn't have javascript enabled.
This way you can handle the various situations and get away from having to run Java in the browser.
The iPhone and Android browsers support HTML5 features such as "canvas", which you may want to look into. The browsers on BlackBerry phones are somewhat behind the times - they are finally releasing a WebKit-based browser for their upcoming 6.0 OS but all of the current in-market devices are quite limited in terms of browser capabilities. For those devices you're probably best off just using a static server-generated image.
I would use a JS charts library and gracefully downgrade to images when you detect an older browser.

Categories