Realizing that there are a few apps missing from the Ubuntu Touch OpenStore, and being an Android app developer, I thought I would try to bridge the gap. Rolling up my sleeves proved to be a bit harder than I thought, though. I came to realize that UT doesn’t use java – at all. The Mir interface doesn’t support the java commands to display or draw things on the screen, so I was a bit stuck.

However, wanting to press on, I did manage to learn how to make a basic “hello world” app. While there are a few tutorials available, it got overly complicated, and I ran into some snags, so I thought I’d share the simplified version here. This is the pertinent info from the UBports website:

 

  • Add the PPA to your system: sudo add-apt-repository ppa:bhdouglass/clickable
  • Update your package list: sudo apt-get update
  • Install clickable: sudo apt-get install clickable
  • Configure docker for clickable: clickable setup-docker

After learning how this works, creating a new, blank or empty app is simple:

alaskalinuxuser@alaskalinuxuser-OptiPlex-7010:~/ubports_apps$ mkdir newapp
alaskalinuxuser@alaskalinuxuser-OptiPlex-7010:~/ubports_apps$ cd newapp/
alaskalinuxuser@alaskalinuxuser-OptiPlex-7010:~/ubports_apps/newapp$ clickable init
Available app templates:
[1] pure-qml-cmake – Pure QML App (built using CMake)
[2] cmake – C++/QML App (built using CMake)
[3] python-cmake – Python/QML App (built using CMake)
[4] html – HTML App
[5] webapp – Simple Webapp
Choose an app template [1]: 4
Generating new app from template: HTML App
You’ve cloned /home/alaskalinuxuser/.cookiecutters/ut-app-html-template before. Is it okay to delete and re-clone it? [yes]: yes
Cloning into ‘ut-app-html-template’…
remote: Counting objects: 28, done.
remote: Total 28 (delta 0), reused 0 (delta 0), pack-reused 28
Unpacking objects: 100% (28/28), done.
Checking connectivity… done.
title [App Title]: newapp
description [A short description of your app]: this is my newapp
app_name [appname]: newapp
app_full_name [appname.yourname]: newapp.alaskalinuxuser
version [1.0.0]:
maintainer_name [Your FullName]: alaskalinuxuser
maintainer_email [email@domain.org]:
Select open_source_license:
1 – GNU General Public License v3
2 – MIT license
3 – BSD license
4 – ISC license
5 – Apache Software License 2.0
6 – Not open source
Choose from 1, 2, 3, 4, 5, 6 [1]: 5
Your new app has been generated, go to the app’s directory and run clickable to get started
alaskalinuxuser@alaskalinuxuser-OptiPlex-7010:~/ubports_apps/newapp$

After creating a directory to store your app, you just run the command “clickable init” to create a new app. The prompts will ask you for your name, version number, email address and license type for the app. Pretty straight forward. Then you can edit the created app files to your liking, and just run clickable to build it:

alalaskalinuxuser@alaskalinuxuser-OptiPlex-7010:~/ubports_apps/newapp$ clickable
No clickable.json was found, using defaults and cli args
Auto detected template to be “pure”
Copied files to temp directory for click building
Successfully built package in ‘./newapp.alaskalinuxuser_1.0.0_all.click’.
337 KB/s (15836 bytes in 0.045s)
Installing files [=========================]
Finished [=========================]
Installing files [=========================]
Starting [=========================]
Finished [=========================]
Installed newapp.alaskalinuxuser-1.0.0.all (installed:click,removable=1,app_name=newapp) summary goes here
alaskalinuxuser@alaskalinuxuser-OptiPlex-7010:~/ubports_apps/newapp$

And voila! If your phone is plugged in, and developer mode is enabled, it can install it and run it on your phone. I also found it useful to use:

$ clickable –desktop

when you want to test it out on your computer, rather than put it on the phone. It seems to work rather well. As a side note, the first time you run it, clickable will download about 500 MB of UT files. This only happens once, not once per app, just once on your machine.

There is also the Ubuntu-sdk, although not supported, it is available if you would like a gui, rather than command line when making your apps. You can install it like so:

sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
sudo apt update && sudo apt dist-upgrade
sudo apt install ubuntu-sdk
sudo reboot # or logout/login

ubuntu-sdk

I’ve tried it out, and to be honest, I prefer the command line, but I might just need to play with it a bit more to get the hang of using it. Hopefully, this will help you if you are trying to get started on app making. I plan to go over how to make an app for XMPP soon.

Linux – keep it simple.

One Reply to “Ubuntu Touch: Making a new app”

Leave a Reply

Your email address will not be published.