
A new breed of Chrome Apps - twapi
http://chrome.blogspot.com/2013/09/a-new-breed-of-chrome-apps.html
======
alexandros
Prediction:

The much-anticipated convergence of Android and Chrome is near. These new
Chrome apps are the programming model for the upcoming native Android webapps

The next milestone I expect to see is V8 added alongside Dalvik as a first-
class runtime for Android. Maybe in Android KitKat?

~~~
RivieraKid
As an Android dev I can tell you this isn't happening in the next 5 years.
They may add Chrome apps to Android, but it will be a niche option that won't
be used by anybody.

My utopic wish is a new open platform that will combine strengths of the web
and of operating systems (Windows, Android):

\- Web: Great for documents, which it was originally designed for. Automatic
updates. No installation. You can "fork" an app / document by middle clicking
a link.

\- Operating systems: Great for apps. Speed. More low level access to the
hardware. Much richer platform than the web (window mnagment, human interface
guidelines, ...).

~~~
untog
Why, as an Android dev, do you say that?

~~~
RivieraKid
Because, as an Android dev, I understand that both platforms have different
strengths. Merge of the android and chrome/web platform, that would keep the
strenths of both, is basically impossible. So the only possible scenario is
making interative improvements to the chrome/web platform. But:

1) That would break backwards compatibility with Android apps. They would
basically have to kill Android and replace it with Chrome OS Mobile.

2) Chrome OS platform is far, far behind Android (and operating systems in
general) in many aspects.

~~~
untog
_Merge of the android and chrome /web platform, that would keep the strenths
of both, is basically impossible._

Why do you say that? Add some APIs to the Android browser, allow it to open
apps full-screen... there doesn't seem to be much more to it than that.

~~~
fidotron
That's really not too different from what it takes to package HTML5 code into
Android apps already, with the same result of apps with UIs that feel foreign
to the system.

The trend is not towards HTML5, but actually away from it. Quite honestly the
Chrome Mobile team are swimming against the tide on this.

~~~
jonknee
> The trend is not towards HTML5, but actually away from it. Quite honestly
> the Chrome Mobile team are swimming against the tide on this.

That's quite a statement. The average Android app is already a UI nightmare
that feels foreign to the system, I don't see how HTML is going to be somehow
worse (especially when there would be a full set of HTML5 components to use).

~~~
coldtea
> _The average Android app is already a UI nightmare that feels foreign to the
> system, I don 't see how HTML is going to be somehow worse_

