Canonical Voices

Posts tagged with 'mobile'

Mark Shuttleworth

Check out “loving the bottom edge” for the most important bit of design guidance for your Ubuntu mobile app.

This work has been a LOT of fun. It started when we were trying to find the zen of each edge of the screen, a long time back. We quickly figured out that the bottom edge is by far the most fun, by far the most accessible. You can always get to it easily, it feels great. I suspect that’s why Apple has used the bottom edge for their quick control access on IOS.

progresion

We started in the same place as Apple, thinking that the bottom edge was so nice we wanted it for ourselves, in the system. But as we discussed it, we started to think that the app developer was the one who deserved to do something really distinctive in their app with it instead. It’s always tempting to grab the tastiest bit for oneself, but the mark of civility is restraint in the use of power and this felt like an appropriate time to exercise that restraint.

Importantly you can use it equally well if we split the screen into left and right stages. That made it a really important edge for us because it meant it could be used equally well on the Ubuntu phone, with a single app visible on the screen, and on the Ubuntu tablet, where we have the side stage as a uniquely cool way to put phone apps on tablet screens alongside a bigger, tablet app.

The net result is that you, the developer, and you, the user, have complete creative freedom with that bottom edge. There are of course ways to judge how well you’ve exercised that freedom, and the design guidance tries to leave you all the freedom in the world while still providing a framework for evaluating how good the result will feel to your users. If you want, there are some archetypes and patterns to choose from, but what I’d really like to see is NEW patterns and archetypes coming from diverse designs in the app developer community.

Here’s the key thing – that bottom edge is the one thing you are guaranteed to want to do more innovatively on Ubuntu than on any other mobile platform. So if you are creating a portable app, targeting a few different environments, that’s the thing to take extra time over for your Ubuntu version. That’s the place to brainstorm, try out ideas on your friends, make a few mockups. It’s the place you really express the single most important aspects of your application, because it’s the fastest, grooviest gesture in the book, and it’s all yours on Ubuntu.

Have fun!

Read more
Victor Palau

I am pleased to announced that Logviewer is now published in the Ubuntu Touch store.  The app no longer runs unconfined but uses “read_path” pointing to “/var/log/” and “/home/phablet/.cache/”. If you think there is another interested log path let me know and I will try to include it.

Also, one feature that landed by popular request is submitting a selected section of a log to pastebin , thanks to Popey for the image:

pastebin


Read more
Victor Palau

[Ubuntu Touch] Logviewer

I have been recently doing some android development for Techfunder, one thing that I have found really useful when testing my app is using CatLog. CatLog allows you to check the app and system logs on the go. This is extremely useful when you have a crash while you are not close to your laptop.

This motivated me to look into writing a similar app for Ubuntu Touch. So here it is: LogViewer!

logslogsettingsunitylog

This app, like CatLog, is for developers and requires unconstrained running. You will need to install it manually:

  • Download click package from launchpad
  • transfer to your device and install:
  1. adb push com.ubuntu.developer.vtuson.logviewer_0.1_armhf.click /home/phablet/
  2. adb shell

  3. su phablet
  4. cd ~
  5. pkcon -p install-local com.ubuntu.developer.vtuson.logviewer_0.2_armhf.click

When you launch the app, you will get a list of .log files in /home/phablet/.cache/upstart/ , if you click on an specific log, it will be displayed in a similar manner to tail -f. You can pause the autoreading, clear the screen and copy to clipboard parts of the logs from the bottom menu.

You can also access other files, change font size of the logs and the size of the text buffered from the settings page.

You can see the code and contribute :) in launchpad:

https://launchpad.net/logviewer


Read more
Victor Palau

We announced today a new solution to dual boot Android and Ubuntu on the same device. Over the last few weeks I have recently blogged about a Contacts import app for Ubuntu and  Techfunder, an Android app for crowd funding projects. What I didn’t mention before is that I have been developing and testing both in the same device!

I have been dog-fooding and developing a small part of our dual boot solution for a couple weeks now.  During that time, I’ve not only been able to boot between Android and Ubuntu as a user, but also as an application developer.

