"gomobile" with Precise Puppy

"Ubuntu for phones" has received a lot of attention recently, see my blog posts. Also, here is the main Ubuntu page on how to create apps in either HTML5 or QML:
http://developer.ubuntu.com/get-started/gomobile/

The tools linked from the Ubuntu site were for Ubuntu 12.10, however a couple of days ago they were also made available for 12.01 Precise Pangolin, meaning that they will work in Precise Puppy. And I have confirmed, they do, with some qualifications.

Setting things setup in Precise Puppy to install and run Qt5-beta1 and the QML SDK, could be made into a simple PET, however I haven't got that far yet. In this blog post, I will document how to do it manually...

1. Latest Precise
I recommend that you be running the latest Precise Puppy 5.4.3, also get the "DEB post install script", see my blog post:
http://bkhome.org/blog2/?viewDetailed=00083
...just in case any of the DEBs to be installed need to run a post-install script.
That is, the file that you need to download from Woof is /usr/local/petget/installpkg.sh (and make sure it has executable flags set).

If running your pup with a save-file, it will need to be big enough, at least 512MB. The DEBs will need about 250MB. So, increase the size of the save-file if necessary.

2. PPM repos
The DEBs that you will have to install are in what is known as "PPA's", which is just a fancy/confusing acronym for special developer repositories. There are two of these repositories that we need to download DEBs from, and the PPM (Puppy Package Manager) needs to be told where they are.

Edit file /root/.packages/DISTRO_COMPAT_REPOS with the new repositories:
#where to get pkg docs, format: domain|uri|localfilename...

PKG_DOCS_DISTRO_COMPAT="archive.ubuntu.com|http://archive.ubuntu.com/ubuntu/dists/${DISTRO_COMPAT_VERSION}/main/binary-i386/Packages.bz2|Packages-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}-main archive.ubuntu.com|http://archive.ubuntu.com/ubuntu/dists/${DISTRO_COMPAT_VERSION}/universe/binary-i386/Packages.bz2|Packages-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}-universe archive.ubuntu.com|http://archive.ubuntu.com/ubuntu/dists/${DISTRO_COMPAT_VERSION}/multiverse/binary-i386/Packages.bz2|Packages-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}-multiverse ppa.launchpad.net|http://ppa.launchpad.net/canonical-qt5-edgers/qt5-beta1/ubuntu/dists/precise/main/binary-i386/Packages.bz2|Packages-ubuntu-ppa_precise-qt5beta1 ppa.launchpad.net|http://ppa.launchpad.net/ubuntu-sdk-team/ppa/ubuntu/dists/precise/main/binary-i386/Packages.bz2|Packages-ubuntu-ppa_precise-qmlsdk"
#ubuntu repos...
#note, the local pkgs database file (or partname) is also appended to these entries, so know which url to download a particular pkg from (glob wildcard allowed)...
REPOS_DISTRO_COMPAT="ftp.filearena.net|http://ftp.filearena.net/pub/ubuntu|Packages-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}-* mirror.anl.gov|http://mirror.anl.gov/pub/ubuntu|Packages-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}-* mirrors.kernel.org|http://mirrors.kernel.org/ubuntu|Packages-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}-* archive.ubuntu.com|http://archive.ubuntu.com/ubuntu|Packages-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}-* ppa.launchpad.net|http://ppa.launchpad.net/canonical-qt5-edgers/qt5-beta1/ubuntu|Packages-ubuntu-ppa_precise-qt5beta1 ppa.launchpad.net|http://ppa.launchpad.net/ubuntu-sdk-team/ppa/ubuntu|Packages-ubuntu-ppa_precise-qmlsdk"


Run PPM, click "Configure" button, then "Update", then decline offers to update all pkg repositories except for the new ones, 'ubuntu-ppa_precise-qt5beta1' and 'ubuntu-ppa_precise-qmlsdk'.
You will need to tick the checkboxes for those two repos, so that they will be available in the main GUI window, which does require restarting PPM a couple of times.

3. Install DEBs
Running PPM, select the 'ubuntu-ppa_precise-qt5beta1' repo, and do a search for "qt5-meta-full", then install it, and all of it's dependencies (22 deps).
Then select the 'ubuntu-ppa_precise-qmlsdk' repo and search for "*", meaning all DEBs, and install them all (only 3 DEBs).

4. Test
Create this file, /etc/profile.d/qt5:
export PATH="/opt/qt5/bin:${PATH}"


Then reboot.
Then you are ready to play with Qt5 and QML.

The Ubuntu site says that you can execute a QML app like this:
$ qmlscene /path/to/application.qml
Hmmm, I tried that, with a file here: /opt/qt5/examples/qtquick1/demos/calculator/qml/calculator:

# qmlscene ./calculator.qml 

Qt at-spi: error getting the accessibility dbus address: "The name org.a11y.Bus was not provided by any .service files"
Accessibility DBus not found. Falling back to session bus.
Registered DEC: true
Error in contacting registry
"org.freedesktop.DBus.Error.ServiceUnknown"
"The name org.a11y.atspi.Registry was not provided by any .service files"
qmlscene: 'import QtQuick 1.0' is no longer supported.
Use qmlviewer to load file './calculator.qml'.


