If you don't know, appcelerator is a great tool used to build native iPhone / Android apps in native Javascript. As of lately, the Appcelerator team seems to be releasing quite a few updates to their once buggy SDK. Although still buggy, it's much better than this last year.
One MAJOR pitfall that I have seemed to notice after working with appcelerator on MANY different applications is that it's event listeners for touchstart, touchmove & touchstop are unbearably slow. It may be because instead of interacting with objective-c directly, the mods that make up appcelerator and it's communication with Javascript seems to be far to slow to make anything really cool in Appcelerator...
Example One:
1) Making a drawing application using only native javascript is not impossible. The code is rather simple... Create a canvas then map the touchstart and touchmove event listeners, creating a small view. Although this code works, it's ridiculously slow.
var win = Ti.UI.createWindow({ backgroundColor : '#E0E0E0' });
win.open();
win.addEventListener('touchstart', function(e)
{
var dot = Ti.UI.createView({ top : e.y, left : e.x, backgroundColor : '#000', width : 15, height : 15 });
win.add(dot);
Ti.API.debug(e.source);
});
win.addEventListener('touchmove', function(e)
{
var dot = Ti.UI.createView({ top : e.y, left : e.x, backgroundColor : '#000', width : 15, height : 15 });
win.add(dot);
});
Example Two:
Creating a sliding menu is no impossibly either. I created it to where you can use your finger to drag a view from left to right opening and closing the view to show additional options. I won't post code for this example as it's quite a bit more complicated, it's extremely slow and I urge EVERYONE not to waste any time on this.
Long story short, if you need to develop any apps that require cool features like this, either build an objective-c module for appcelerator or use native objective-c. It's really the only thing you can do. Hybrid technology is helpful to an extent in my experience. I recommend learning objective-c to build native modules. This will solve many troubles.
Just a heloful blog post! hope someone finds it helpful.
No comments:
Post a Comment