Well, it's gonna be worse by being even more foreign, feeling even more
foreign (what's with custom components re-created for HTML5) and slower.

Actually, it's not a hypothetical: you can already check "wrapped in native"
HTML5 apps and proper native apps, and the former do feel inferior, unless the
developers have put tons of effort in them (and still, they are not able to do
cpu-intensive things that native apps do, from live video filters to audio
stuff).

Of course that might still be OK for simple apps, todo lists, glorified web
clients, etc. But those are not what will drive mobile forward, it's just the
lowest common denominator.

------
jrockway
One thing that I think is really cool about Chrome Apps is that you can write
USB drivers in Javascript that will run on any platform that runs Chrome or
Chromium. This means that if you want to make a hardware device that syncs
with the cloud, all you have to do is write what is essentially a web app, and
anyone with Windows, OS X, Linux, or Chrome OS can use your thing.

I'm personally working on a Chrome SDR app for the Funcube Dongle, so you can
just install an app from the Web Store, plug the thing in, and start listening
to any radio transmission from .5MHz to 2GHz. (The only snag is that the HTML5
audio API doesn't give you 192kHz sound samples, so I think I'm going to have
to read them directly via USB. Fun.)

~~~
kevingadd
The documentation says chrome.usb only works on Chrome OS, are you sure it
works in the actual browser?

Last time I looked into this stuff it's nontrivial to let arbitrary user-mode
applications manipulate arbitrary USB devices on Windows, so I'd be impressed
if they got it working in a secure fashion and deployed it to the open web.

~~~
nraynaud
Chrome packaged apps give the same api in the browser as in chrome OS. The
whole trick of packaged apps, is to get the same API on all OS. And along the
way, google gets apps for chrome OS. I guess it's some kind of chicken and egg
problem, to use the OS you need apps, but developers only develop if there are
users. By having apps working on various OS the entice developers to create
stuff that will also work in Chrome OS.

------
vondur
"Chrome-specific code that means they won’t be able to run on other web
browsers" This sounds vaguely familiar...

~~~
reustle
I agree. I would be much more excited about this announcement if it sounded a
bit more open for other browsers to join in.

~~~
nraynaud
they will be free to copy the API. much of HTML5 is standardizing stuff
already existing in various browsers (ironically, a lot of IE stuff). Firefox
is already working on an API for USB for example.

~~~
lucian1900
But they won't, because Mozilla hates NaCl and loves asm.js

------
simonster
Firefox has made stubs for web apps that can be launched directly from the
desktop since Firefox 16
([https://wiki.mozilla.org/Apps/WebRT](https://wiki.mozilla.org/Apps/WebRT)).
I guess the difference here is more (Chrome-specific) APIs and better support
for running offline?

~~~
derefr
Chrome has had that particular feature for just as long (look for "Create
Application Launcher" in the menu; or right-click a regular chrome app, set
its presentation to "Window", and click "Create Shortcuts".) This is a
separate feature, about creating apps that don't appear to be "from" the web.

------
josephwegner
So, really, there's only two new features here:

\- Launch chrome apps directly from the desktop \- Run chrome apps with out
any of the browser toolbars

Everything else is already possible in a regular chrome app.. Right?

~~~
trimbo
It looks like they open up APIs that otherwise wouldn't be exposed, like
access to the shell and devices.

~~~
wwosik
Cool, Java Applets reborn

~~~
Spearchucker
More like ActiveX components reborn, because these things will only run in
Chrome. Much like ActiveX only ran in IE.

~~~
jonknee
They run "on" Chrome, not in it. A separate icon, window, etc. You need to
have Chrome installed, but it's different from ActiveX in that you're not
going to see "plug-in missing" in the middle of a page somewhere.

~~~
asifsignupfor
Great, phonegap for the desktop :(

------
cassidysummers
It would be nice if the apps they recommended (wunderlist) actually worked. I
have attempted 5 times to "sign up" for the wunderlist app, every time I hit
the button the app freezes on the load screen. Not once has it made it past. I
also have not received one email verifying my attempt to sign up. My first
experience with app launcher and one of the apps would be horrible. Better get
on the ball if you really wanna change the web in such a dramatic way.

~~~
cassidysummers
Just and FYI, if anybody is having this same issue, if you go to the website
(not using the app on your desktop) you can sign up there, then you will be
able to sign in.

------
JoshTriplett
This is, effectively, bringing a ChromeOS-like app interface to Windows (and
soon other platforms). The new app launcher looks just like it does on
ChromeOS, putting Chrome Web Store apps on an equal footing with native apps
started from a Start menu or equivalent.

------
dpweb
Chrome/Android.. What about Chrome/Windows. Notice that every new advancement
in Chrome squeezes out the need for Windows.

They need to improve the APIs for developers though, a Visual Studio 6 for
Chrome platform development, probably the high point in softees history.
Really tie together web with more traditional native api development. No-one
has cracked that yet.

------
Nowyouknow
If I could use the Hangouts extension as an app, I would be so happy. I don't
like the implementation of the extension on my Mac.

~~~
bsimpson
It acts like an app on ChromeOS. I have a buddy list that shows up in my dock,
completely outside any Chrome window.

------
the_mitsuhiko
Our game RAD Soldiers is featured up on the games page:
[https://chrome.google.com/webstore/detail/rad-
soldiers/dkiah...](https://chrome.google.com/webstore/detail/rad-
soldiers/dkiahcckehgdocgonfdickeagmoembpe)

You can cross play with the iOS version, feel free to leave feedback :-)

~~~
platinum1
I gave it a try on my Pixel and found that the touch didn't always seem to
work as expected - for instance, when I rotate the globe, it would always try
to center Africa on my finger and I couldn't tap on cities. I'd prefer if the
game defaulted to fullscreen and allowed me to zoom out more - I assume this
is because it was originally designed for smaller screens.

Also the game was capturing the ChromeOS volume, brightness, maximize keys
(probably as F1-F10 keys) and discarding them.

Past issues specific to the packaged app - great game! Very polished. I love
X-Com and this is right up my alley.

As one of the few who have actually used it, can you give us your perspective
on the highlights and limitations of the packaged apps API?

~~~
the_mitsuhiko
> As one of the few who have actually used it, can you give us your
> perspective on the highlights and limitations of the packaged apps API?

Considering we're a game there is actually very few things that we need to
consider from the APIs. We have our own UI and the integration with the OS is
quite limited.

The reason we were interested in the Chrome version is that we're essentially
a play by mail game in multiplayer so the push notifications are crucial.
Unfortunately the way the push works on Chrome is a bit iffy, way less
polished than it works on Android and iOS but it's not too bad.

Since we're free to play there are some optional in app microtransactions to
monetize the game. These all use the new Google wallet API for packaged apps
and they work reasonably well. Since we allow cross play between iOS and
Chrome we need to be careful with how we set the prizes and making prize
matching between iOS and Chrome is hard due to differences in how tax is
handled.

There is on way to query the final prize for an in-app purchase through the
API which makes things like "-50%" badges hard to implement. The way the game
gets around it is by guessing what the final prize will be. I wish there was a
nicer way but I can see why it's done that way.

~~~
lucian1900
Prices have been annoying, yes. We ended up geoip-ing to guess the applicable
tax and pray that Wallet made the same guess.

There are also some (temporary) limitations with the NaCl runtime (no, it's
not PNaCl, at least not yet).

For example, fullscreen on OS X is quite broken. Keys that shouldn't get
captured, in particular the one to cancel fullscreen. That (and other small
issues) is likely why packaged apps with NaCl aren't yet officially supported
there.

------
tammer
Brilliant that on win8 it sits in the taskbar, right where every Windows user
expects a menu of applications.

~~~
guizzy
That might be why Microsoft brought back the start button in 8.1

They might have been afraid that if they left this prime piece of desktop real
estate, Google might take it.

------
astro1138
I've been hacking on a Chrome App for the past few weeks and have been
wondering how to open a tab instead of a new window. That announcement leaves
me confused: what's new exactly? Is it even possible that the new stuff has
been in the docs for months?

------
kolev
Chrome is a resource hog. I don't want that on my phone, which barely lasts 4
hours idling in my pocket. Thanks but no thanks. On my Mac, Chrome with 20
open tabs is always using most of my memory and CPU.

~~~
bluedino
And Firefox doesn't?

~~~
IanChiles
Firefox as of 23+ uses significantly less memory than Chrome (in my experience
- your mileage may vary though)

~~~
skeletonjelly
Being able to identify which tabs are hogging CPU/memory is a deal breaker to
me.

~~~
Grue3
about:memory shows detailed report on which website uses how much memory.

------
mratzloff
Sounds like Google has decided to try to compete directly with Pokki
([https://www.pokki.com](https://www.pokki.com)).

------
tomjen3
I was hoping this was away to wrap a webpage in chrome and distribute that,
but it seems to require me to distribute it through there webstore. Given that
they don't have a default monopoly on selling things over the web (unlike, say
Android, where they have most of the users), why would I want to do that?

The technology is certainly interesting, if a bit limiting.

~~~
lhaussknecht
I'm also interested in distributing my app offline to my customers, but I
didn't find a solution for that yet.

------
jackspringer
this will be a UX nightmare. windows 8 already has desktop, metro interface,
and now CHROME APPS?!?

------
OlavHN
Its really awesome to see Google taking the web seriously by giving it more
access to hardware, but it would be nice with some indication of where these
APIs are headed.

Are they "forking off the web" or just experimenting before standardising?

------
Achshar
How do I get my app to be in "for your desktop" category? It's not on the
developer page of my app. It's a media player app that matches most of the
requirements of the new apps.

------
millstone
Google says that "packaged apps are written in HTML5, JavaScript, and CSS" but
the first one they show, Pixlr Touch Up, is actually written in Flash. New
breed, eh?

~~~
jarek-foksa
From my read of the code it appears to be written mostly in JavaScript. There
is one NaCl module, not sure what it does though.

~~~
millstone
Err, I guess was testing the Pixlr version in the Chrome Web Store, which I
assumed would be the same thing as the “desktop” version. Is it possible that
one would be Flash and the other would be something else?

~~~
jarek-foksa
Definitely, Flash is on the list of web features that are disabled in packaged
apps:
[http://developer.chrome.com/apps/app_deprecated.html](http://developer.chrome.com/apps/app_deprecated.html)

------
volaski
At first i was excited that finally I can cmd-tab into a chrome app. Turns out
it doesn't. I don't really get how this is so useful.

------
United857
Are these apps supposed to be written in pure JS or are they PNaCl (Portable
Native Client -- basically LLVM bytecode)?

~~~
nswanberg
Whatever runs in Chrome. Wunderlist uses javascript, while Cracking Sands uses
NaCl. Though the apps run in their own windows, opening chrome://inspect in
the main Chrome window lets you examine the various open apps.

------
taskstrike
The new breed of chrome apps has a lot of flaws after I tried to convert my
app over:

-Previous installed chrome app matches the HTML5 api, the new chrome apps has a lot of restriction where you have to totally rewrite you code in terms of storage. i.e. Chrome.storage instead of localStorage; All chrome storage is async.

-The new window format for apps are a huge UI flaw. You can not open an Chrome app in a tab anymore. Basically, you now have an extra window whenever you open a chrome app. This is very annoying since when you click on the existing window the app is hidden in the back, you have to flip through your windows on the mac to find the app you just opened again.

-Javascript execution permissions are very strict, and no longer follows that of a normal webpage.

The result is, you can no longer build an HTML5 app and prepare it for the
chrome store, you have to specifically change the code to package it. This
makes it less ubiquitous and creates extra work for developers.

~~~
daleharvey
> -Previous installed chrome app matches the HTML5 api, the new chrome apps
> has a lot of restriction where you have to totally rewrite you code in terms
> of storage. i.e. Chrome.storage instead of localStorage; All chrome storage
> is async.

I belive this is only localStorage right? (indexedDB is still available afaik)

Firefox OS had mentions of disabling localStorage, its been a huge problem due
to its synchronous API, I dont think it did end up being disabled though, I
would really like to see localStorage being (slowly) deprecated and an async
api (possibly even just a helper for idb) being promoted as an alternative
full web standard as opposed to chrome specific API's coming in here

~~~
tyre
indexedDB is available with an entirely async API. Bring on the callbacks!

~~~
daleharvey
Yup, we have a shared helper in Firefox OS on top of IndexedDB that all the
apps use (localStorage is as close to banned as it can be)
([https://github.com/mozilla-b2g/gaia/blob/master/shared/js/as...](https://github.com/mozilla-b2g/gaia/blob/master/shared/js/async_storage.js))

However thats fine when you are building your own apps, but I meant as a long
term solution to the web platform, if localStorage needs disabled on one
platform in favour of a propietary API, maybe its best to replace it with a
non proprietary web api

------
gcb0
Chrome is now a serious security risk for me. it's just waiting to happen.

for now on, it will be used as the remote debugger for android browsers (until
we have something native). just like i have a spare mac for running xcode for
the same reason.

firefox serves me well. and will not make me worry much.

~~~
comex
All this functionality sounds like an increased attack surface, and it is. But
when the comparison is Firefox, it's far outweighed by the fact that Chrome
has a very good process sandbox, while Firefox has none. It will be years
before Firefox can match Chrome's level of security.

~~~
sampk
Moreover Google has paid millions to security researchers for finding flaws in
Chrome.

