client-side storage for a client-side-only web app? - html

I'm teaching myself web development, and am working on a small and free web-app on the Chrome web store written in HTML and JavaScript. I'm trying to keep the app entirely client-side since I don't really want to pay a monthly fee for a web hosting service at this time. The app relies on localStorage for saving bits of text. I urge the user to back it up with copy/paste, but this is sort of a crude workaround.
Does anyone know how I might provide an interface for file management that involves only the user's hard drive or some sort of free file transfer service? Could an embedded Java applet do this? I basically want the functionality of the File API, apparently not yet implemented in Chrome (http://www.html5rocks.com/tutorials/offline/whats-offline/).

Nevermind--File API is implemented in Chrome. See http://www.html5rocks.com/tutorials/file/filesystem/ for a tutorial.

Related

Can cloudrail be used serverless?

Cloudrail seems perfect to simplify interaction of a web page with e.g. google drive or other cloud service.
And this may be due to my lack of understanding and lack of knowledge of web development and Node.js, but can cloudrail be used serverless?
Or in other words can cloudrail be used on a stand-alone html page on a local computer (i.e. served by the filesystem instead of a server) and be made to access google drive or even work with an off-line mode while on a stand-alone html page (which may later sync with google drive)?
The reason being I would like to design a simple mobile app that accesses the cloud (fine so far) that is mirrored as a simple portable web page that can sit anywhere (desktop/laptop/mobile/USB stick) and is not served by any server but simply loaded from the local filesystem.
If not cloudrail, what other technology might I need to achieve this?
I don't think you can use it as a standalone website the way you describe it. You might be able to realize your use case though by e.g. using CloudRail's Nodejs SDK with Electron. This allows you to create an application very similar to a website with Javascript while still giving your users just one file that runs pretty much everywhere.

Mobile App from Web App, caching data/login

I have a given Javascript browser application with login screen and data display screen. It does request JSON data via calls that are always the same (i.e. http://myserver.lol/api/getData?mobile), the data changing only slightly over time.
What I want is a mobile app for Android/iOS/Windows Phone/Blackberry, which
-> at best "caches" the whole web site (html/js...) in the app, so I don't have to rebuild the app whenever the web app changes;
-> provides some form of "auto-login"/"auto-form-fill", so the user does not have to give his credentials every time, and
-> some kind of long-term cache for the JSON data, so it is requested from server when a fast network connection (LTE/WLAN) is available, but taken from Cache on GSM or without connection.
Which Framework would allow to implement this the easiest? I am just now looking at the PhoneGap docs and the Titanium docs, but I guess I am overlooking something, or don't they provide an easy solution for this? Or perhaps you have an insider tip for me on another framework?
You can definitely handle this buy using both frameworks. I use only Phonegap / Cordova.
I would do this all by building the application with Phonegap together with AngularJS.
You can use templates in there, so you don't have to fetch the Ui from your server.
To cache data (user credentials or JSON data) I would just use the localStorage which is available on all devices (see here).
I recommend angularJS because it is a really great framework which helps you build Web-Applications really fast (but if you already have an existing application this might not be an option for you).
I hope this helps ;-)

Options to enable web software to work offline? Or perhaps build desktop software?

I created a scheduling software for beauty salons as a web application. The idea is that the business owner can schedule customer appointments with a hair stylist. I made it web based because eventually these beauty salons need to integrated into a larger cloud service. So far, I've only put in about 40 hours of coding.
One challenge i am encountering is that a lot of beauty salons may have poor internet connectivity. They may experience temporary outage that last several hours to several days. But during this time, they still want access to this web application .. at the very least for read only purposes.
I understand that html 5 in modern browsers support offline capabilities via things like localStorage and cache manifest. It appears to me that at the moment, I need to do a drastic rewrite of my existing application to make use of localStorage and cache manifest to allow the web application to work offline. The reason this is so is because my web application writes/saves a lot of information to urls like http://mywebsite.com/api/somefunction?queryparams=value1 via ajax calls. These ajax calls need to be replaced by function calls that write to localstorage.
So my questions are:
a) To enable my web application to work offline (at the very least, read only of the website should be offline), I should replace my ajax calls with calls to localStorage. Is this the best approach?
b) Would it have been better to create this application as a .NET desktop application? Especially if there are microsoft technologies that help with synchronizing stored client data with an external database at a later time?
My opinion:
a) I wouldn't say you should replace your Ajax calls. Rather, you want your code to notice when it is offline and store stuff in localStorage then. You wouldn't always store in localStorage as your clients are going to be online sometimes.
b) That's kind of a loaded question I think. :) So... my thinking is this: Building a web site makes sense as it would let your clients at the salon access their data both from computers in the store and other devices as well. So for example - if the salon's internet access is down, the employees could perhaps use your website via their mobile phones too. Having the data be web bound gives them more ways to get to it.

How do I deploy my box.net application

I have create an box.net application according to the documentation.
Now, I would like to share the application with my colleges. Does anyone knows, how I can make it? IMPORTANT, I dont want to deploy it in public.
Thanks in advance
It really depends on what kind of Application you've created. There are fundamentally 2 types of apps in the Box "App Marketplace"
1) Apps that run on a server at a URL you own. Box sends calls to you, either for file-actions (think right-click, open-with kinda stuff), or for webhooks.
2) Apps that are built for a specific device (like an iPhone or Android). They show up in our marketplace, but the download links take users to the itunes or an android store to download the app. These apps call into Box via APIs (see https://developers.box.com/docs)
If you've built a #1, then you need to figure out where you want to host the software you wrote. Box makes it easy to host it on Heroku, or CloudFoundry, or Parse, so you can get going quickly, without having to provision your own hardware, etc.
So, it really depends on what kind of application you've built.

Database Driven iOS Apps

So this is more of a general question about apps and techniques rather than a specific code question...
When developing an larger app, how would a developer access lots of data from a website. The example I'll use is an app like Yelp. They have both a web-access site and an app, both share the same information. I would imagine that information like that is stored on the website via some sort of MySQL database and the iOS device access's it as needed based on the user's requests.
How might a developer writing an app start something like this? I assume you need to somehow securely tie the MySQL database to iOS and so on. I've seen a lot of techniques on the web, but they all seem very simple and not safe for a large scale app.
Any ideas would be awesome!
The key term you're looking for is "API" (Application Programming Interface).
A Yelp iOS app won't access Yelp's databases directly. There will be a layer (I simplify here somewhat) between that and the iOS app; this layer will provide a series of methods (the API) by which clients can make queries and potentially manipulate remote state.
A common API format is JSON over HTTP, and indeed, this is what the official Yelp API seems to be.
Good starting points would be the documentation for NSURLConnection and NSJSONSerialization, and the Yelp API documentation I link above.