Dual boot brings no compromise to the SDK experience of either operating system.  I run Ubuntu SDK with QTCreator and Android’s ADT (eclipse-based) on my 12.04 LTS laptop.  And while the SDK for Android is more mature and fully featured, I still find Ubuntu (an particularly QML) much faster to prototype apps.

Dual boot is also about making the application developers life easier and cheaper.  Having to buy extra devices for testing new apps can be a put you off. You can now develop for Ubuntu by jusr re-using your Android device.. without having to disrupt your android projects!  For example,  yesterday I was working on applications on both sides, and I was easily booting back and forward and collecting logs in each side.

I hope to see more integration in between both development environments, I think it will be particularly neat to have something like  Android Monitor tool (aka DDMS) working for both OSs.

Btw, I have just released version 2.0 of Techfunder! Including home screen widgets, search and more categories. Don’t forget to check it out:

Get it on Google Play


Read more
Victor Palau

I have a lot of contacts in my phone… I am sure you will have more, but syncing over 500 contacts to Ubuntu phone using the command line for Syncevolution gets tedious.

So I wrote a little QML app to do the trick for you. Unfortunately, to run a system command the application has to run unconfined, so I have not yet submitted it to the store.

But if you want to install it yourself it is pretty simple:

  1. Download this file
  2. push the downloaded file to your phone, like so: adb push com.ubuntu.developer.vtuson.contactsimporter_0.9_armhf.click /home/phablet
  3. then run this to install it: adb shell “sudo -u phablet pkcon -p install-local  /home/phablet/com.ubuntu.developer.vtuson.contactsimporter_0.9_armhf.click”

You should be good to use it now, the app looks like this: (and if you want to check out the code is here)

contactsimp


Read more
Victor Palau

Hi,

I found myself trying to build a QML Ubuntu Touch app project that includes a qml c++ extension and I found that I some how stumble a bit along the way. So, here are some of my notes on how I got it done. Hope that helps.

Creating the project.

Using QtCreator, create a new project and select – QML Extension Library + Tabbed Touch.  I found that it was easier to change the QML side of things than start with an extension and then add the whole project structure.

Build and Run your project locally

In QtCreator click on projects.  In Build, I set up the build path as my project root path. In run,  the executable is “/usr/bin/qmlscene” (make sure there is no spaces trailing) and then Arguments is set to “-I  ../backend/modules $@ yourapp.qml”, with a working directory of “projectroot/app”

Now if you try to run your project it should build it locally and run your app. After that you are on a roll.

Build on target device

Click Ctrl+f11 should install the platform developer tools in your device. However, I how found that this lately does not work.

Instead from the terminal:

first we will need to make the image in your device writeable:
adb shell touch /userdata/.writable_image  --> and reboot the phone.
then:
cd /usr/share/qtcreator/ubuntu/scripts
adb devices
./device_developertools_install <device_id>

Now you are ready to build, so back to QtCreator:

Build>Ubuntu>Build Application on Device

This should build the application with only some test problems, but the main binaries would be created. To package your app you will need to get

/home/phablet/dev_tmp/<yourapp>/backend/modules/lib<yourlib>.so

Creating a click package

create a manifest standard manifest file. Manifest.json

{
"description": "your text",
"framework": "ubuntu-sdk-13.10",
"hooks": {
"yourappname": {
"apparmor": "yourappname.json",
"desktop": "yourappname.desktop"
}
},
"maintainer": "your name<yourname@yourmail.com>",
"name": "com.ubuntu.developer.yourname.yourappname",
"title": "yourappname",
"version": "0.1",
"architecture": "armhf"
}

You will also need a yourapp.desktop file:

[Desktop Entry]
Name=yourappname
Comment=description
Exec=qmlscene -I plugin $@ yourapp.qml
Icon=icon.png
Terminal=false
Type=Application
X-Ubuntu-Touch=true

Note that Exec= has a -I plugin part to it. This is very important, will see later.

Now yourapp.json file that contains your confinement profile:

{
"policy_groups": [
"networking"
],
"policy_version": 1
}

