My experience with Appcelerator and why GearedApp use it

Andrew Walker

For the few months I have been working with and learning about Appcelerator at GearedApp, over the course of my summer internship. Appcelerator is the platform GearedApp use for most of their app development projects, and I have enjoyed getting to know the platform better.

What Is Appcelerator?

Appcelerator Studios is a tool for developing mobile applications. While many people will use other tools like Xcode and Android Studio, the main shortcoming of these is that they will only work on a single platform. That being the case, normally you need to decide to develop for either Apple or Android devices from the get go. This is where Appcelerator differs, and is very useful.

Apps written using Appcelerator can be built to run on multiple platforms. We use it to develop mobile apps for both Android and Apple devices simultaneously, reusing 60% to 90% of the code. In other words, ONE developer can build for BOTH platforms in only slightly more time – that’s a win-win for everyone!

So how does Appcelerator work?

Appcelerator uses a framework called Titanium to allow apps to be developed for different platforms without having to rewrite it from scratch. Unfortunately, this doesn’t just work like magic, and won’t mean it will run flawlessly regardless of the device. However, it does mean that large amounts of the code can be reused.

To get technical, the code is written in JavaScript and it is then compiled into native code, which will vary depending on the device that it is running on. This means that the app’s performance will be close, if not identical, to that of a fully native one (see previous blog post on native vs cross platform apps).

Notes for developers

  • Getting setup: While Appcelerator Studios is fairly easy to use once you have it up and running, I have seen people find it difficult to install and set up. In general I found it was far easier to setup on mac rather than windows. It’s also worth bearing in mind that apps for iOS can only be developed using mac computers.
  • Graphics Options: If you want to write a game or any other 3d graphics application for a mobile device, Appcelerator is definitely not the right tool for the job. There is no option to draw to a canvas (as far as I am aware), and there is no option to use the GPU for graphics rendering. That being said, Appcelerator was clearly not designed with graphics rendering in mind.

Why Use It?

My experience – Working with different devices

Being able to run an app on both Apple and Android devices sounds fantastic in principal, so I was keen to try this out. It turned out to be very painless in practice too.

During my internship I spent a lot of time porting apps from iOS to Android, and was happily surprised to find that large parts of an app’s functionality works the same on multiple operating systems flawlessly.

While some things may have to be changed slightly between platforms, for the most part this is straightforward, and the operating system can be used as a condition to determine which blocks of code to run. Alternatively, multiple code bases can be kept for different platforms.

For example, I was recently working on allowing users to log into an account and upload their videos from an app. The functionality had already been written for iOS, so most of it worked for Android. The login and upload worked perfectly on both platforms with no changes. Only one modification had to be made due to the way Android handle camera selection, which is inherently different from the way it works on iOS.

Accessing Native features

Modules

While Appcelerator and Titanium will allow the developer to do most of the things that they may want an app to do, sometimes this is not enough.

That doesn’t mean it’s the end of the road for Appcelerator. It is possible to go native within Appcelerator and write a custom module. This gives you access to all of the native objects that would be used if the app was written specifically for an operating system.

Recently I developed a module to allow the user to record a video and use it within the app, and I was able to access all of the Native features I needed using a custom module. I found that it does take some work to learn how to create and use custom modules but they have proved to be worth the effort.

Hyperloop

A new alternative to writing a full module is to use an exciting feature called Hyperloop. In developer speak, classes in Hyperloop map to the underlying classes defined in Java or Objective-C, which effectively means that the objects can be used within the JavaScript code.

In other words, native features can be accessed without creating custom modules, adding more flexibility to Appcelerator apps. This has only just been released, but while we have limited experience with this, we are confident that this will lead to much faster apps in the future.

Conclusion

Overall, Appcelerator, like any cross-platform development tool has many positives and a few, small negatives. The amount of code that can be reused makes writing apps for multiple platforms much more efficient. Furthermore, the ability to create custom modules means that there is almost nothing that can be done native that cannot be done here. If you are willing to put in some time initially, it is very beneficial to learn and use it.

For us at GearedApp, Appcelerator is the ideal solution for the majority of our customers, as it allows us to build robust apps across multiple platforms that can be easily maintained going forward.