Consumers are actually willing to pay for Apps, less so for Web Sites.
Camera, Microphone, Telephony, Contacts, Filesystem, etc...
Hey, you have to make a living somehow...
But this is less and less a factor as JavaScript performance increases, leading us to...
We have plenty of web frameworks designed to recreate the "native" look and feel along with hardware accelerated transitions.
We already have local storage and offline storage via cache manifests
We already have iPhone meta tags and stuff like mobile-bookmark-bubble
But we saw that is changing fast...
This is the one defining factor for many apps.
A Javascript API for building Mobile apps
A thin wrapper around a WebKit browser with native augmentation
PhoneGap-like augmentation + plus commercial support
Specialized use-case: Games. But neat idea...
Both want to sell you service contracts.
Titanium Docs / PhoneGap Docs
Differences are usually documented, but sometimes not. No audio recording on Android, for example.
Xcode and Interface builder are very nice tools, bundled build processes are a little hackish.
Handles deployment to simulators and devices for you
This works about as good as you expect: works great when it works, leaves you searching the forums for some archaic error message when it doesn't.
Compiles down to native code. Does not use HTML/CSS styled to look like native. Stuff Splitview are native.
...which sorta sucks. If we're developing Javascript we probably already have our tools and editors we like. And now configuration options are buried inside of hacked-on IDE (Aptana built on Eclipse)
Look at the KicthenSink app first, probably before the Google. New features get added to the App, then documented
Better than PhoneGap (which has none and needs stuff like ChildBrowser)
Better tools come with a not-that-cheap monthly subscription
And build again. Titanium auto populates the necessary frameworks, but sometimes when you add new code it doesn't rebuild correctly. Especially do this if you get errors for unknown API methods that are spelled correctly.
Building all your stuff by hand gets boring. Can try stuff like Xib2js. People say a native titanium one is coming.
You'll want to build up some functions for calculating your element positions (especially forms) so you don't end up with a bunch of magic numbers in you code.
...without any real good feedback
So when something isn't working right, look to your options and use the intelliSense if necessary
But the details are always in the objects themselves
Lower code noise
Ti.UI.createButton( ... ) Titanium.UI.createButton( ... )
Ti.App.Properties.setString('APIKey','12334456');
var val = Ti.App.Properties.getString('APIKey');
Always make sure you have a error handler as you don't want your app stalling forever if someone goes in a tunnel.
If you are updating a UI element - make sure it still exists by the time the request comes back as the user may have moved on.
var xhr = Ti.Network.createHTTPClient();
xhr.onload = function(e) {
var json = this.responseText == '' ? JSON.parse(this.responseText) : {};
// Do stuff
};
xhr.onerror = function(e) {
// Catch error, show an alert
};
xhr.open('POST','http://site.com/update_data.json');
xhr.setRequestHeader("content-type", "application/json");
xhr.send(JSON.stringify(data));
Not really Titanium's fault, but Javascript's fault. Expect to be a little far removed from the binary data for files, sounds, images, etc. and expect to have access to them be a bit slow.
Generally fast with great HTML5 & CSS3 Support, WebSockets. It has good looking native Audio & Video elements. Hardware accelerated CSS3 Animation support makes stuff look native.
You can use the tools that your are comfortable with already.
Just make sure you've waited for onDeviceReady and then follow the docs.
You generally want to build and debug your main app on the Desktop (with Firebug) and then worry about mobile.
WP7 Support isn't great, BlackBerry, same thing
And there are some weird bits as well with some callbacks not support closures, etc.
The position:fixed; + overflow:auto; issue (Fixed in iOS5)
Lot's of workarounds exist (Scroll view using iScroll4)
No video auto-play, no audio auto-play. No manual keyboard (input field only)
No more JSONp hacks. Can make Ajax calls to any domain and pull and push data at will (using $.ajax)
According to Apple - you shouldn't download and execute JS unless you do it in a Child Browser window. This makes things like OAuth little painful.
Compiled in his own JavasScriptCore (which is included by a Private library) - All Graphics use OpenGL and sound users OpenAL. Must be built using stock Impact engine code.
Please, take the time to read them before agreeing to a client project...