Now time to setup a folder with all this stuff, not that the plugin folder is going to contain your lib which your are importing with -I option on the desktop file:
myproject>
-./click/
--icon.png
--manifest.json
--yourapp.json
--yourapp.desktop
--./plugin/
---./yourlib/
----lib(yourlibname).so
----qmldir

Now you are ready to build from your project root folder:
click build ./click

This should create a .click file in your project folder.

Installing in your device

adb pull your.click /home/phablet/
adb shell
su phablet
cd ~
pkcon -p install-local your.click

This should be enough, but sometimes I find that you need to restart unity:
pkill unity8 (you might need sudo)


Read more
Victor Palau

Since I lead the Ubuntu Edge campaign, I have been trying to keep up with other crowd funding projects.  I am mainly interested on technology and gadgets, and I have found it hard to navigate Kickstarter, but also to have to keep hoping between Kickstarter and Indiegogo to see what is going on.  Specially since now, seems like interesting projects are evently split between them.  You might share my friction on this… so I give you Techfunder:

Get it on Google Play

Techfunder is an Android app that provides an easy way to browse crowd funding projects launched across the main industry websites. Techfunder gathers Technology and Design projects from Kickstarter and Indiegogo.

Using Techfunder side navigation you can easily switch between:

  •  Popular
  •  New this week
  •  Staff Picks
  •  Design – Popular

Then you can browse as many projects on a compact scrollable list. Just click on the project you are interested to expand into a full screen view.From there you can tell the world about it using the share button. 

If you want to contribute or found out more about it, click on the “browse” button and Techfunder will launch the project page in your web browser. When you are finished, just press the Android back button to return to Techfunder.

I am currently planning to add a favourites/watchlist functionality and looking into a way to select additional crowd sourcing platform. I hope you enjoy it!


Read more
Victor Palau

Since I lead the Ubuntu Edge campaign, I have been trying to keep up with other crowd funding projects.  I am mainly interested on technology and gadgets, and I have found it hard to navigate Kickstarter, but also to have to keep hoping between Kickstarter and Indiegogo to see what is going on.  Specially since now, seems like interesting projects are evently split between them.  You might share my friction on this… so I give you Techfunder:

Get it on Google Play

Techfunder is an Android app that provides an easy way to browse crowd funding projects launched across the main industry websites. Techfunder gathers Technology and Design projects from Kickstarter and Indiegogo.

Using Techfunder side navigation you can easily switch between:

  •  Popular
  •  New this week
  •  Staff Picks
  •  Design – Popular

Then you can browse as many projects on a compact scrollable list. Just click on the project you are interested to expand into a full screen view.From there you can tell the world about it using the share button. 

If you want to contribute or found out more about it, click on the “browse” button and Techfunder will launch the project page in your web browser. When you are finished, just press the Android back button to return to Techfunder.

I am currently planning to add a favourites/watchlist functionality and looking into a way to select additional crowd sourcing platform. I hope you enjoy it!


Read more
David Planella

Ubuntu loves Evernote

We’ve been making good progress with Reminders, the Ubuntu app powered by Evernote. While our team of developers have been busy working on the UI, a set of other equally awesome individuals have been working in parallel to implement the backend pieces.

Today, I’m thrilled to announce that the Evernote Online Accounts provider is now available for Ubuntu as a preview. This plugin enables secure login to Evernote via OAuth, and handles the authentication process via the standard Ubuntu platform APIs, so that the Reminders app does not even have to care about the logic.

Big thanks to Alberto Mardegan and Chris Wayne for making this possible.

For developers only

At this point, the authentication plugin is provided for the purpose of developing the Reminders app only, and it will intentionally not work with regular Evernote accounts. Support for regular Evernote accounts will be enabled when the Reminders app reaches the stable release status.

The plugin talks to the Evernote sandbox service, so before using it you’ll need to create a developer account there first. Create a free Evernote developer account ›

Installing the Evernote account provider

As the required packages have not yet landed in the archive, we’ll need to install them from the core apps repository. You can open a terminal and run these commands to do the installation, either on the phone or on the desktop:

On the phone, before you can install a package you will need to switch to RW mode

