About HTML5 offline storage & cache for iPad app - ios

Why HTML5 rocks now ?
If just use one word to answer, I think probably it will be "cross-platform".
You can build products using HTML5 one time , distribute for different platform such as Web and iPad etc.
But after some research, I found that several problems with HTML5 family tech
Not robust : there are a lot of randomness , and not easy to control
Storgage limited : even no clear answer for max size (?) , and sure there are limitation of storage
Not best user interaction : compared with native iOS app
Any other problems you think ?
And if you are HTML5 guru,maybe you will correct some wrong understanding of mine.

The biggest problem for me is that right now HTML5 is not a standard. It's not even a complete specification.
But this has always been the problem with building web applications; everyone implements them to different degrees of completeness, and you have to be constantly vigilant of implementation variations.
If I end up having to maintain multiple versions of the same code for each browser anyway, I start to question whether the "it works everywhere" argument is even sound anymore.

Related

is Adobe Air capable of converting a complex Flash game into iPad/android platform game?

I've recently heard about the converting feature of Adobe Air but how well does it work?
Does it emulate every bit of code a complex Flash game using tons of libraries outputs or should you expect a lot of work to go around if you were to convert one?
I'm thinking of making a complex cross-platform game but not sure which is better/easier, to use Flash and Adobe Air for its abundant game libraries, resources and faster development or to simply go with Java.
It Would really save lots of time if I can use Flash. Though, I can imagine it would also give me headaches to worry about all the time. Like what if adobe/apple stops supporting Flash or what if the converting feature won't work.
Any advice and any bit of information would be welcome. Thanks.
AIR works well on iOS in my experience although native apps will always perform better. I cant think of any aspects of Flash that wont work when converted to run on iOS.
Whether AIR performance is good enough really depends on the individual case - how gpu and cpu intensive the game is.
You have to consider the trade-off: use existing Flash skills to create a 'good' game quickly; or learn new skills to create a 'better' game slowly - is it worth spending weeks/months learning new skills to get a few extra percent of performance? Only you can decide that.
Regarding Adobes AIR support in the future; who knows - they dont have a great track record (think flash on mobile) - but i would suggest AIR will be around for at least the medium term, if not long-term.
My personal opinion is that "mobile" is not going anywhere and now is the best time to start learning Java for Android and/or Objective-C for iOS. Like PhoneGap, Flash mobile Apps don't give you complete access to the devices entire API/SDK options, even though what they do offer usually suffices. Flash is still a respectable tool but developing "native" gives you full control over your app's memory, device interaction, cutting edge APIs, etc ...
Depending on how optimized your action script 3 code is written, you may experience some performance issues vs utilizing native graphics libraries. I assume the latest version of AIR (I know Flash 11.2 and on included some nice graphic stuff) may address performance but haven't seen any benchmarks for AIR on mobile devices yet.
If you are hoping to go the AIR route, I'd say why not take a few days and try to port it over. If all else fails get a nice iOS or Android book and cuddle with it every night until you are confident you can recreate your App natively.

State of SVG Performance on iOS and other Tablets?

