Developing for Ubuntu Mobile/Touch - Programming Linux - Ubuntu Unleashed 2017 Edition (2017)

Ubuntu Unleashed 2017 Edition (2017)

Part V: Programming Linux

Chapter 44. Developing for Ubuntu Mobile/Touch


In This Chapter

Image Install the SDK

Image Create Your First Application

Image References


When Ubuntu first announced the creation and release of their Unity interface, discussed in Chapter 3, “Working with Unity,” and the idea that Unity was to be the interface of the future, many were skeptical. The idea that one interface could be used across a wide variety of devices seemed impossible. Today, Unity has matured and is quite usable on desktop computers and laptops. Not everyone realizes that it also works on touch screen devices like phones and tablets, and can even run on some TVs. Convergence is the word and the goal: one interface for all your computing, whether mobile, traditional, or something unusual like a television.

Now that the unification of the style, look, and feel of the interface has occurred, the next step in convergence that is needed is to deal with the issue of different forms of human-computer interaction. Traditionally, we interacted with a device using a keyboard. Then we added the mouse. Then notebook computing came along and brought touchpads with them. The newest devices use touchscreen technology. Right-clicking, left-clicking, hovering, and many other concepts are tied directly to the mouse or touchpad style of interacting with a computer. This is not how people use touchscreen devices.

Here is where this chapter comes in. Applications that are developed for touchscreen platforms can be adapted for traditional devices, just as traditional applications can be adapted for touchscreen platform use. But, what if applications were developed in a way that keeps both interaction styles in mind? This is the idea behind developing for Ubuntu Mobile, also called Ubuntu Touch. An app created to run on Unity on a touchscreen device can also be used on Unity on a traditional device using a mouse. Where you may slide your finger across a telephone screen, you can hold down a mouse button and move the mouse cursor in the same manner on a laptop screen to perform the same action. No more having to learn new methods of interacting every time you pick up a new type of device!

Developing in this manner is new. The process is still being adjusted as Ubuntu is learning what works well, what doesn’t, and gets advice from groups like the Ubuntu Carrier Advisory Group (CAG). CAG is made up of representatives of and advisors from many of the world’s largest mobile phone companies and was set up to help guide Ubuntu in creating a platform that they will find useful as well as one that users will love.

So, because this is new, what is written is this chapter is subject to probable and sometimes rapid change. Check the resources available in the Reference section if you discover something that seems different from what is expressed in this chapter (please send me a note at matthew@matthewhelmke.com so that I can be certain to include the adjustment when I update future editions).

Install the SDK

The Ubuntu Software Development Kit (SDK) includes a set of development tools to make the job of writing applications easier and faster. It isn’t yet in the Ubuntu repositories. It is, however, in a Personal Package Archive (PPA), which are described in Chapter 39, “Opportunistic Development.” It is stable and in active use by Ubuntu developers writing applications right now. It is also the default and recommended method, so let’s use it.

First, we will add the PPA to our sources, like this:

Click here to view code image

matthew@seymour:~$ sudo add-apt-repository ppa:ubuntu-sdk-team/ppa

Update your local cache of what is available in the software repositories, so that the contents of this PPA are included:

Click here to view code image

matthew@seymour:~$ sudo apt-get update

Install the SDK:

Click here to view code image

matthew@seymour:~$ sudo apt-get install ubuntu-sdk

Create Your First Application

Writing apps for Ubuntu Mobile is done in the SDK. Launch the wizard from within the SDK menu at File > New File or Project. This will walk you through the process and is quite simple for even moderately experienced developers.

From here, read the official documentation listed under Resources. The processes and procedures are undergoing rapid development and change, making print versions of any documentation quickly obsolete.

References

Image http://developer.ubuntu.com/en/phone/—The website for official documentation from Ubuntu about getting started as an Ubuntu developer for mobile.

Image http://www.ubuntu.com/phone—The main web page for Ubuntu on phones.

Image http://www.ubuntu.com/tablet—The main web page for Ubuntu on tablets.

Image http://www.ubuntu.com/tv—The main web page for Ubuntu on televisions.

Image https://wiki.ubuntu.com/Touch/—The main web page for Ubuntu Touch.

Image https://wiki.ubuntu.com/Touch/Emulator—The main web page for the Ubuntu Touch Emulator, a tool to help with development for Touch while using a traditional device like a desktop or laptop.