sudo add-apt-repository ppa:ubuntu-touch-coreapps-drivers/daily
sudo apt-get update
sudo apt-get install account-plugin-evernote signon-plugin-oauth2

Logging into the Evernote sandbox

Evernote Account

The next step in using the plugin is to log into the Evernote sandbox. The Evernote login process, as for any other Ubuntu online account, takes place in the System Settings app. Once the plugin is installed, you’ll be able to add new Evernote accounts from the New Account screen. While the screenshots above show how to do it on the phone, this works equally well on the desktop.

Using the Evernote account provider

To enable Evernote account support in QML apps, you’ll only require an instance of the Ubuntu Online Accounts AccountServiceModel. You should check out the online API reference for more information, but in essence, an adapted version of the snippet from the documentation will do the trick:

Item {
    AccountServiceModel {
        id: accounts
        // Use the Evernote service
        service: "evernote"
    }
    ListView {
        model: accounts
        delegate: Rectangle {
            id: rect
            Text { text: rect.model.displayName }
            AccountService {
                id: accountService
                objectHandle: rect.model.accountServiceHandle
                // Print the access token on the console
                onAuthenticated: { console.log("Access token is " + reply.AccessToken) }
                onAuthenticationError: { console.log("Authentication failed, code " + error.code) }
            }
            MouseArea {
                anchors.fill: parent
                onClicked: accountService.authenticate()
            }
        }
    }
}

With this code, you’ll get your Evernote account listed in the UI. Clicking on it, and upon successful authentication you’ll obtain an Evernote authentication token, that can then be passed to the Evernote API to access the NoteStore and manage notes for the account associated to that token.

This is however the first step, as you’ll need a working backend to pass that token to and to talk to the Evernote API before you can manage any notes. Read on to learn more on this.

Setting up the Evernote API Taskforce

The next phase in the project is now to focus on the creation a QML plugin that will talk to the Evernote service. This is a key piece of the infrastructure that will enable performing the essential operations of fetching, modifying and updating notes while online.

The unstoppable Michael Zanetti has been helping us bootstrapping the process, and he’s already put together an Evernote API QML plugin that performs the basic communication with the Evernote servers.

Taking this work as a foundation, we want to extend the plugin to perform all necessary operations to cover the needs of the Reminders app. With this goal in mind, we’re putting together the Evernote API taskforce: a team of developers tightly focused in developing the Evernote API QML plugin and working very closely with the Reminders app developers to ensure backend and UI perfectly fit.

So if you’ve got Qt and C++ experience, this is a call for you: join the team of core developers who bring Evernote support to Ubuntu and millions of users!

If you’re interested in participating, let us know in the comments or or drop us an e-mail on the Core Apps mailing list.

Looking forward to welcoming new developers to the team, and stay tuned for more updates!

The post Ubuntu Reminders app gets Evernote authentication appeared first on David Planella.

Read more
Victor Palau

It has been over 2 months since the Ubuntu Edge campaign concluded, and I haven’t really blogged about it.  I must say, driving something like this was great fun but also a fully immersive 24-7 experience. For that reason, I wanted some time to pass before write some conclusions about it.

One of the things that made the Ubuntu Edge campaign to stand out from previous crowd funding projects was the target: $32 Million. Other successful projects (I will focus only on products) had much lower targets (~$100K). So, why was this the case?

If your company has already raised capital via “standard” funding routes or you are actively pursuing it, a successful crowd funding campaign will reduce the overall amount of equity you have to give away. It can also attract that elusive VC investment.  In this situation, your objectives are:

  • Proof the product viability 
  • Remove doubts from future investors minds
  • ensure your campaign and your product are perceived as a successes

An early achievement of your campaign target will tick all these boxes. A “sold out” effect in the first week will increase the confidence of future pledgers and investors. In that case, a campaign target of $100K can be the magic number for you. 

In the other hand, if crowd funding is your only or main avenue to finance your product, your objectives will be slightly different. These were ours:

  • Proof the product viability
  • Finance product design and factory tooling
  • Finance a fix/minimum production run
  • Market validation