Having decided to go with D3.js and SVG for visualizations it now looks like SVG will work fine in a desktop browser or native shell but I'm really perplexed by the drop in performance speed on the iOS mobile platform.
According to the following tests it now looks like SVG performance is getting better and not that far behind Canvas speeds, this is the good news:
http://bl.ocks.org/2647924
http://bl.ocks.org/2647922
The bad news is that if you run these tests in the Safari browser on the new iPad the speeds drop a lot for both SVG and Canvas. The terrible news is that if you run these tests in the new Chrome browser for the iPad the speeds drop much more.
I've read that Google is forced to use the UIWebview that is not accelerated by Apple's Nitro JavaScript engine. I've also read that Apple is pushing HTML5 but the demos only run in their own Safari browser.
What is the problem here anyways? The best target for my app is mobile yet even with great API's like D3.js and HTML5 standards like SVG performance is being pinched, is this just because Apple wants to hold up progress for their own agenda? Thats how it looks to me anyways. I'm not sure what these tests look like on Android? It would be great to know. If the tests would be positive maybe I will get rid of the iPad and just go with Android already.
The bottom line is that I'm just not sure if it is feasible to make my app using HTML5 technology due to these speed issues? I also have no interest in learning Objective-C as the future is going to HTML5. I believe in the web and its standards but it looks like they are being blocked. I'm very interested in knowing solutions to this dilemma.
iOS7 has notably bad performance animating SVG with JavaScript - although static SVG drawing is massively faster. We wrote a blog on the performance of the iOS7 release, which you can see for more gory details.
Update: iOS7.1 fixed the javascript animation performance problem. It's back to 50 fps
I found d3.js/SVG on my first gen iPad massively slower than running the same app on desktop browsers (FF/Chrome/IE 9+).
I wrote up the various improvements I attempted here: http://hivemindmap.blogspot.co.uk/2013/01/html5-and-interactive-graphs.html
Performance will usually be lower on mobile devices than on desktop kit. In general their hardware is less powerful (it's geared more towards low power consumption than outright speed) and they have a hell of a lot less RAM and storage to play with. Chrome on my desktop has multiple processors, 8gb RAM and a ludicrously powerful GPU at it's disposal. On my iPad it doesn't have anywhere near that level of power.
3rd party iOS applications (including Chrome) cannot use Nitro, that much is correct. I believe this is because Nitro is able to mark memory as executable and (for security reasons) 3rd party applications are not trusted to do that. Most HTML5 stuff will work in any browser on iOS (with the possible exception of Opera Mini). Canvas and SVG animation will be slower than in Safari because it's all driven by Javascript - again the lack of access to Nitro holds them back. This is no longer true: As of iOS 8 third party apps can now use the WKWebView framework which does have access to the same high speed javascript engine as Safari.
Native code will usually be faster because it's much closer to the hardware, hitting the display APIs directly, rather than going through the web stack.
The solution is usually to simplify everything. In the same way that native game developers had to massively reduce the complexity of their 3D games to make them work on iOS devices, so web developers have to reduce the complexity of their SVGs and canvas apps. Less stuff flying around the page means higher performance, in general.
There's a number of tricks you can do, and a lot of reading around the subject. Have a read of http://www.html5rocks.com/en/tutorials/canvas/performance/, http://www.html5gamedevs.com/tag/performance/, and the rest of Google. Personally I'd build a proof of concept and test it before completely abandoning the idea :)

Html5 for iOS game development

I have been hearing of the advent of html5 for iOS development. I know nothing about web dev technologies and am wondering, can this really be used for iOS game development? Just hearing html makes me think this will be used for web related apps, not things like graphically dynamic 2d games, but being unfamiliar, I'm hoping to get some insight from the experts here. Is html5 going to be useful at all for games, or should I basically expect to be sticking with the likes of cocos2d for iphone?
The short answer is "Yes, you can develop full speed, interactive games with HTML5". Check out "Private Joe", "Biolab Disaster" and "FUBAR" in the Apple app store. All were created with HTML5, Javascript, and a few javascript libraries (ImpactJS and Box2D).
One thing you'll see as you explore this is the repeated caveat that "web games aren't fast enough", also "Web games can't use the device's goodies - like GPS, vibration, etc."
These statements represent "common thought" and are not really true anymore. Companies like PhoneGap and appMobi have tools that make it possible to do anything in HTML/JS that can be done in native apps. Browsers keep getting faster, and smartphone processors also keep getting faster. Qualcomm's new chipset even has GPU acceleration for future smartphones.
As an added bonus from coding your app in HTML5, you will have the choice of whether to compile it app into a native app and post to one of the app stores (using appmobi or phonegap), or to offer it yourself as a web app (saving the Apple censorship and 30% tax).
Viva HTML5!
The real benefit to using HTML 5 for game development is that it's a write once, deploy everywhere strategy, meaning you can write the same code and have it work on iOS, Android, Windows, MacOS, Linux, etc, as long as it has a browser.
The HTML5 canvas element supports both 2d and 3d (on some platforms), so you can use it for complex games as well.
This will, however, run in a browser, so the only way to sell it in an app store is to wrap it in a UIWebView container or the like.
Also, there are games written in Canvas (just google it, also google 'chrome experiments' to find cool 3d stuff in HTML5).
I wrote this HTML5 Tetris implementation: http://htmltetris.com
It is designed to be equally playable on a PC and on touch devices supporting Javascript touch events.
One of the important things to get right in a mobile game is the control scheme and it took some thinking to come up with the swipe/tap control scheme used for Tetris here. But it turns out quite playable (in fact, just as playable if not more so than all of the tetris like iOS apps I have tried, and there are... quite a few of them) and is proof that it is possible to build a perfectly playable game with HTML5 technology.
Check out HTML5 Canvas. Lots of Web games are based on this tag. Here are some samples :- http://www.canvasdemos.com/type/games/
There are two great things about investing your time in learning HTML5 and its counterparts:
For one, every application that you write will theoretically be able to run on many platforms. iOS, Android, Windows, Mac, Linux, etc, all have HTML5 capabilities. You'll also be investing your time in a language that is still being developed, so you'll already know the ins-and-outs of it as more features are added, and you'll have mastered it when the final product finally goes mainstream.
The capabilities and power of HTML5 are only expanding, so the experience with the language should only improve with time ;)

