site  contact  subhomenews

"gomobile" with Precise Puppy

January 18, 2013 — BarryK
"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/archive/blog2/201301/deb-post-install-script.html
...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?

Comments

An Example showing Operation
Username: GCMartin
[url=http://phandroid.com/2013/01/17/ubuntu-android-theme/]Here an example of a hacked Android running Ubuntu Here to help

Question
Username: GCMartin
"Hi @BarryK Will the Puppy focus be Puppy on an Android Phone (xPHone) or will it be Puppy on an Android Tablet (xTab)? [b]A Phone[/b] intends toward use of cell towers and voice services along with all the additional personal services [u][b]while[/b][/u] [b]A Tablet[/b] 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?

qmlscene error
Username: pemasu
"# 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.

QML demos
Username: BarryK
"Following pemasu's advice, not exactly, because I didn't install his PET, but got 2 DEBs via the PPM: [b]5. at-spi2[/b] 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'. [b]6. Ubuntu QML tests[/b] 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: [i]# qmlscene ./PhoneComponentShowcase.qml[/i] ...very nice, it works. Getting an error about missing /bin/dbus-daemon though.

QML errors
Username: BarryK
"For the record: [code]# 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"[/code]

at-spi2 2.4.2
Username: BarryK
"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.

dbus-daemon fixed
Username: BarryK
"A bit pathetic, somewhere the path of dbus-daemon has been hard-coded. I fixed it... [b]7. dbus-daemon fix[/b] Do this, then reboot: [i]# ln -s ../usr/bin/dbus-daemon /bin/dbus-daemon[/i] [b]8. Ubuntu QML demos[/b] Then again as per Step 6: [code]# 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 [/code] ...which means success! And this is what 'ps' reports, the first line is what gets launched at bootup, qmlscene runs the second two: [code]# 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[/code]

Ubuntu on Nexus 7
Username: BarryK
"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.

Firefox OS on smartphone
Username: BarryK
"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.


Tags: puppy