An early achievement of your target is still desirable, but your main worry will be to raise enough money via the campaign to deliver on your promises to the pledgers.

Although we raised over $12 Million, we did not reach our intended target. The Ubuntu Edge was a unique proposition that was build on the premise of delivering the latest cutting edge technology.  Unfortunately, this meant that we could not pursue what I think is a better approach for 100% crowd funded products: a multi-campaign project.

In a crowd funding campaign, people contribute for different reasons:

  • The Angels: Angels are interested in supporting new innovation. They might not even necessarily want to own your product, but they appreciate the disruption you are trying to bring to the market.  For these reason, they are willing to contributed from a little as $1 to thousands of dollars to see your project succeed.
  • The Extended Team: These are passionate individuals that understand your product concept and they want one! Not only they are willing to part with some money to get one, but they are also willing to contribute their own time and energy to make your product successful. They are a great source of professional and amateur resources. The contributions we got for Ubuntu Edge ranged from advise on how to run the campaign by serious knowledge people, to PR (T-shirt designs, websites, ads) to product design.
  • The Pragmatists:  Your product might look good, but your project might just be too risky. Crowd funding projects are developing a bit of a reputation for shipping late or even worst, never happening.  Pragmatist might be put off from contributing to your project is the perceived risk is too high.  Some key questions they would like answer to are: Who are you? What is your proven record? Do you have a proto-type working?  Do you have suppliers ready to go? but they all ultimately boil down to one: Can I trust you?
  • The Shoppers: Although, it should be clear to everyone that crowd funding is not the same that shopping in Amazon, similar motivations may apply.  Shoppers will compare backing your project with buying a similar product online. Things they will care about: Are you offering a good deal? How long will it take for me get the product? What warranties do you offer?.

Pragmatists and shoppers form the bulk of the backer community out in the wild. If you are just getting started with your product development, you might find that addressing the concerns of pragmatists and shoppers is just not possible. In that case, financing your product development via multiple crowd funding projects might be a better option.

Target your first project to attract angels and extended-team. Set a campaign target that will allow you to build a prototype and start seriously talking to suppliers. Build up your credibility by delivering the first project on time.

For your second project, you will have had reduced the risk and the time to product delivery substantially. You might now be able to raise the rest of the funding or your might need a couple more iterations. Here is how the people at +Pool are doing it:

  1. First project
  2. second project

 

+POOL

 


Read more
Dustin Kirkland

Slashdot article today poses the question:

"It's interesting to watch the Ubuntu phone development process, even as those who are satisfied with Android phone or iPhones, ask, 'Why?' We could ask the same about the Firefox OS Phone, too. Maybe the most realistic answer in both cases is, 'Because we could.'"
I'd like to take a crack at answering that question...

  1. AndroidiOS, and Blackberry started with a phone, and have spent years adding general computing capabilities
  2. Ubuntu started with a general purpose operating system, and recently added the ability to make phone calls

And frankly, as we're on the technical cusp of device convergence...


what I really want
is a general purpose PC,
that fits in my pocket,
and makes phone calls too!

I believe that the latter approach will actually succeed in that endeavor.

I want a super speedy user input interface when using the handheld device, but it must also quickly, seamlessly, and ideally, wirelessly, dock into a PC environment with the creature comforts of a huge LCD screen, comfortable keyboard, and mouse.

Is that too much to ask?  Perhaps not...

Cheers,
Dustin

Read more
Victor Palau

Hi everyone, I’ve been talking to a lot of you in the comments on the Indiegogo page, so I thought I’d come on here with a little video of my own computing setup.

I’m going to show you convergence. Although the hardware is getting a lot of the attention, it’s the Ubuntu Edge’s ability to be your phone and your PC that will have the biggest impact. How do I know this for sure? Because I’m already experiencing it.

For over two months I’ve been running Ubuntu for Android on a Nexus 4 phone, and even with its much slower processor and smaller storage than the Edge will have, it’s still made my working life so much simpler. With just a phone I can do pretty much anything that I could do before on my laptop.

I’ve made a quick video to show you a few examples. Remember this code is still in beta – with the final production code and the much more powerful hardware of the Ubuntu Edge, the desktop will really fly.

