Build/design a mobile app using HTML5/Javascript?

Started by
6 comments, last by capn_midnight 9 years, 6 months ago

I've been hearing lots of stories about people building an iOS/Android app using HTML5/Javascript. Now, I've done alot of searching, and haven't really found any answers as to how you actually do it. Do you need some sort of SDK or special dev tool? I already know how to build iOS/Android apps natively, and I have a decent knowledge of HTML5 and Javascript.

These are a few reasons I'm asking:

- Since I hear it can be done, I'd like to give it a try.

- I have a job interview as an SDET and I'd like to have a working example by then, if possible.

- On my last job, I worked at Amazon and our app was also web based mobile app (some HTML/Javascript, and Selenium for debugging/automation) but since I wasn't a dev, I didn't know exactly how they did it.

Now, to be clear, I'm not asking how to build some webpage using HTML5/Javascript only to navigate to it on the mobile browser, I mean your app launches the HTML5/Javascript from <insert URL here> or some offline content packaged inside the app, and it runs as a standalone program.

I tried googling this, but nothing really made much sense at the time. Any ideas? Thanks.

Shogun.

Advertisement


Do you need some sort of SDK or special dev tool?

No you don't you can write an web app in regular HTML5 and javascript and include a splashscreen and icon and a few Apple specific meta tags at the top of your document. It looks like a web app that the user navigates to in the browser but safari will show a prompt asking the user to add your web app to their home screen, Once they do this your app will appear and function just like any other native full screen application.

There are frameworks available that make it easier to develop iOS apps with HTML5 a few popular ones are:

PhoneGap
Sencha
Titanium

It depends on what you call "an app" vs "a page"?

I would say the differences are:

1. An app can be installed from the app-store/google play and will then apear with your other apps.

2. An app reposnds to different types of touch commands, where as a page usually responds to taps.

3. An app switches screens, where as a page scrolls down.

4. An app has access to phone specific APIs. (Camera for example)

So to answer these questions:

1. To put your "app" on android/apple stores, you will need some wrapper written in native code. There are ready made wrappers such as phone-gap, but you can also implement your own by using a webview and loading your HTML code. However, this code is not HTML5. It is native code.

2. Basic tapping is good at first, but later you might want some fancier controls. You can write your own, or use some ready made "plugins". This code is HTML/Javascript. I find various jquery controls to be very useful, but you can find a million others (or write your own).

3. Same as #2 (see above).

4. For security reasons, not all of the phone features are accessible to an HTML page/app. As in case #1 you will need a native wrapper to get access to these things.

Disclamer: I have not programmed for windows-phone, but I know that they have better support for HTML apps. If you are targeting this platform, read-up on this subject separately.

My Oculus Rift Game: RaiderV

My Android VR games: Time-Rider& Dozer Driver

My browser game: Vitrage - A game of stained glass

My android games : Enemies of the Crown & Killer Bees

I'm generally a contrarian guy.

I have zero interest in incurring app store selling fees or being at the mercy of their random-at-best-bribed-at-worst featuring lists.

Everything else you mention can be done in the browser already. I can bookmark an SPA and have my own icon on the smartphone's launcher screen. I can design whatever touch interactions I want. I can run in offline mode. I can build around screens instead of scrolling. And I have access to a plethora of APIs, yes, including the camera. All without a wrapper.

I can even do virtual reality.

The app store isn't going to help you sell units. It's going to help you feel like you've done "enough" to sell your app and then you're going to languish at 2 sales a week for the next 5 years. If, then, marketing and advertising my app is already on me, then why put up with the Apple or Google taking a 30% cut? What, exactly, did they provide for a larger chunk than the US government charges me? At least I get roads out of that deal. At least I get... no, sorry, roads is all I'm coming up with.

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

You can write a full aplication in js+ html5, only difference from real OS platformed one is the fact that your applicaiton cannot write the data to client side, as well as cannot read from client side (it can be by passed by explixit settings of browser, but who would set it on though...).

So if you remember this design pattern from the very beginning you can do just anything.

But you can have a user choose a file, you just can't automatically load it without their interaction. And you can save a file, you just have to let the use pick where to save it. Or, you get several MB of storage in the browser itself, youv could just use the localStorage DB.

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

you just can't automatically load it without their interaction. And you can save a file, you just have to let the use pick where to save it.

A very few design patterns can come out this way, since confirmation from user would have to happen per file read/write :)

Better way is to read a requested http distant file that browser find in its local file cache.

One should design html application to need a server for user initiated data writes, and you can distribute server with the application any moment you fall for it.

If you really need a lot of storage, you don't even need to do that. You can just sync to Dropbox or Google Docs. I have single page app right now that that is how it persists user data, and it works quite well, without any user intervention beyond the initial granting of permission.

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

This topic is closed to new replies.

Advertisement