So, I used 'qmlviewer' instead, which worked, got a nice calculator. Note though, there were still some complaints to the terminal stderr.

So, it seems to be basically working, but need to fix that Dbus error, whatever that is.

Anyone interested in playing with this?


Posted on 18 Jan 2013, 17:18


Comments:

Posted on 19 Jan 2013, 3:47 by GCMartin
An Example showing Operation
Here an example of a hacked Android running Ubuntu

Here to help



Posted on 19 Jan 2013, 3:56 by GCMartin
Question
Hi @BarryK
Will the Puppy focus be Puppy on an Android Phone (xPHone) or will it be Puppy on an Android Tablet (xTab)?

A Phone intends toward use of cell towers and voice services along with all the additional personal services

while

A Tablet tends toward a larger viewing surface for personal services with little to no address toward voice. In fact more that 50% of all tablets sold in 2012 did NOT have a cell capability.

Which would you envision we focus on?


Posted on 19 Jan 2013, 17:29 by pemasu
qmlscene error
# qmlscene ./calculator.qml
Qt at-spi: error getting the accessibility dbus address: "The name org.a11y.Bus was not provided by any .service files"

You get rid of that by installing latest at-spi libs: http://www.smokey01.com/pemasu/pet_packages-upup/at-spi2-core-2.6.3-precise.pet

qmlscene: 'import QtQuick 1.0' is no longer supported.

QtQuick 1.0 is not supported is the clue. Change that argument in application *.qml files to the Qtquick 2.0 and then qmlscene launches the application, calculator has 3 files to change:
calculator.qml, Button.qml and Display.qml

I think that the at-spi spitted error in not relevant, it is just verbose warning without real harm. This QtQuick 2.0 support is the main thing.


Posted on 21 Jan 2013, 22:10 by BarryK
QML demos
Following pemasu's advice, not exactly, because I didn't install his PET, but got 2 DEBs via the PPM:

5. at-spi2
Run the PPM, choose 'main' repo, type "at-spi2-core" into the search box.
Click on the 'at-spi2-core' DEB to install it, this will also install one dependency, 'libatspi2.0-0'.

6. Ubuntu QML tests
These are from the 'qt-components-ubuntu-demos' DEB, and are found in /usr/lib/qt-components-ubuntu/demos.
Open a terminal and try one:

# qmlscene ./PhoneComponentShowcase.qml

...very nice, it works.

Getting an error about missing /bin/dbus-daemon though.




Posted on 21 Jan 2013, 22:24 by BarryK
QML errors
For the record:

# qmlscene ./PhoneComponentShowcase.qml 

Qt at-spi: error getting the accessibility dbus address: "Failed to execute child process "/bin/dbus-daemon" (No such file or directory)"
Accessibility DBus not found. Falling back to session bus.
Registered DEC: true
Error in contacting registry
"org.freedesktop.DBus.Error.Spawn.ChildExited"
"Launch helper exited with unknown return code 0"




Posted on 21 Jan 2013, 22:29 by BarryK
at-spi2 2.4.2
I should add that the version of at-spi2 that I installed from 'main' (precise-updates) repo is 2.4.2, older than pemasu's PET.



Posted on 21 Jan 2013, 23:00 by BarryK
dbus-daemon fixed
A bit pathetic, somewhere the path of dbus-daemon has been hard-coded. I fixed it...

7. dbus-daemon fix
Do this, then reboot:
# ln -s ../usr/bin/dbus-daemon /bin/dbus-daemon

8. Ubuntu QML demos
Then again as per Step 6:
# qmlscene ./PhoneComponentShowcase.qml 

Got bus address: "unix:abstract=/tmp/dbus-U57ZwdALud,guid=ecd491e1c99b80a23a62534350fd5556"
Connected to accessibility bus at: "unix:abstract=/tmp/dbus-U57ZwdALud,guid=ecd491e1c99b80a23a62534350fd5556"
Registered DEC: true


...which means success!

And this is what 'ps' reports, the first line is what gets launched at bootup, qmlscene runs the second two:
# ps | grep 'dbus'

5888 messageb 0:00 /usr/bin/dbus-daemon --system
9875 root 0:00 dbus-launch --autolaunch 0201645389c16d2f1fbebc9900000023 --binary-syntax --close-stderr
9876 root 0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
9882 root 0:00 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3




Posted on 25 Jan 2013, 17:17 by BarryK
Ubuntu on Nexus 7
This looks like a simple process:
http://news.softpedia.com/news/How-to-Install-Ubuntu-on-Nexus-7-323489.shtml

I am also very interested in this, but will wait until there is an official release of Ubuntu for a tablet. Given the significant hardware differences between tablets (and smartphones), I want to wait until Canonical have released something that has all or most of the hardware working on a particular tablet/phone -- then, likely, I will buy that hardware.



Posted on 25 Jan 2013, 17:23 by BarryK
Firefox OS on smartphone
While on the subject of working hardware, this is something else that should prove to be very interesting:
http://www.cnx-software.com/2013/01/22/mozilla-unveils-firefox-os-developer-preview-phones/

The bigger smartphone has a 4.3 inch 960x540 pixel display, which might seem a bit low resolution, but should be quite usable if apps are designed specifically for it.