OpenStore, TweakGeek and more

Now that the Ubuntu Phone is finally in the hands of many people, it’s time to get some hacking started! This is an attempt to bootstrap some hacking community around the devices that wants to explore the phone beyond of what the platform offers to the normal user at this time. To get this started I prepared an app, called Open App Store that allows hackers to install applications that can’t be published to the official store. This really is not about competing with the official Ubuntu store, but is meant as an extension for power users and developers.

Excited? Download the app here but think twice! This thing opens doors for possibilities to break your Ubuntu installation. Only install it if you know what you’re doing, install it at your own risk and make sure that you know how to reflash your device if you break something [1].

At this point you won’t find many apps in this store, but I managed to prepare two:

* TweakGeek: An app that allows you changing special settings of the device.
* Big Moving Text: You probably know this one from the official store. This version however, is able to keep your display lit while the text is running. Thanks to Michal Predotka for this contribution.

If you have an app that you’d like publishing in this store, here are the rules we’re gonna start with (those might change at some point but for now I think they make sense to see where this is going):

* If an application can be published in the official Ubuntu store, publish it there.
* If an application could be published in the official Ubuntu store if it wouldn’t be about that one cool feature, publish a stripped down version in the official store! Not everyone should and will have Open App Store installed.
* Only open source applications allowed: As the applications might have arbitrary access to the device, every submitted app will get a review and the source code is published along with the app.

Still on board? Here’s how you get started:
* Add an additional .apparmor file to your project (.apparmor.openstore) requesting the special permissions you need.
* Send me a link to a branch for your app to michael.zanetti@ubuntu.com along with some instructions on how to build it if they differ from the standard (Ubuntu SDK).
* Give a short explanation why you can’t publish that in the official store. No need to go into details, a one liner like “needs to keep the display lit” will do. List all the special features you have, if there are more.

Looking forward to your contributions. For now the source code for the Open App Store can be found here. If you want to help out with developing the store app and/or the infrastructure behind it, ping me on IRC or drop me a mail.

Happy Hacking!

[1] http://askubuntu.com/questions/602035/how-do-i-use-ubuntu-device-flash-with-the-bq-aquaris-e4-5

Posted in Ubuntu | 2 Comments

The reward of a loooong journey

Those who know me, and probably also those who followed this blog in the past, will know that I’ve been working in the mobile phone area for a long time now. Even before my time at Canonical, which is about 2.5 years now, I’ve been working for Nokia on a mobile phone platform that unfortunately never saw the light of day. So in total I think I’ve been working for close to 5 years now on getting a phone out the door.

And today it happened! A friendly man from DHL rang the doorbell about 30 minutes ago, handing me over the reason why I’m overly excited right now:










Now this device is a gift for my dad, who did a lot in supporting my way to be a software engineer, so I won’t turn it on right now to not destroy the joy of the first time welcome bells and whistles for him. And anyways, you can find a lot of pictures and videos of Ubuntu Touch out there in the internet by now.

Posted in Ubuntu | 5 Comments

Unity8 windowed mode

I’ve received requests from people asking how to try the windowed mode on their unity8 enabled devices (yes phones too). Here’s how it works:
You need a phone or tablet, flashed with the devel-proposed channel. On a PC, running an up-to-date vivid and having unity8-desktop-session-mir installed should get you going. Get a terminal on the device somehow (ssh/adb/terminal app) and execute:

gsettings set com.canonical.Unity8 usage-mode Windowed

While this currently works on phones too, there’s the issue that the window’s title bar is hiding behind the panel so you can’t really drag the windows around. Start the gallery-app to get around that. On larger screens, the panel should allow you dragging windows from there too. Here’s some screenshots:

Windowed mode on Nexus 4

Windowed mode on Nexus 4

Windowed mode on Nexus 7

Windowed mode on Nexus 7

Windowed mode on a PC

Windowed mode on a PC


To get back to staged mode, do:

gsettings set com.canonical.Unity8 usage-mode Staged

Again, this is still an early work in progress, loads of stuff missing in windowed mode. The gsettings flag is considered temporary and experimental, it might disappear at any time. Also, we might disable windowed mode on form factors where it doesn’t really make sense, like on the Nexus 4 screenshot above.

Posted in Ubuntu | 11 Comments

WhereTheIssAt redone

