This article is part of a series of blog posts covering the many different areas of work going on in Ubuntu right now. See the introduction post here that links to all the articles.
In my last article I talked about the new app upload process, but today I am going to talk about how developers write apps in the first place.
For a long time our app developer story in Ubuntu has been quite fragmented. This has been due to a number of reasons:
- We have not had a single consistent platform that we ask developers to write to. We have traditionally supported GTK, Qt, and anything else that lives in the archive. This not only presents a inconsistent developer experience, but also an inconsistent user experience too.
- We lacked app design guidelines around how developers should build apps that look consistent on the platform.
- We didn’t have a single consistent developer portal and support network to provide the support and guidance app developers need to build awesome apps and get them into the platform.
- We also didn’t have a good answer for writing an app that can work across multiple form factors.
- Finally, we didn’t have a single consistent SDK that developers could use to write apps: they had to pick from a plethora of tools, with varying degrees of quality.
We tried to rectify some of these issues by recommending people write apps with Python and GTK, and we wrote a tool called Quickly to optimize this process. Quickly would generate a project and help with tasks such as editing, creating your UI, and generating a package, but quickly was a somewhat primitive and incomplete solution to the problem.
The work on Quickly also showcased some limitations in our tooling. At the time we recommended people write apps using GEdit, Glade, and GTK. Unfortunately, this collection of tools just didn’t compare favorably to the developer experience on Apple and Google’s platforms, despite the best efforts of the respective upstreams. We needed to provide an end-to-end SDK for developers that would take a developer from a new project through to submitting the app into the Ubuntu Software Center.
Choosing a Technology
We set out to resolve these issues and build a consistent Ubuntu SDK.
The first decision we made was around which frameworks we wanted to support when developers write their apps. These frameworks needed to be highly efficient and able to converge across multiple devices. We finalized this list as:
- Qt/QML – native applications that can be run on any of the devices and adapt to the screen size.
- HTML5 – web applications that can also adapt to the device with deep integration into the system services (e.g. messaging menu, launcher etc).
- Online Services – integration of web apps into the system services (e.g. messaging menu and unity integration).
- OpenGL – full OpenGL support for games.
Some time ago we decided to focus on Qt as a platform for not only building our SDK but building our convergence story too. Qt has many benefits:
- It provides a fast C++ library and toolkit as well as a neat higher-level declarative technology in the form of QML. This means that we have the power of C++ for system software (e.g. writing Unity) but app devs can write apps using a high-performance higher level technology that is easier to learn and faster to write apps with.
- Qt provides an awesome set of tools – an integrated IDE, debugger, designer and more.
- The Qt Creator IDE is very pluggable which means we could use it for our main IDE and use it for writing apps in HTML5 and OpenGL.
- Qt and QML documentation is fantastic.
- Qt has a strong eco-system surrounding it and lots of companies in that eco-system. This makes contracting out work and hiring much easier.
- Qt is a healthy upstream and very keen to work with those who consume it.
We also started looking into the best way in which we could support HTML5 developers. While the IDE decision had been made (Qt Creator) we also decided to invest in building Apache Cordova support into our SDK to make writing HTML5 as flexible as possible. This way you can either write a stock HTML5 app or use the cordova functionality…all accessible within the same IDE.
The Ubuntu SDK
We formed the SDK team and started work. This work was broken into two areas.
Firstly, we started work on the app developer platform. This is largely identifying the needs of app developers for writing apps for Ubuntu devices, and ensuring we have support for those needs (which largely requires integrating that support and creating APIs). This has included:
- Building the Ubuntu Component set – a set of widgets that are usable in QML and HTML5 that developers can use to construct their apps.
- Application lifecycle (suspending apps to preserve battery life).
- Location Services.
- Multimedia and Music.
- Calendar Integration (using Evolution Data Server).
- Sensor services (e.g. accelerometer).
This work is currently on-going and in various stages of completeness, but all of these platform APIs will be ready by the end of August and many apps are already consuming them. Remember, these services will be made available across all form factors.
The second piece was the SDK itself. This is tuning the Qt Creator IDE for our needs and ensuring it can be used to create QML, HTML5, and OpenGL apps. This work has touched on a number of different areas and has resulted in the following features:
- We have project templates for QML, HTML5 (Cordova), HTML5 (Stock), and Scopes – here you can easily generate a project to get started with.
- Source control integration for Bazaar and Git – this makes collaboration around an app easier.
- Device integration – with just a click of a button you can run your app on an Ubuntu device to test that it works correctly.
- Click package generation – generate a click package that you can use to upload to the Ubuntu Software Center.
- Ubuntu Component Showcase – browse all the different Ubuntu components and see the code for how to use them.
- Integrated documentation, IRC, design guidelines, and Ask Ubuntu support.
We rolled all of these features into the first Beta of the SDK which was released about a month ago and you can get started with it on developer.ubuntu.com.
Speaking of developer.ubuntu.com, we have invested significantly in making the site a central resource for all of your development needs.
Currently the site provides tutorials for building apps, API documentation, and a cookbook that brings together the top rated questions from Ask Ubuntu. The site provides a good spring-board for getting started.
We are however in the process of making a number of improvements to developer.ubuntu.com. This will include:
- Revised site navigation and structure to make it easier to use.
- Better and more clearly integrated API documentation.
- Wider API coverage.
- Cookbooks for all of the different app templates.
- Full integration of Juju Charm documentation and API.
We are expecting to have many of these improvements in place in the coming weeks.
Are We There yet?
As we stand today we now have a powerful Ubuntu SDK with support for writing convergent apps in Qt/QML, HTML5, OpenGL, and writing Scopes that fit into the dash. You can go to developer.ubuntu.com to find out more, install the SDK, and fine tutorials for getting started.
We are only just gettin started though. The 1.0 of the SDK will be released in October and expect to find more refinements, better integration, and more features as we understand the needs of our developers better and expand the platform.