Listening to file change events in a Chrome Packaged App - google-chrome-app

Is there any way to listen to file changes on disk inside a Chrome Packaged App?
Documentations doesn't mention anything about file changes. Even Chrome Development Team's own Text Editor app is not showing changes automatically on file changes.
Do I have to maintain my own dirty checking loop with an JavaScript interval?

We don't have an API for this unfortunately. There is a long standing bug about adding it here.

Related

Updated a service worker in simple html webpage

I've a simple single page application written in just html/css/js. The content of the page is hard coded into the index.html file. I have a service worker so that the webpage can be downloaded and viewed as an app on a mobile device. I am trying to work out how is best to make sure any updates to the index.html file are reflected in the app version that is downloaded. From what I understand, if the user never closes the app, the updates would not appear on the app. Only after closing the app and then reopening it would the updated content be available. Is there a way to force the PWA to update its content even if the app is left open on a mobile device? Or a way to send a notification that an update is available?
Ajax technology must be used on your pages. The key to solving the puzzle is that Ajax loads the data in the background by using JavaScript and XML, so your page never needs to be refreshed.
There is no code to change, so the answer is very general.

Open with Google Chrome app

Is it possible to make a Chrome app handle certain types of extensions?
For example, setting a Chrome app to be launched when you double click a .txt file, instead of launching the Chrome app first and browsing for the file.
Yes, on ChromeOS via file_handlers. On other operating systems, not yet.
The bug to track this work on Windows: https://crbug.com/130455
Linux: https://crbug.com/138665
I'm not sure if / where there is a mac bug but it is also planned.
This should help you : http://www.computerhope.com/issues/ch000128.htm
Especially the part at the end of it.
In the future - Google it, it was like the 2 result.

Iphone4 "add to home screen" instant startup

How do you make a web app start up instantly - is it possible to make as fast as a native app that is already loaded?
I have developed a HTML5 web app that runs nicely on Iphone 4 with a splashscreen. But now I'm looking into performance:
I use a manifest file to ensure that all files are loaded from the local storage. I have checked both in chrome and mobile safari, that the files are stored correctly locally. Now performance it quite different depending on how I access my web app:
~4s When I load the web app in browser (not from a home screen icon).
~6s When I load from an "add to homescreen" icon
When I load in chrome browser it takes 234ms to load and render the whole page. I seems like the lack of speed is due to the rendering being pretty slow.
Any performance suggestions are very welcome.
I know from experience that a MacOSX device the Chrome App all of its previous versions/updates leaves in its App. This maybe also apply to ios, since it's is a stripped version of the MacOSX sysem.
It might help to delete the Chrome App from your iPhone and re-install it from the App store.
This way you be sure you have a clean copy op Chrome on the iPhone whithout all the previous Chrome versions.
I hope this helps.

Simplest way to incorporate iPhone file upload when building app with Appcelerator's Titanium Developer

Sorry for the long explanation. Thanks in advance to all who are taking their time.
I am an Ubuntu user who has set up Titanium Developer on a MacMini in order to build an app for the iPhone (and ultimately some other platforms).
Rather than having any local code built in, the app simply points to my website. To do that, all I needed to do was change Titanium's tiapp.xml file to include my website URL. I wrote no other code, nor did I need to include any other files. It simply compiled and ran in the emulator without a hitch.
I've got just one problem: I need to upload files to my website and Apple, as most of you know, has disabled the input field type=file. I've got it working in all other browsers. The action simply calls a php file and passes the file info.
If I didn't have an app, and someone was just manually navigating to my site with the iPhone's Safari browser, I could get around the problem by using CliqCliq, which is a very cool iPhone app. Basically, I use JavaScript window.open() to launch CliqCliq's QuickPic browser in a second Safari window. The user chooses a file; QuickPic uploads it; and the user is returned to the second Safari window that I launched with window.open(). The user closes the window and Safari returns them to the first window (i.e., my website).
The problem is that my website is being shown in my app. (By the way, I don't have my developer license yet, even though I signed up a few weeks ago, and I can't test this in the emulator because I can't install QuickPic into it, I assume.) I wanted to repeat the same steps, described in the previous paragraph, using an iFrame but that didn't seem to work (i.e., the iFrame was blank despite my designating a src). I also tried having a hidden window by using old-fashioned frames and setting the col-width to 0. That also did not work (i.e., Safari, if I recall correctly, opened a separate window).
I'm working a little blind, since I can't test anything on the iPhone, but I figure I have two options: I can either find a way to launch a QuickPic in an iFrame -or- I can find some way to incorporate the Apple toolkit file chooser into the Titanium app.
The problem with the first option -- but again, I don't know until I can try this on the iPhone -- is that I assume both apps (mine and CliqCliq's) could not run at the same time. Even if I had a hidden window, invisible iFrame, etc., the moment it launches QuickPic, I assume my app would quit(?).
The problem with the second option is that I don't have clue as to how to incorporate a file picker into my app by using Titanium (keeping in mind, everyone, that I know very little). Brian at CliqCliq has even offered to give me some code if I can't make Apple's file picker work but again, I'm not sure what to do next.
What do you folks think? What's the best method? And, what's the easiest thing for a simpleton to do?
Thanks.
<input type="file"> is not supported on the iPhone. You'll need to use Titanium's APIs, specifically the Media one (openPhotoGallery or showCamera).
As a side note, Apple reportedly rejects apps that are just a webview displaying a website. You may want to consider putting most of the app code in local storage and using AJAX to fetch content.

iPhone code browser?

I want to be able to read code on my iPhone in the bus every day. Ideally, I'd like to be able to download a package, extract it to a folder, put it on the iPhone, and be able to just browse through the code (folders & files and all). Don't need to be able to edit, just read.
Is there a good solution for this? If there is not, could it be a good first project to teach myself iPhone development? or would it be too big a chunk for a first bite? (right now I mainly just do python web app development)
Thanks!
Check out the Airsharing app. When you run the app, it creates a server on your network (when sharing is enabled) and provides you an ip address you punch into a browser. You then upload files to the device via an ajax interface. Later on, you just open up the app and click the file you want to read and it displays on the screen. I've fiddled with it and it does preserve code highlighting.
You might also check out the new MobileMe iDisk app that just got released today. It looks like a slick way to share files between the iPhone and a Mac (and the cloud). You need to be a MobileMe subscriber, though.