objective j loads slowly in browsew - html

I am iOS developer. I know just a couple of languages and I hate html because of the lack of possibilities there.. I've just red about objective-j. When I try to open any code in web browser (last versions of Safari, Google Chrome) it loads increadibly slow..
Is it normal?
How to make it work fast?
Are there any other languages similar to c, objective-c that I can use for creating a web-site?
And another queastion coming with: How can I make Xcode work with objective-j? I use coda 2.0 at the moment.

Make sure you run jake deploy to create the stripped and precompiled version of the app you're testing. Most sample code out there will be run in uncompiled "debug" mode which is great when you're developing but in actual deployment you'll want the precompiled version of your app.
Also, the current development version of Cappuccino and Objective-J is much faster than the last release 0.9.6, thanks to a new, better compiler. Keep an eye out for a future Cappuccino 0.9.7 release.
I think if you write a significant app in Cappuccino you'll find the load time to be absolutely comparable with other large web apps such as Gmail.
Currently you can only use Xcode to edit the user interface of a Cappuccino app. It does not work well to edit Cappuccino code itself since the latest versions of Xcode don't include the necessary plugin framework. You can learn more about good editor options in the development environment tutorial.
I am not familiar with other languages similar to Objective-C for the web, but Intel has an Objective-C to JavaScript compiler here.

Related

What cross-browser technology do you use in your web applications to manipulate on client machines?

