Developing mobile apps with Appcelerator Titanium
Aug 18th
Recently we have been working with the development of a really exciting mobile app for one of the BootstrapLabs portfolio companies.
It is a mobile social service in the social discovery space, it’s about discovery of people and places and what to do.
As the client is targeting multiple mobile platforms with their service we looked at a few different options, from doing native development in Objective-C (for iOS) and Java (for Android) or going with a HTML5 based approach, such as Phonegap.
We have a strong preference for the native user experience, and the client was very clear that a native experience is important as they are targeting to be a natural utility for their users on a daily basis. At the same time speed to market, and an agile development cycle was a crucial requirement.
We ended up in the middle, and with a choice of using Appcelerator Titanium as the development platform for this project. Appcelerator provides a environment where you can develop a common code base that can be built for both iOS and Android devices.
Building mobile apps in Javascript
For many this might be very attractive. Our development team is very experienced with Java, and more structured languages, and to us Javascript actually is a bit of a setback in productivity, and a step away (mostly in the effect of not being able to as quickly create solid, tested and reusable components) from the more rigid control of types and usage you get in a language like Java (now Objective-C is somewhere in between).
The good
The great thing with Appcelerator, that even our non-Javascript developers got really up to speed quickly to flesh out the basic structure of the app.
Look at this short code snippet it creates a window with a tab group, and adds a sub window/view to that.
var window = Titanium.UI.currentWindow;
// create tab group
var tabGroup = Titanium.UI.createTabGroup({});
tabGroup.addTab(
Titanium.UI.createTab( {
icon: Titanium.Filesystem.resourcesDirectory + '/images/icons/11-clock.png',
title: 'Dashboard',
window: Titanium.UI.createWindow( {
url: 'taskDashboardWindow.js',
title: 'MyTasks',
barColor: '#000000'
} )
} )
);
window.add( tabGroup );
tabGroup.open();
The bad
The Titanium Appcelerator product is a not yet very mature. It holds great promise in terms of developer productivity, and after their purchase of Aptana, they have a really great Eclipse based development environment (although we would prefer Eclipse plugins, so we could use the Eclipse environment we use for everything else together with Appcelerator). The Aptana based version now called Titanium Studio offers step-by-step debugging, and a lot of powerful features to aid through the development cycle.
The ugly
The way Appcelerator compiles Javascript code down to native code does not always translate well, and there are a million of quirks to avoid, to get your app to work well and be stable. Once our app grew big enough, we started to see all kinds of instability issues. Mainly related to any communication of JSON HTTP requests. But it is hard and unpredictable to diagnose.
Summary
Consider Appcelerator and Titanium Studio for your next mobile development project, but it is not the short-cut or rapid development path we were hoping it would be. It has a lot of benefits. We will continue to use Appcelerator, but we are looking at both 100% native and web based wrapper approaches for a number of the applications we are developing going forward.
Ad-hoc iPhone distribution made easy
May 3rd
Right now we are developing an iPhone app for one of the BootstrapLabs companies. It is a social service, and right now we are starting to roll-out pre-alpha testing.
The ad-hoc distribution has always been a pain for Apple’s iPhone, and each tester had to be pre-registered and sync through iTunes on the Computer.
This time we decided we wanted to test something new and gave TestFlightApp (https://testflightapp.com/), and so far it seem to work great.
It is just as easy as upload the .IAP file, enter e-mail addresses and send them out. The user will then automatically register any mobile provisioning profiles just as before, but it is much easier for the user. The user then needs to register the development profile, but it can all be done from the iPhone, no need to connect the phone to iTunes.
Ruby on Rails style productivity in Java!
Dec 6th
The Java Play Framework is a great framework for quickly creating REST ful Java web applications. It removes all the Java EE boiler-plate code and makes the development very fast and efficient.
Most of our projects here right now are built using the Play framework, and we are seeing an strong increase in productivity and how quickly we turn around changes to the products we are creating.
Some of the things we value the most are:
- Simple framework, and easy to integrated with client frameworks such as jQuery to built really compelling and interactive web applications.
- We can tap into the vast amount of open-source Java libraries out there, so we can quickly prototype build, and add new features quickly. Some of the recent things we built, we added a fully fault tolerant, distributed Event Driven aspects to one application in 2 hours. In another application we added support for PDF reports in 1 hour!
- It has always been possible to create scalable fault-tolerant applications in Java, with Play! we are doing it in model that we can scale to what we call web-scale software (millions and millions of users), this is not automatic with any framework, but we find it fairly easy to do so.
- We don’t have to give up skills in Java or the benefits of a compiled language, while Play! makes it easy to test instant changes (with some smart real-time bytecode replacement in development mode).
- We get the superior Java performance of the JVM with Jit compiling (yes it is screaming fast, those who say otherwise have not really developed any real apps in Java! There is a reason many of NASA’s and other computation intensive programs are built in java today), and none of the Python, Ruby or other platform woes of deployment issues, tied to compiling to different hardware architectures (try Python on Solaris for example…) – the JVM is really abundant and works well (and behave the same) on most platforms .
Here’s a great video that shows just how easy the Play! Framework is to get started with:
A web app in 10 minutes using Play framework from zenexity on Vimeo.
Apple to Open Source it’s Java for OS X
Nov 12th
Today Apple and Oracle announced that Apple is Open Sourcing it’s Java implementation for OS X and join the OpenJDK project. Read Apple’s press release here.
This is great news for everybody that develop Java or use Java based applications on the Mac, it means that the JVM will be much more in sync on OS X, both in terms of functionality and release schedule.
Real-time web browser apps
Nov 8th
We believe we are seeing an emerging real-time economy, that is demanding real-time web applications. The best way to build these applications is a fairly proven concept of what is called Event Driven Architecture, and works fairly well in traditional server and client computer environments.
But due to the nature of the HTTP protocol, Javascript and HTML standard, creating a distributed Event Driven Architecture that is seamlessly integrated with a web-browser client-side has a number of challenges.
Recently we started building a generic solution to solve this, and come around some of the common problems that arise.
Background
Right now in more than one application that we are building at this time, we have a need to provide a web-based user interface that is as responsive as a native app of events on the server-side. Many applications solve this with polling, but that has two major drawbacks:
- It’s not really real-time, as there is a polling intervall (lower intervalls will make this go away).
- It’s very wasteful on resources, both on the server side, networks and the client web browser, as the constant polling creates new requests and round-trips to the server even if there is no new events. Trying to mitigate no 1, will just increase the overhead.
So what can we do to get around this?
We started developing a Remote Messaging framework that consists of a Java back-end (running in our favourite web framework Play!), and a Javascript client framework, that allows Javascript code to subscribe to message (or event) queues in a real-time pub-sub model.
Early tests have worked very well for us, and is not dependent on HTML 5 WebSockets, here is a short example of how the code might look like on the client and server side.
Client-side code can pretty much do this:
RemoteMessagingFramework.subscribe( ‘tweet-xxxx’, function(msg) { … } );
On the server-side, a back-end job listening (and filtering) the Twitter real-time feed might do:
Message msg = new Message( payloadObject );
RemoteMessagingFramework.publish( “tweet-xxxx”, msg );
And that is it!
When the server publish a message, the client will receive and the provided event-handler function (in client-side Javascript) in the browser will be called to process the msg in real-time.
Status of the project
The framework is in it’s infancy and fairly basic, and still needs more testing, bug fixing, and work, but it looks promising, we are hoping to get this to a mature level to be included in our current projects, and the if we reach appropriate critical mass and stability we will do our best to open-source the framework. No promises yet though!
We will also look further into how we can build a HTML 5 agnostic solution, that falls-back to older browsers, but will use HTML 5 and Web Sockets if available. Other options that we might explore is integrating this to a Messaging Queuing back-end (JMS).
Thoughts, ideas? Would you be interested in the framework and use it for your applications? What typical applications would you be interested in building using this?
No java on future Mac OS X?
Oct 21st
Sad news that it seems like Apple is relinquishing it’s Java support for future versions of Mac OS X, for more information from Apple read here.
Her at BootstrapWorks we are heavy users of both Java and Macs and the Java support in Mac OS X is essential for what we do, and both the developer tools and productivity tools we use.
We just hope that this might be a move from Apple to either “purify” it’s new Mac App Store around core OS X technologies or that they are striking a partnership with Oracle/Sun about them stepping up their base-line Java support for the OS X platform (which would actually be a great move, and get Java on the Mac up to date with Linux and Windows at a higher pace).
The sad thing about Apple’s move with the App Store, that some great applications on OS X, such as Eclipse or applications built on top of that framework will not be distributable through the new Mac App Store.
Coming out of the Java closet
Sep 28th
Some comedy around our favorite language and platform; this Norwegian video is just too funny, enjoy!
“We want to program like they do at Oracle”
Sep 23rd
As you know at BootstrapWorks, we do a lot of work in Java and related platforms.
We didn’t make it to Oslo this September for JavaZone 2010, but their promo videos are just great: After last month’s faux indie movie trailer for Java 4-ever, about a young man who can no longer hide his suppressed love for Java from his orthodox .NET-loving family, they bring us “LadyJava.” Now, Lady Gaga references are on thin ice thanks to sheer overuse, but this gets a pass for the sheer density of nerd puns and for the fact that it doesn’t seem particularly to care about faithfulness to Lady Gaga.
We don’t really know how they program at Oracle, but we were big fans and supporters of Sun, and we are pretty sure the Sun continues to live somewhere inside the database shaped Oracle glass buildings in Redwood Shores!
Launching BootstrapWorks!
Sep 21st
We are very happy to announce that today BootstrapWorks is being launched.
BootstrapWorks is a technology and software development lab, that offer world-class software development resources to BootstrapLabs and it’s companies and to some external clients outside the group. BootstrapWorks is part of the BootstrapLabs group.
BootstrapWorks has primary focus in mobile solutions and in building back-end scalable solutions that power millions and millions of daily users. Read some more about BootstrapWorks on our website, where we will add more information and blog posts as we go on the different projects we are working on. We are heavy on building production level code that can be iteratively refined during the life-cycle of a product or solution. We work mostly and prefer Java and frameworks and technologies such as the Play Framework and scalable databases such as SimpleDB or Apache Cassandra, but we have experience in Python/PHP, Objective-C and use those technologies were applicable.
If you are building a web-scale business and need help building that back-end system, don’t hesitate to contact us!