A couple of weeks back, I did a talk about how extend your QML application with a Qt/C++ plugin for the Ubuntu App Developer Week. The focus of this talk was really on how to write the QML and C++ code to make it work and I didn’t really get into the build system. As that was a live example I took – what I thought was – the shortest path to get something that compiles the plugin and I just created a new project with the UbuntuSDK picking one of the old style templates. That created a qmake project, and I just hooked that up to the Ubuntu QML app template somehow.

Today however, our master of the SDK (namely Zoltan) told me that there is a much easier way already which also provides seamless integration with the rest of the Ubuntu tools like click packaging and directly running it on the phone. Apparently that would have been available already back then, but I missed it. So in order to avoid other people missing out on this too I’ve updated the WhereTheIssAt example to use that template.

Here’s a quick walk through:

With the latest SDK, create a new project and select “Ubuntu -> QML Extension Library + Tabbed UI”

Once you’ve got that ready, you can jump straight into adding the Qt/C++ code. What I did is to drop the “mytype.cpp” and readd the “iss.cpp” from the previous project. Obviously that involves a small change in the backend.cpp, replacing “MyType” with “Iss”, but that’s it. A quick copy/paste of the wheretheissat.qml file replacing the generated TabbedUi sample code later, the project was again ready to run:

The biggest advantage (besides you not having to fiddle with multiple project files) is that it gives you click packaging for free. This is another big step for the SDK and makes it much easier to extent your QML app with Qt/C++ code.

I’ve pushed the code again here http://bazaar.launchpad.net/~mzanetti/+junk/wheretheissat/files

Happy hacking!

Posted in Ubuntu | Leave a comment

Ubuntu App Developer week

Yesterday I did a tutorial for the Ubuntu App Developer Week. The topic was “Extending QML Applications with Qt/C++ plugins”. If you’re interested in that topic but you’ve missed the session, you can watch it here:

You can find the example code used in the tutorial on Launchpad.

Today I’m going to do a session about using qmltestrunner to test your QML applications. You can watch it live at 15:00 UTC at http://summit.ubuntu.com/appdevweek-1403/meeting/22137/testing-with-qmltestrunner/. If you can’t make it, this site will keep the video for you to watch it later.

Posted in Ubuntu | 3 Comments

Shine for Ubuntu Touch released

Hey ya, using the UbBloPoMo as an opportunity to let you know that Shine has been released to the Ubuntu Touch App store.

Here’s a couple of screenshots:

Grab the source code from: https://github.com/mzanetti/shine

I’ve tried to keep the ColorPickers as generic as possible (i.e. it doesn’t depend on other shine code at all), so if anyone needs a color picker, you’ll know where to find it!

EDIT: here’s a more generic description of what it actually is: http://notyetthere.org/ubuntu/shine/

Happy hacking!

Posted in Ubuntu | 3 Comments

Little sneak previews

Recently I’ve been busy working on the right edge gesture in Ubuntu Touch. Here’s a little sneak preview:

Note that this is still work in progress and probably won’t hit the image really soon.

If you’ve been paying attention while watching the video you might have noticed that I used Ubuntu Touch to control my living room lighting. That is done with a set of Philips Hue Lightbulbs which I got end of last year and a soon to be released app called “Shine”, running on Ubuntu Touch, MeeGo and Desktops.

Stay tuned!

Posted in Ubuntu | 15 Comments

Ubuntu SSO on Touch

Hey folks, it’s time to cross another app off the list of applications to be created for Ubuntu Touch. If you’re still relying on Google Authenticator to log in to your Ubuntu SSO account, you’ll be happy to hear that you can use your Ubuntu phone for that now. Ubuntu Authenticator can be used for the two factor authentication for Ubuntu SSO and other OATH-TOTP compliant two factor auth sites. It also features easy configuration by scanning QR-Codes using the camera.

Only event based (counter) authentication tokens are supported at present. Mainly because I only use two factor authentication with Ubuntu SSO and didn’t spend the time to search for a timer based authentication. But hey, as usual the app is free and open source software; If you are interested in contributing support for the timer based auth method, let me know.

The app is submitted to the Ubuntu Store and pending review. It should be available for you to download soon.

Source code at: https://code.launchpad.net/~mzanetti/+junk/ubuntu-authenticator

Posted in Ubuntu | 3 Comments

car2go meets Ubuntu Touch