If you can’t see the video - click here

We’re doing great so far but there’s a long way to go, so please keep on sharing our campaign with everyone you know. You’re our best chance of making this happen!


Read more
Victor Palau

I was thinking about starting dogfooding Ubuntu Touch, and really for me the blocker is having a torch app! :) so here it is:

https://code.launchpad.net/~vtuson/+junk/torchapp

Tap in the lightbulb to turn the tourch on (tested on Galaxy Nexus). Image by  Ryan Hyde

 


torchontorchoff


Read more
Victor Palau

So a few months later, the game I was working on has now got to Beta stage. Since last time, I have added a few extra things:

  • Proper dogfight with a T50 fighter
  • Plane shadows
  • Scaling for multiple size screens
  • Revamp and multitouch controls
  • Collisions and explosions
  • Full keyboard control
  • Added 13 levels, loaded from level.txt JSON file
  • Tutorial walkthrough
  • and lots of bug fixes

Still only a Beta, but all the game play is now completed, now it is just fixing bugs ;) All the code is here, and some screen shots.

https://code.launchpad.net/~vtuson/+junk/dogfight

screenshot2
screenshot3
screnshoot1


Read more
Victor Palau

Since my first steps into QML when the Ubuntu SDK was launched, I have become a bit addicted to it. I decided to try to write a QML declarative game, and I settle on a shooting fighter jet game. Finally had enough content to put out an alpha. Here is the video:


The code for it in on my LP Junk branches, not really ready for review yet ;) but happy to have help!

You might notice that I am using the keyboard to drive the game in my computer, I have also build a touch joystick that so far works ok in the Nexus 7, but needs some calibration.

PS: if you have some problems with playing the video, try jumping a head 10 secs, it also helps if you play it in HD :)


Read more
Daniel Holbach

Going mobile

Many asked me in the last time what became of the Ubuntu on Nexus7 project. I’m happy to say that it’s going really well. Some weeks ago it was already very easy to install Ubuntu on a Nexus7, since then things got better and better. Many bugs were ironed out, but the piece most folks have been concentrating on recently was the desktop-r-reduced-power-ram blueprint.

The spec says:

In the past few cycles, we saw that our desktop took more and more RAM to run the full session. Also, more daemons mean more interruptions on the CPU, and less battery file. We will get services to not run when not needed and work on improving the code of those components to consume less resources

Why is this so relevant in a mobile setting? Simple. Most mobile devices are less well-equipped than the common Desktop or Laptop, and every interruption, every bit of CPU usage, every disk access costs precious battery life. Fixing this kind of bugs will have a great and positive impact for all devices running Ubuntu.

