How I built a Hacker News mobile web app, Part 2
cheeaun.com
cheeaun.com
s/the/a
You wrote A Hacker News mobile app. There are quite a few others.
While it looks nice and all, There is nothing any more or less official for this mobile web app versus any of the others that are already out there.
Not that his app isn't neat- The way he emulated a native app is technically interesting. But the presentation as if it were an official app is misleading.
Here are two others I happen to have bookmarked.
I suspect there are others, as well.
Thanks for the post! I find the write up technically interesting!
You should change the name because there are many other projects called HN Mobile and because none of these are official. Here are other apps called HN Mobile or Hacker News Mobile:
- https://github.com/ctice/hn-mobile
- http://www.newmediacampaigns.com/blog/hacker-news-mobile-fro...
Remember, creating a project and submitting a link to HN isn't personal, just a lot of hard work and luck! Happy Monday!
Sorry about that.
But really, that looks great. Love the attention to detail! I like mobile web approaches a lot. And getting that native look and feel seems to be a big reason (sometimes unspoken) why clients don't want to use the browser. Nice to see some effort put into breaking down that barrier.
I agree entirely about HNmobile being a non-standalone app. I've being working on something similar and after considering deploying it as a standalone webapp or even wrapping it with PhoneGap and submitting it to the app store I've gone with a non-standalone web app. Basically if a substantial part of your 'app' is opening links in mobile safari then keeping the app in a traditional browser environment (with back button etc) gives the best user experience.
But why didn't you go native ? Your controls are pretty much the OSX ones, why did you concentrate so much in the iOS CSS look-a-like interface ?
Also, you could go hybrid, mixing native controls with a webkit view for the data.
Nevertheless, good work.
1. You might want to add the following to remove the Mobile Safari UI chrome when users add the app to the Home Screen:
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="apple-touch-startup-image" href="img/splash.png">
2. On the iPad, the clickable regions are a bit awkward. The external link takes up a good 95% of the menu item. The view comments link is (logically) the button, but it's too small relative to the importance of the discussion on HN.
Off-topic: Best way to read HN on mobile IMHO is just to take the Android stock browser, surf to HN and forward the article links with a long press on the article titles to Readitlater or similar services without opening the articles. Fast, simple and convenient (and a great example for Android's intents). I think on iOS there some more steps plus the HN site isn't well readable in iOS' stock browser because of the missing word wrap—maybe that's the reason why there are so many HN apps on iOS while we have only one on Android.
I'm not sure if you had a look at it yet but there is a PhoneGap/Cordova plugin called ChildBrowser that may do what you want here. I can help you getting setup with a PhoneGap project for your app if you want!
"Since it's hosted on another domain, the API supports CORS so that HNmobile can do cross-domain XMLHttpRequests."
Why don't you use JSONP?
var allowCrossDomain = function(req, res, next) {
aptUtil.log('using cors to allow for cross domain xhr');
res.header('Access-Control-Allow-Origin', '*'); //any domain can submit requests to us.
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type');
next();
}; app.use(allowCrossDomain);We often find with our Javascript exception tracking that it catches ALL javascript exceptions, which as often as not actually involve javascript from external sources. I'm not sure how this would sneak into mobile safari (unless it was being used on another device) but we often get exceptions from Chrome plugins and the like, which we cannot control.