Back in the days when Nokia (RIP) shipped their first phone with Qt support, the good old N900, I created my first phone app. After having used this app for quite some years, having ported it to Symbian and later MeeGo, it finally reached its next platform, which is, of course, Ubuntu.

Apparently this is the first app in the Ubuntu Store which ships its own binary executable instead of being launched by qmlscene, so some hickups were to be expected. But Jamie did an awesome job fixing them all immediately and giving me some additional hints on how to improve packaging, so we managed to publish it today. Here it is, GetMeWheels for Ubuntu Touch. A car finder application for world’s most awesome car rental service, car2go.

Display a map with cars Show details for a car
Vie a list of all cars, sorted by distance Select your location

It’s also quite impressive for me to watch how the car2go service grew. I remember the first prototypes for it driving around here in Ulm. Later, at it’s launch, it was only Ulm and Austin where those little white-and-blue Smarts were to be seen. Now, 4 years later, you can just hop on a car and drop it off wherever you want in those cities: Wien, Vancouver, Toronto, Calgary, München, Ulm, Hamburg, Düsseldorf, Berlin, Köln, Stuttgart, Birmingham, London, Milano, Amsterdam, Denver, Minneapolis, Austin, San Diego, Washington DC, Portland, Miami and Seattle.

More information and source code here.

Posted in Ubuntu | 4 Comments

On manually creating click packages

After my last post, praising how easy it is to manually create click packages even if QtCreator doesn’t support that for compiled apps yet, I got requests from various people asking me to share the knowledge. So here is how I did it:

* Build your application for the arm architecture. You can either use a pbuilder environment to create a armhf.deb package and extract it again afterwards or just compile your stuff on the phone (or in an arm chroot). I won’t go into much details on this as I assume everyone writing a C++ app knows how to compile it. Compiling it directly on the phone might be the easiest way to get some binaries for now. Just copy the whole source tree to the phone and just use qmake/cmake and make as used from the desktop.

* Create a new directory and copy all the reqired binaries into that. Also copy QML files, .desktop file and application icon into that directory. In the end, everything required by your application should be in there. Don’t put any stuff in there that shouldn’t end up in the package (e.g. .cpp files, .moc files etc)

* Test running your application from within this directory. Your application should be able to start up from there, not requiring anything to be installed to /usr or similar. In case your C++ code loads QML files, it needs to find them relative to the binary’s location.

* Make sure the .desktop file’s Exec entry starts up the application from the local directory, e.g. calling it as “./myapp” instead of just “myapp”. Also make sure the icon filename is relative to the location of the .desktop file.

* now create a manifest.json. Here’s an example (from uFit) of what it should look like:

{
"description": "Ubuntu FitBit app",
"framework": "ubuntu-sdk-13.10",
"hooks": {
"ubuntu-fitbit-app": {
"apparmor": "ubuntu-fitbit-app.json",
"desktop": "ubuntu-fitbit-app.desktop"
}
},
"maintainer": "Michael Zanetti ",
"name": "com.ubuntu.developer.mzanetti.ubuntu-fitbit-app",
"title": "uFit",
"version": "0.1"
}

* Create <appname>.json file. This one is responsible to request permissions for certain capabilities at AppArmor. This step is the equivalent to the one described here: http://developer.ubuntu.com/publish/packaging-click-apps/
Here’s the example of uFit:
{
"policy_groups": [
"networking"
],
"policy_version": 1
}

Add any additionally required policy_groups as a comma separated list. Check out the above link for a list of possible values.

* We’re almost done. It’s time to create the package:
# click build <directory>

This should produce the click package ready to be uploaded in the current directory. But wait, you probably want to test it on your phone before actually uploading it, right? So here’s how you do that:

# sudo click install com.ubuntu.developer.<yourID>_<packagename>_<version>.click
# sudo click register --user=phablet com.ubuntu.developer.<yourID>_<packagename> <version>

Now you should be able to find the app by searching the Application lens and you should be able to run it from there. If it doesn’t start, get to a commandline and do this:

# tail -f /home/phablet/.cache/upstart/unity8.log

Watch the output that happens when you try launching the app. It should tell you what’s wrong with it.

Hope this helps!

UPDATE
Very useful tip from Colin in the comments:
You can install and register in one step by passing –user=phablet to click install, but it’s better to just use “pkcon install-local foo.click”.

Posted in Ubuntu | 7 Comments