Here’s a quick summary of the work which has been done:

  • Robert Ancell: look at why lightdm is using 30MB (it’s due to the memory locking – without locking it drops to 3.7M)
  • Michael Terry: Make lightdm selectively lock memory instead of using mlockall
  • Sébastien Bacher: look if gnome-keyring needs to be running all the time (needs to, restarting would mean having to unlock it again, e.g ask user for password every time)
  • Sébastien Bacher: look at what is making goa run for some users (it’s e-d-s)
  • Sébastien Bacher: set up follow-up meetings about the topics we didn’t cover during the session
  • Ken vanDine: check with online team if signond needs to be running all the time
  • Ken vanDine: investigate long running telepathy-indicator/mission-control
  • Iain Lane: drop g-c-c recommends on goa so it’s not installed by default
  • Oliver Grawert: seed zram-conf
  • Brian Murray: look at what update-notifier is used for nowadays, identify if those functionalities could be replaced/moved to upstart jobs [http://wiki.ubuntu.com/UpdateNotifier]
  • Colin Watson: fix upower memory leaks
  • Colin Watson: reduce update-notifier memory use

Update: Sébastien also mailed the ubuntu-devel@ list with a nice summary of the work.

We need your help

If you have a look at the desktop-r-reduced-power-ram blueprint you can see that there is still quite a bit of work which need to be done. There are assignees for some of the work items, but all of them will be happy to hear you offer help. The effort is coordinated on #ubuntu-desktop, so you best head there and start chatting with the team.

More information – live hangout

Tomorrow, 7 Feb 2013, at 9 UTC I am going to talk with my friend Sébastien Bacher on http://ubuntuonair.com about this initiative, so if you want to find out more, be sure to tune in or watch the recording in the ubuntuonair youtube channel afterwards.

Read more
Victor Palau

Last week I wrote about my first impressions on working with QML vs Android as I tried to translate a SimpleTodo application.

This week, I managed to find a few more spare hours to finish it. Not only that, but I have been able to go beyond what I had for Android. Specially on the UI part, QML makes it really simple to build in transitions and animations. I also found that defining States for the application had simplified the complexity of the program.

I don’t think that today there are official menus published for Ubuntu qml components, so I have implemented my own menu “a la” Ubuntu for phones. Here is a small video of the app:

or you can access the link here: http://www.youtube.com/watch?v=T-gDv-vDMhg

Overall, I highly recommend everyone to play with QML. Here are two very useful links if you are new to it:

And of course, lets not forget the awesome developer.ubuntu.com pages!


Read more
Victor Palau

A few months back, I decided to write a Simple ToDo app for Android, then I hooked it up to a cloud backend, using Juju. That was my first Android application, so I got to experience first hand the latest developer documentation and development environment.

Last month, Canonical launched Ubuntu for Phones, that gave me the idea to re-write the same application on QML using the Ubuntu Components.

Clearly comparing a new SDK-Alpha with a stable platform like Android will seem hardly fair, however, keep reading as you might be surprised of the results.

QML vs Dalvik Java

Lets start with QT/QML vs Dalvik/Java – I found QML really easy to get to grips with and be productive. I had the UI (see picture below) running in no time and I would say much faster than with Android.  QML is a very flexible declarative environment that allows you to embedded quick logic into the layout. This is a blessing and  a curse.

While with Android, it was very easy to keep a nice MVC  separation, I struggled to stop the leaks in QML. So while it is very easy to quickly write a functional application, it does not impose what you would consider as good development practices.

In summary, they are both very powerful development environments.

todoapp

IDE: Eclipse vs QtCreator

Part of the development experience is the IDE. I must say that I simply love the QTCreator. Possibly not as polish as Eclipse but you don’t need to read a manual to use it. Also, with a quick integration with the HUD, it is just very simple to use.

So what is QTCreator missing? A good emulator. The Android Development Kit (ADK) provides a really good user experience to develop mobile solutions. QMLScene gives you similar functionality but does not simulate a phone environment. However, all the technology is there, and  I am sure that will be included in the v1.0 version of the SDK.

Documentation

I can’t fault Android developer documentation, but taking into account its popularity, you  wouldn’t expect anything else.

I was very surprise of the quality of information on http://developer.ubuntu.com/ and specially with the component showcase.

componentshowcase

The only thing to watch out for is that in Android you can get all the info you need from a single website. With QML you quickly end up pinging between Digia, Nokia and Ubuntu pages.

The Code

The code is on my launchpad repos. The actual source functionality is not finished as I am still trying to figure out how to add menu options to access Done items. Anyway, the whole thing is pretty compact compare to the Dalvik code. The actual logic is almost identical in both. A ListView that is populate from an List model. All the data is persisted in SQLite db.

Conclusion

Both environments have been equally painless to work with, the difference is that the Ubuntu environment has *just* been released as an Alpha. I think this is the start of a very vibrant App development ecosystem.


Read more
niemeyer

Our son Otávio was born recently. Right in the first few days, we decided to keep tight control on the feeding times for a while, as it is an intense routine pretty unlike anything else, and obviously critical for the health of the baby. I imagined that it wouldn’t be hard to find an Android app that would do that in a reasonable way, and indeed there are quite a few. We went with Baby Care, as it has a polished interface and more features than we’ll ever use. The app also includes some basic statistics, but not enough for our needs. Luckily, though, it is able to export the data as a CSV file, and post-processing that file with the R language is easy, and allows extracting some fun facts about what the routine of a healthy baby can look like in the first month, as shown below.

Otávio

The first thing to do is to import the raw data from the CSV file. It is a one-liner in R:

> info = read.csv("baby-care.csv", header=TRUE)

Then, this file actually comes with other events that won’t be processed now, so we’ll slice it and grab only the rows and columns of interest:

> feeding <- info[info$Event.type == "Breast",
        c("Event.subType", "Start.Time", "End.Time", "Duration")]

This is how it looks like:

> feeding[100:103,]
    Event.subType       Start.Time         End.Time Duration
129          Left 2013/01/04 13:45 2013/01/04 14:01    00:16
132          Left 2013/01/04 16:21 2013/01/04 16:30    00:09
134         Right 2013/01/04 17:46 2013/01/04 17:54    00:08

Now things get more interesting. Let’s extract that duration column into a more useful vector, and do some basic analysis:

> duration <- as.difftime(as.vector(feeding$Duration), "%H:%M")

> length(duration)
[1] 365

> total = sum(duration)
> units(total) = "hours"
> total
Time difference of 63.71667 hours

> mean(duration)
Time difference of 10.47397 mins
> sd(duration)
[1] 5.937172

A total of 63 hours surprised me, but the mean time of around 10 minutes per feeding is within the recommendation, and the standard deviation looks reasonable. It may be more conveniently pictured as a histogram:

> hist(as.numeric(duration), breaks="FD",
    col="blue", main="", xlab="Minutes")

Duration histogram

Another point we were interested on is if both sides are properly balanced:

> sides <- c("  Right", "  Left")
> tapply(duration, feeding$Event.subType, mean)[sides]
   Right     Left 
10.72283 10.22099

Looks good.

All of the analysis so far goes over the whole period, but how has the daily intake changed over time? We’ll need an additional vector to compute this and visualize in a chart:

> day <- format(strptime(feeding$Start.Time, "%Y/%m/%d %H:%M"),
                "%Y/%m/%d")
> perday <- tapply(duration, day, sum)
> mean(perday)
[1] 136.5357
> sd(perday)
[1] 53.72735
> sd(perday[8:length(perday)])
[1] 17.49735

> plot(perday, type="h", col="blue", xlab="Day", ylab="Minutes")

Daily duration

The mean looks good, with about two hours every day. The standard deviation looks high on a first look, but it’s actually not that bad if we take off the first few days. Looking at the graph shows why: the slope on the left-hand side, which is expected as there’s less milk and the baby has more trouble right after birth.

The chart shows a red flag, though: one day seems well below the mean. This is something to be careful about, as babies can get into a loop where they sleep too much and miss being hungry, the lack of feeding causes hypoglycemia, which causes more sleep, and it doesn’t end up well. A rule of thumb is to wake the baby up every two hours in the first few days, and at most every four hours once he stabilizes for the following weeks.

So, this was another point of interest: what are the intervals between feedings?

> start = strptime(feeding$Start.Time, "%Y/%m/%d %H:%M")
> end = strptime(feeding$End.Time, "%Y/%m/%d %H:%M")
> interval <- start[-1]-end[-length(end)]

> hist(as.numeric(interval), breaks="FD", col="blue",
       main="", xlab="Minutes")

Interval histogram

Seems great, with most feedings well under two hours. There's a worrying outlier, though, of more than 6 hours. Unsurprisingly, it happened over night:

> feeding$End.Time[interval > 300]
[1] 2013/01/07 00:52

It wasn't a significant issue, but we don't want that happening often while his body isn't yet ready to hold enough energy for a full night of sleep. That's the kind of reason we've been monitoring him, and is important because our bodies are eager to get full nights of sleep, which opens the door for unintended slack. As a reward for that kind of control, we've got the chance to enjoy not only his health, but also an admirable mood.

Love, Dad.

Read more
Victor Palau

A very brief note to let you all know that I have moved the chromium test extension for browsing simulation under the Ubuntu-nexus7. Please submit improvements at your leasure:

https://code.launchpad.net/~ubuntu-nexus7/ubuntu-nexus7/chromium_extension


Read more