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 | 2 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

uFit clicked!

A couple of months back, roughly the same time when the Ubuntu SDK alpha was announced I bought myself a fitbit to get back in shape after being hit by the lack of activity that can come along with a home office job. As I already wiped Android back then and started dogfooding Ubuntu Touch I quickly hacked together an app to track the status with Ubuntu Touch. The outcome of this is uFit, the Ubuntu fitbit app.

uFit

With the announcement that click packages for Ubuntu Touch can be uploaded and distributed through the application lens since the beginning of this week, I decided to get my hands on it. The first problem I faced was the fact that the Ubuntu SDK so far only supports packaging up pure QML/JS applications and the documentation for click packages so far only deals with it’s architecture and development rather than its usage. However, all my applications are mostly written in C++ with only a thin UI layer in QML. Still, I decided to give it a shot. uFit seemed simple enough for a start with only one QML plugin. It didn’t take long to find out that click packaging is one of the easiest packaging formats I came across so far. I love how simple it is to create a package. After uploading the package yesterday, I already received a notification today that the app has been published.

Long story short, as of today uFit can be downloaded to your Ubuntu Touch device directly from the application lens.

For those more curious, the source code can be found at
https://code.launchpad.net/~mzanetti/+junk/ubuntu-fitbit-app

Enjoy

Posted in Ubuntu | Tagged , , | 10 Comments

GetMeWheels 1.3

I didn’t really expect to release another version of GetMeWheels for the N9, but a recent chain of circumstances led to this new feature release. Admittedly, it doesn’t add much, but as car2go once again broke all the existing installtions, here’s an update that makes GetMeWheels work again. Additionally, it implements a in-process OAuth mechanism. Instead of firing up the webbrowser and asking you to type the PIN number into GetMeWheels afterwards, the settings dialog now opens the page itself. Once you’re logged in, it grabs the PIN on its own and bringing you back to the app.

Download link here (Nokia N9):
http://notyetthere.org/data/getmewheels2_1.3.0_armel.deb

Posted in Uncategorized | 1 Comment

The bleeding edge of smartphone hardware

Despite working on Ubuntu and being quite deeply involved with things happening around it, this week I was surprised by what I think is one of the most exciting things in mobile devices. In case you missed it, Ubuntu launched a crowdsourcing campain to create the most powerful phone hardware we could think of, the Ubuntu Edge. Of course it’ll run Ubuntu (besides being able to dual boot to Android) but it will also ship with the full converged device experience we’re all working hard on at Ubuntu. With 128GB of storage and at least 4GB of RAM (the CPU is not exactly specified yet, but is said to be the most powerful one you can get at the time the device is manufactured) this will be the Formula 1 car among mobile devices.

Does this sound awesome? I think it certainly does! There’s one caveat though: This will only happen if enough people are interested in it. Of course I already backed the project and am watching the progress closely. The goal to raise 32 million Dollars is ambitious, some say its even crazy, but hey, we’re not talking about some crappy el cheapo phone here so it requires to take bold steps.

If you think this is exciting too, don’t miss out on supporting the campain and make sure to preorder your device now! If you don’t want to spend that amount of money yet but still think this is a great project and want to see it happen, back it with any amount you can and want afford.

Check out the Indiegogo project page here and spread the word about it!

Posted in Ubuntu | Leave a comment