How can I differentiate between smart phones and others?

I'm looking to revamp our mobile site with something simple for phones below the ambiguous smart phone category and something a little more interesting for the phones above this category. I'm not interested in WAP/WML for this project. I'm building a ASP.Net 4 MCV 2 app and using MBDF
What I'd like to know is how best to define this differentiation when using MBDF? Screen size, Javascript, SpportsTouchScreen etc. are all in MBDF along with others but I'm not sure where to draw the line and where the data is most accurate for the broad number of devices.
What do those of you out there developing for this spread of hardware & software split on?
Thanks,
Denis
P.S. I've done my research on xHTML MP1.0 - 1.2 and the best practises for implementation to ensure broad coverage but I don't want to restrict the newer phones out there to what the base line can see.
I personally use simple mobile browser dedection script and limit max screen width to 240px. I also use simple AJAX and JavaScript calls too.
Above setup works fine for 90% of my visitors but my sites aren't business critical sites.
You can try http://wurfl.sourceforge.net/ but .net api is not as good as PHP one
So after a bit of testing myself I think I'm going to stick with testing if they support JavaScript and Touch using the MBDF. This line in the sand isn't perfect but it seems like the best out there to me.
Here is a neat little tutorial on Browser Detection using JavaScript
Browser Detection

Best analytics offering for iPhone

What is the best iPhone analytics offering out there? I've seen Pinchmedia but I'm not sure about it since the default application page says "Last Updated July 2008".
Nowadays Pinch Media has been merged into Flurry. Flurry is a decent choice.
If this is a quick project 'afterthought' you'll be pleased to know that basic Flurry integration is a one liner in the AppDelegate :)
I've tried several packages and Pinch Media is by far the best. I don't know where that July 2008 date comes from, they've been releasing updates regularly and are super-responsive to feedback and questions emailed to their support people. Whether by coincidence or not, several of my suggestions have made it into the current Pinch libraries
Aside from the excellent support, the reason I prefer pinch is that they seemed to be the only package that updates several times a day - usually once per hour. This is great if you're trying new advertising techniques, or just like obsessing over your sales figures (as every developer does at first :)
On the downside there are two issues I have with Pinch - their website can be a little clunky and isn't very iPhone friendly (ironic!), and at times they've had problems where stat updates aren't available due to hardware problems. I also wish they had an "overview" for all your applications.
It's worth pointing out that all of the analytics libraries are extremely easy to build into your application and all work with both the simulator and hardware so it's extremely easy to evaluate them to find the one you like best. It's even possible to use several at once - though I would only do this for testing.
Google :)
http://code.google.com/intl/fr-FR/apis/analytics/docs/tracking/mobileAppsTracking.html
Flurry is a very nice option. In my most recent app I have tried Appsee Mobile Analytics which I like if you're looking for something different - they give you video recordings of user sessions and heat maps. It's a little more interactive than other analytics
If you are interested in visual analytic tools, like heatmaps, or you want to get some inside on the way that your users use your app you should try heatma.ps
Quantcast, who is well know for audience demographics measurement for websites, launched it's Quantcast Measure for Mobile Apps program earlier this year. Their iOS, Android, and PhoneGap SDK is available on github.
At this point you may well want to roll your own - on a constrained device do you really want a third party library taking up an unknown amount of limited network bandwidth and processing power?

Resources