(I have a problem with Google Chrome improvements that will drop support for my current solutions.)
I work on project where I move desktop system to an Intranet web application.
The crucial requirements are:
to move desktop system to a web application
to reproduce every single functionality from the desktop system in the webapp
While 95% of work requires creating casual web application, there is one thing which is non-standard to handle: my application must perform some actions on the client computer. These includes:
connecting with libraries
launching desktop apps
file manipulation in background
The example scenario is to integrate my system with some machine in the lab. I have to integrate my web application with drivers on client computer via DLL (desktop app did this, so my app have to do this as well).
Theoretically scenarios of the desktop actions may vary and I just want to implement some interface that will handle all the "client-machine" job the desktop app has done, so there is no need to work on every single scenario (but of course every scenario should be tested).
My solution was Java Applet. It worked. But then Google Chrome decided to drop support for NPAPI plugins, so in September'15 Java plugin (and my applet) won't be supported (http://blog.chromium.org/2014/11/the-final-countdown-for-npapi.html).
So my another solution is Java Web Start. It works. But now Google Chrome decided to drop support for background operations of external protocols (https://code.google.com/p/chromium/issues/detail?id=348640), so from Google Chrome 45 my Java Web Start solution won't be supported.
(Both above solutions work on Firefox and IE.)
The question:
What other technology can I use to interact with a client machine from my web app?
Other remarks:
I am reluctunt to write my own PPAPI plugin or Chrome Extension - I prefer one solution working on all major browsers.
I know that StackOverflow community does not like discussions about technologies, so please focus on describing possible solution to my problem.
We struggled with a similar problem as we need to connect/access electronic devices over JNI->DLL. The only technology where this is currently possible are applets. Period. (And even that is tricky since certain combinations of browsers/java versions/operating systems do not work or have problems, but this is another story...)
There are web technologies like HTLM5, JScript which can replace some functionalities of applets however in certain scenarios (like yours) there is no current alternative available - and you named some of those:
connecting with libraries like *.dll, *.so etc.
file manipulations
launching applications
And doing that across browsers and operating systems!
Solutions?
Tell your users that certain browsers can't be used (like Chrome and
Opera Next)
Write individual plugins for each browser (which probably is beyond your budget ;-)
Did you consider writing standalone application(s) in form of an executable file? The user must download and run it however e.g. java or plugins also need to be installed. But then there is the security aspect of that (downloading an and executing an executable file) - certainly not an easy decision
Have a look at FireBreath 2 - (just read about it in some posts, however didn't try it)
There are lots of discussions on SO to this topic so take a read:
alternative technologies to replace applets
applet alternative launch from browser
alternatives to java applet to launch microsoft office applications
alternative-java-applet-network-drive-access
what are the alternatives for java applet to launch client programs using chrome
alternative of npapi plugins for flash java applet
python alternative to java applet
npapi alternative for live file editing
... and many, many more!

How do I convert web application into desktop executable?

I've HTML application build with AngularJS/jQuery/Bootstrap with AJAX REST API.
Is it possible to create executable/installer for Windows operating system?
Without any 3rd-party software, it should look like native application, but HTML.
For example, Slack messenger has web/mac/windows versions and they look same.
Any ideas?
// UPD
I probably need a wrapper (webview), but I need all features for EcmaScript5/CSS3.
Electron is the easiest way:
1. Install electron
2. Create and edit main.js:
const electron = require('electron');
const { app, BrowserWindow } = electron;
let mainWindow;
app.on('ready', () => {
mainWindow = new BrowserWindow({
width: 1000,
height: 700
});
mainWindow.setTitle('title of the desktop app');
mainWindow.loadURL('http://www.yourwebpage.com');
mainWindow.on('closed', () => {
mainWindow = null;
});
});
3. Execute desktop app:
electron main.js
And to build the app, use a builder such as electron-builder.
Hope that helps you!
(Full disclosure, I'm the founder of ToDesktop, I'll try to be objective and unbiased here.)
As usual in Computer Science, the answer is "it depends"!
The first question that you should ask yourself is: Who is the desktop app being used by? Just you? Or, are you distributing the app to customers? Because these two segments have very different needs.
Just you
There are a lot of options here (in no particular order):
Nativefier — The obvious option. Lots of configuration options, lots of contributors, open source and regularly updated. This should probably be the default option if you want to whip up an app just for yourself.
WebDGap — This is a lovely project but it is a little old and "as of April 13th, 2018 WebDGap is no longer an active project.". It should also be noted that this is built on an old version of node-webkit and not Electron.
Web2Desk — Great option if you don't want to mess around with the command-line. It uses Nativefier under-the-hood. It is free with a splash screen or $19 with the splash screen removed.
Do-it-yourself with Electron — The basics were covered quite well in this earlier answer. I like this option because it gives you complete flexibility to take the project wherever you like and you'll learn a bit of Electron too.
Fluid App — This is Mac only but otherwise it's a lovely solution and super easy. It's free for the standard version, there is also a $5 version which includes features like fullscreen.
Flotato — Mac only again but this is a really interesting approach. Simply clone the app and give it a name like docs.google.com, it will then turn into Google Docs. At the time of writing this, it's in pre-release (not released yet) but I'll be watching this closely, it's very cool.
ToDesktop — ToDesktop will work but it's probably a bit overkill if you're creating a personal app. Also, it's probably a bit too expensive for this use-case. ToDesktop is targeted at creating a desktop app for distribution to customers (more about that below).
Distributing to customers
There are a few extra considerations which become more important when creating a desktop app for distribution to your customers:
Installer — Mac users expect a "drag to applications" DMG file. Windows users expect an installer and they also expect to be able to uninstall it from the control panel.
Code Signing — If your app isn't code signed then by default Windows Authenticode and Apple Gatekeeper will prevent your desktop app from being opened.
Auto-update — There is still a web browser running "underneath" your desktop app, it's important to keep this updated for two reasons. 1. Security issues + vulnerabilities should be patched over time. 2. You don't want to be stuck supporting an old web browser in 5 years time because your desktop app's browser hasn't been updated
The tools mentioned above don't offer these features, so they're not really suitable for the use-case of distributing your app to customers. These are the features that we wanted to add when building ToDesktop, so I think it fits this use-case quite nicely. We're adding features all the time, last week we added support for App Protocols and Deeplinks.
I myself was looking for an all around solution for awhile. I tried everything from TideSDK, AppJS, Appcelerator Titanium, native code in VB.NET, XCode, Python, C++, Electron, node-webkit, etc: Basically you name it I've tried it.
Note Electron is nice, but it only runs on 64bit processors. So node-webkit is good if you want to run your app on 32bit processors.
So I decided to build my own open source solution called WebDGap.
Currently WebDGap runs on Windows, Linux, Mac OS X, Google Chrome and as a web application!
Watch the How To Video to learn, well how to use the app obviously.
Here's a screenshot.
Being that you're a Mac user already you can merge your exported app into 1 .app mac file. This can be done with Automator (and a little shell scripting).
There's also a coding playground I made for mobile users that has this feature built in called kodeWeave.
Here's a Tic-Tac-Toe game I'm going to export as a Mac App:
Now the web app is running as a native Mac application!
The most easiest and quickest way i know is to use nodejs/npm’s nativefier library which underlying electronjs . It will just take 5 min to create executable for windows. Even a person who do not have programming experience can create desktop application from web application. Below mentioned post has described the steps to convert web application to desktop application. Must read !
Convert any web application to desktop application in 2 min using npm’s nativefier
There are a ton of frameworks out there that can wrap your web app into a native application that can access things like the file storage API for an operating system. This is the specific guide for Windows.
BEWARE THOUGH - you will need to spend time doing solid testing and QA work for your native app so it doesn't feel like a website inside a native wrapper, as well as integrates well with all versions of the OS you want to be compatible with. Tweetdeck for Mac is an example of what not to do - basically a web browser in a native wrapper).
Use Web2Desk: If you are looking for Free and Simple solution.
wherein all you need to do is enter the URL of the web app (or website) and Desktop app for Mac, Windows, and Linux is generated in no time.
With a bit of wrapper code you could package it as a Chrome App. They do not need to run in a browser window but have all the capabilities of a web app, standalone.
https://developer.chrome.com/apps/about_apps
Best Way to Convert Web to Exe is using nativefier:
nativefier --name "Inventory Management System" "http://localhost/php_stock_zip/php_stock_zip/php_stock/" -i ./icon.png -p windows
Steps:
Press Win+x
Press C
Type
nativefier
Installation Requirements
* macOS 10.9+ / Windows / Linux
* Node.js >=6 (4.x may work but is no longer tested, please upgrade)
See optional dependencies for more
Step 5: npm install nativefier -g
Finally type nativefier "Web Link"

What are the functional differences between NW.js, Brackets-Shell and Electron?

Now that TideSDK is effectively dead, I've been looking into alternative 'wrappers' to run HTML/CSS/JS applications as stand-alone desktop applications. The three viable options I have run across so far, are NW.js (formerly node-webkit), brackets-shell, and Electron (formerly atom-shell).
The problem is that there does not appear to be a sufficiently complete comparison between the three in terms of feature set, compatibility, etc. I'm hoping to turn this into a more-or-less canonical thread on the (objective) differences between the three, in particular regarding:
Platform support; operating systems, dependencies, etc.
Language feature support, as far as HTML5, CSS3 and JavaScript are concerned. Think things like "does HTML5 video work, and if yes, what codecs are available?"
Non-standard extra features, such as tray icons, popup notifications, and OS-rendered menu bars.
Extensibility; eg. ability to 'plug in' native code, talk to Node.js, and so on.
Architecture; in particular the architectural differences that affect daily usage as a developer.
Debugging; included development tools, compatibility with commonly used tools like node-inspector, etc.
... and so on.
What are the objective, technical differences that matter when making a choice between them as an application developer?
I did similar research about two months ago, and in the end I went with node-webkit. The biggest upside on node-webkit is node.js and npm. The package management of npm is really nice, and node has well done filesystem access.
Brackets-shell looked interesting, but other than a nice IDE I didn't really get what made this one as good or better than the rest. They are very clear that "The brackets-shell is only maintained for use by the Brackets project ", that screams run away to me.
https://github.com/adobe/brackets-shell#overview
Atom-shell seems to be recently active, but it seems much like brackets in that they are really writing and editor/IDE that just happens to be attached to a webkit runtime. It also is built on top of node.js. This one has the downside of being difficult to search for stuff online without being reminded of your middle school chemistry.
I really don't want an new editor, and most programmers have their favorite already. For the actual application development, they pretty much work the same, and should, since they all use webkit. You basically write 90-95% of it like a website, and then deal with the native parts, and some config.
These things are true for all three of them
platforms - runs on Windows, Mac, and Linux
language support - HTML5, CSS3 and Javascript : since they run javascript you can download and run nearly any library/framework that you want.
The big caveat on webkit is codec support. Typically you will have problems with non-free video codecs, unless you rebuild the dll/so to support them. For example the shipped node-webkit won't play mp4 video.
I've been playing with Atom-Shell over the last few days, and I am loving it so far.
The best part about it is that it's backed by GitHub.. which should allow you to settle into the platform for the long term, especially if it gains a large following. It's also made possible by direct Node.js improvements courtesy of a contract with StrongLoop, who is a major Node.js contributor (they claim to employ more Node.js core developers than any other company, even Joyent).
I've also found it rather comfortable to get started. It took me about a day to learn the structure and get my first proof of concept running. Very cool.
Bullet Points:
Platform support: Windows, Linux, Mac OSX (More Info Here)
Language feature support: HTML5, CSS3, JS via Chromium - so far, zero issues, but I have not tested video specifically.
Native Features: Native App Menus, Task Tray Support, Global Hotkeys, Protocol Handler Support (that I've seen so far)
Extensibility: Excellent Node.js integration, both the client and server can "require" Node.js modules and natives. I've also successfully tested Bower libraries (incl jQuery) without issue.
Architecture: Covered in the other points, but in general its very smooth.
Update (11/25/14): I've not yet found use case for Atom-Shell in any official capacity, but I have used it to build a few small apps for my own use, the most complex being an app that pulls my time logs from my PM software and creates Paypal invoices.
My opinion of the platform remains positive. It's pretty awesome.
On my time invoicing app I successfully brought in Bootstrap 3's Dashboard Example Template and a few node modules (bluebird, Paypal SDK, Teamwork PM Client) to create a mildly complex app. It took me a few days and does its job well.
I really cannot think of anything negative to say about Atom-Shell, its solid, stable, fast, and easy to code for. I hope this helps someone.
Besides fully support Web standards, NW.js supports a list of non-standard features for native app development including:
Protect JS source code by compiling them into machine code: https://github.com/nwjs/nw.js/wiki/Protect-JavaScript-source-code-with-v8-snapshot
Jailed devtools: https://github.com/nwjs/nw.js/wiki/Devtools-jail-feature
Additional security model with which you can do more in DOM: https://github.com/nwjs/nw.js/wiki/Security https://github.com/nwjs/nw.js/wiki/Changes-to-DOM
enhanced file dialog: https://github.com/nwjs/nw.js/wiki/File-dialogs
kiosk mode: https://github.com/nwjs/nw.js/wiki/The-Kiosk-mode
supports for a growing list of chrome.* API, include chrome.webRequest so you can intercept HTTP requests from DOM: https://github.com/nwjs/nw.js/issues/518
support for rich notifications, print preview, many more chrome.* APIs, Chrome Apps and other Chromium features starting from 0.13.0-alpha0
There is much more to see in the wiki including Menu, Tray, etc.
I've been working with brackets-shell for some time now, here are some of my findings:
brackets-shell is primarily developed as a shell under the brackets IDE project, but the project can run any web application. You just need to point it to your own html page. Clint Berry wrote an excellent tutorial about doing just this: http://clintberry.com/2013/html5-desktop-apps-with-brackets-shell/
The project is backed by Adobe and has a lot of activity
Documentation could be better
platform support They support Windows, Mac and Linux. An installer package can also be created. I only tested it on Win and Mac, it works great.
feature support html5, css3, js. Html5 video does not work out of the box, but is very easy to enable (by default the ffmpegsumo.dll is not copied into the installer, if you change the script to copy it it will work).
native features menu bar, 'open file with', file system access. I am not using any of these, as all I need is the communication with the node process.
extensibility a nodejs is built in, and you can communicate with node from your web application. In this way, you can use node to access the filesystem etc.
architecture The project is well set up, keeping a nice separation between the shell project and your own web app running inside it. In your own application, a global appshell object is available which gives you access to the brackets functionality (filesystem access, communication with node process, ...).
One thing to note (if you care), is that the Electron officially does not support Windows Vista. Vista's market share is about halfway between OSX 10.9 and 10.10 (both of which are fully supported by Electron). Vista is also still supported by Microsoft until 2017.
NW.js works fine in Vista, as well as OSX 10.9+. NW.js works on Ubuntu, Debian, Zorin, Manjaro, Arch, and most other Debian based Linux OS's. Electron has refused PR's to fix Ubuntu specific bugs on their platform which is concerning.
NW.js works in XP too. Currently 18% of the market is still on XP. So if you're desktop application is more general purpose or wants to have access to the late adopters still on XP, you're probably better off with NW.js (0.14.7) as Electron only supports Win 7 and up.
If you use NW.js 0.12.3 you can also support OSX 10.6+ and very old versions of Debian based Linux OS's like Ubuntu, and Win XP+. It is recommended that you do special builds just for those legacy systems though and use the newer versions of NW.js for newer OS's.

Wrapping a HTML5 app into an executable for Windows/Linux/Mac

I'm building a HTML5 mobile app which I'm going to wrap in an Android and an iOS app with a simple web view. However, I have some users that use my current Adobe Air app (which is now unsupported), and I'd like to offer them this new app I'm building.
I've heared that Adobe Air's implementation of webkit is rather old and unstable.
Is there any good tools for wrapping a local browser (preferably webkit) and my app in an executable for cross-platform (PC) use?
I've just seen this http://appjs.org/ and I'm glad to see that Alex's TideSDK sounds great also !
Adobe AIR can do what you want, but I won't support that solution : it's slow and not really crossplatform since they drop the support on Linux if I'm correct.
If someone happen to test the others, feedback is welcome !
Off topic: Moreover I've chosen not to trust Adobe for my technical choices anymore. We've waited Flash on mobile for years, they drop the idea. We've been waiting for optimization on Mac and Linux for years, but nobody cares. The new hype some months ago was expecting compilation to HTML5, it's just some buzzwords mixed together and some old sketchy alpha version as far as I know.
EDIT
AppJS has moved http://appjs.com/
EDIT
node-webkit seems to be definitely a must see now ! https://github.com/rogerwang/node-webkit
Read an article lately about this sdk: http://www.tidesdk.org/ . I haven't worked with it yet - so can't really say if it's worth trying and doing what you want.

Develop Native Application on Ubuntu with HTML/CSS GUI?

Redmond has a good idea occasionally:
The next-gen Windows will come with a new programming foundation, letting developers build native apps with the same techniques they use for Web applications. Microsoft calls this new variety "tailored apps."
There is always a steep learning curve for developing GUIs; each new toolkit you learn is different enough that it takes a lot of time and effort and frustration. Thus developing in HTML with CSS begins to look very appealing: it's much easier and much more portable; and with HTML 5 and CSS 3, it is very powerful.
Is there any support yet on Ubuntu (or even better, a cross-platform toolkit) for developing native applications that use HTML/CSS for the GUI? To minimize overhead, I do not want to start a full browser session. (That's not very good desktop integration.) I am particularly interested in answers for native JavaScript or Python 3, but any language would be alright (easier to learn a new language than a new GUI toolkit, in my book).
Edit: I have found this page, but have not had time to read it all or test it. It linked to Python XULRunner, but again I have no previous knowledge of it.
This was asked on Ask Ubuntu back in August of 2011.
In summary, the options are:
SeedKit
The JavaScript bindings for GNOME.
There are more options, but those are the two "big ones".
You can write native apps in HTML/CSS and Javascript using node-webkit, is an app runtime based on Chromium and node.js, you can use node.js modules into your apps. it's available on Linux, Mac OSX and Windows
I would like to add QtWebKit to the list. It's like SeedKit with better support.
I'm using it personally on a project where we have native (C++) code for the data layer, business logic and the presentation layer is done via HTML5 and heavy use of JavaScript. As far as I know Qt can be used with python as well so perhaps you could use it for all the business logic.