Good bye Android ? Hello Ubuntu ! Not yet unfortunately …

As a long-term Ubuntu user I am extremely interested in what Canonical and the Ubuntu community are doing on the mobile front. Their convergence strategy (I am testing Snappy Core on IoT devices as well) seems very well thought through and once the the Meizu MX4 phone was released I got myself an invite and ordered a unit. It took a while to ship and then also had to make it’s way down under as Meizu only ship to Europe (and Asia I believe).

Meizu MX4 Ubuntu

Having played with Ubuntu on the phone a while ago on an old Nexus 4 as well as a Nexus 7 unit it was a much more pleasant initial experience and I was really hoping to make this my day-to-day phone. After the initial excitement and a few days of use (including with my main SIM card) however it is clear that we’re not at this stage yet. I am quite prepared to forego some conveniences I got used to on CyanogenMod (Android) over the years, but at this stage there are just too many things not working consistently. On the surface most of the critical components are there, but there is just too many bugs and inconsistencies in heavy usage left to make this a solid experience unfortunately. The single button hardware also doesn’t seem to work with the UI as in a lot of places you are searching for a back button and there ain’t one. And to my surprise the browser feels pretty horrible and lacks a lot of functionality. If the browser would work solidly a lot of the missing apps would be bearable. But this coupled with lack of stability prevent me from taking the plunge I was hoping to make and ‘de-google’ a little more….

It might work if you use your phone for voice calls and occasionally browsing. But as a very heavy user relying on the phone for work the overall stability is some way off.

The Great

  • A phone where you don’t have to jump through unreasonable hoops to get under the hood
  • Refreshingly different & pleasant UI
  • Very developer friendly
  • Terminal – it just works …
  • All Linux CLI programs (armhf) at your fingertips

The Good

  • All pre-installed crap-ware such as Ebay & Amazon apps easy to remove (would be nice not to have them – but they need to make some money)
  • Phone functions are solid and good voice quality
  • Camera on the MX4 is pretty decent
  • Familiar to Ubuntu users
  • Great selection of Reddit clients & German IPTV apps ;-)

The Bad

  • The inbuilt browser is very under-cooked – missing basic functionality plus not very intuitive rendering
  • Sharing between apps not working well – plus lack of apps that support intents – something extremely useful that Android really shines at
  • Calendaring
  • UI still seems sluggish for the computing power available on MX4

The Ugly

  • Stability – lots of apps (web-apps) refuse to display randomly
  • Home screen lock-ups with no other options than reboot
  • Many of the apps that are available are of very questionable quality – mostly websites with wrapper

I will keep a very close eye on what’s happening with the next releases (OTA6 release is due in 5 weeks) and in the meantime will help out with testing & debugging. I have been really pleasantly surprised by the responsiveness of the developers (for example the missing WIFI Hotspot functionality – it will be available next release and the devs sent me an invite to the pre-release after asking a question on Reddit). I don’t want this to be seen as dismissal of Ubuntu on phones. Just some realism as I feel selling this phone as a ‘finished’ product by Meizu is a mistake that could damage the overall aim. I still hope to settle there eventually. The community is working very hard and it’s just a question of time…

Views ‘under the hood’ of Ubuntu Phone

Here are some initial notes on how to get “under the hood” access to the Ubuntu phone.

Enable Developer mode

System Settings –> About this phone –> Developer Mode

Ubuntu Phone - Developer Mode

Install tools on the desktop / notbook device

sudo apt-get install phablet-tools

Connect via SSH

vim .android/adb_usb.ini
#add the following line to allow adb access to device
0x2a45

sudo vim /etc/udev/rules.d/51-android.rules
#Meizu MX4
SUBSYSTEM=="usb", ATTR{idVendor}=="2a45", ATTR{idProduct}=="0c02", MODE="0664" OWNER=""

phablet-shell

Important note: the phone needs to be unlocked for this (and other phablet-tools commands) to work. If the phone is locked you will get a series of adb error messages.

Change Ubuntu Touch Channel

adb shell
sudo system-image-cli --switch ubuntu-touch/rc-proposed/meizu.en

More info on channels here: https://developer.ubuntu.com/en/start/ubuntu-for-devices/image-channels/

Make filesystem writable

DISCLAIMER: Proceed with caution ! You can do some serious damage if you don’t know what you are doing. But on the other hand you have the whole power of apt-get install available to install armhf packages that might be useful.

phablet-config writable-image

Disable writable mode

sudo rm /userdata/.writable_image

Screenshots

Taking screenshots is something I commonly like to do for documentation purposes.

Via commandline

phablet-screenshot

Via phone

Hold volume up and volume down until you hear the picture sound and see the screenshot flash.

In both cases your screenshot will be saved in /home/phablet/Pictures/Screenshots and you can view them using the gallery app or download via USB.

Ringtones

Currently there is no way to change you ringtones in the UI and I fully agree that the focus should be on much more important functions. But I got used to my ringtone and don’t respond to others anymore.

sudo cp /home/phablet/Downloads/ringtones/GoodBadUgly.ogg /usr/share/sounds/ubuntu/ringtones/

Note: the sudo password for the “phablet” user is the same as you set for your screen-lock.

SShuttle – quick and temporary VPN over SSH

Every once in a while you find a gem. One of these for me is SShuttle – until now I have not known about this one.

Sometimes you need to quickly forward all your traffic via a remote server quickly. And while you can do all of this manually using OpenSSH it’s not a quick one-step process (https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding). Dynamic SOCKS5 proxies are great if all you need is browser traffic, but there is always software that won’t play ball with SOCKS.

Use-case: I just been trying to get Ubuntu Make to install Eclipse IDE and the local AARNET download mirror is just refusing to cooperate (https://github.com/ubuntu/ubuntu-make/issues/90). A quick forward to a remote VPS fixed the issue without headaches

Install

sudo apt-get install sshuttle

Run

sshuttle -r username@servername.tld 0.0.0.0/0 -vv

That’s all – it sets up routing & iptable rules transparently and removes them after use. Kudos goes to https://github.com/apenwarr – thank you. A VERY useful utility !!!

Source link: https://github.com/apenwarr/sshuttle

Installing Ubuntu Phone (Touch) on Nexus 7 LTE

ubuntu phone

Add SDK repository

sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
sudo apt-get update
sudo apt-get install ubuntu-device-flash

Enable USB Debugging on the device

  1. Make sure you have developer mode enabled (see http://developer.android.com/tools/device.html if you are unsure).
  2. Navigate to Settings > Developer options
  3. Enable USB Debugging. When a device is connected, you will be prompted in Android to authorize it.

Unlock Bootloader

adb reboot bootloader
fastboot oem unlock
fastboot reboot

Check that you have the right device

adb shell grep ro.product.name /system/build.prop > mydevicedata \
&& adb shell grep ro.product.device /system/build.prop >> mydevicedata \
&& adb shell grep build.id /system/build.prop >> mydevicedata

ro.product.name=razorg
ro.product.device=deb
ro.build.id=KTU84P

Check which channels are available

ubuntu-device-flash --server="http://system-image.tasemnice.eu" query --list-channels --device=deb

ubuntu-device-flash –server=”http://system-image.tasemnice.eu” query –list-channels –device=deb
ubuntu-touch/ubuntu-rtm/14.09
ubuntu-touch/ubuntu-rtm/14.09-proposed
ubuntu-touch/utopic
ubuntu-touch/utopic-proposed
ubuntu-touch/vivid
ubuntu-touch/vivid-proposed
ubuntu-touch/devel (alias to ubuntu-touch/vivid)
ubuntu-touch/devel-proposed (alias to ubuntu-touch/vivid-proposed)
ubuntu-touch/ubuntu-rtm/devel (alias to ubuntu-touch/ubuntu-rtm/14.09)
ubuntu-touch/ubuntu-rtm/devel-proposed (alias to ubuntu-touch/ubuntu-rtm/14.09-proposed)

In my case I am going for the currently stable ‘ubuntu-touch/vivid’ channel.

Install Ubuntu Touch

ubuntu-device-flash --server="http://system-image.tasemnice.eu" touch --channel="ubuntu-touch/vivid" --bootstrap

References
Ubuntu Devices: https://wiki.ubuntu.com/Touch/Devices

CyanogenMod 12 on Sony Xperia Z2

Just a quick update of the previous article on “Sony Xperia Z2 upgrading to CyanogenMod 11“.

One thing is that CM now included the custom recovery and you do not need to download any other custom recoveries !

Download the CM 12 ZIP file for Sony Xperia Z2 (sirius) and extract the ‘boot.img’ file

Download link: https://download.cyanogenmod.org/?device=sirius

Get the device into fastboot (bootloader mode)

fastboot -i 0xfce flash boot boot.img
fastboot reboot

Install CyanogenMod

Choose the “Install zip from sdcard –> Install from sideload” option

adb sideload cm-12-20150219-NIGHTLY-sirius.zip

After the install has finished choose the “Reboot system now” option.

Accessing your cloud desktop from Chromebook

One of the main reasons for setting up a cloud desktop is that I tend to use a lot of different devices some of which are not very powerful.

One of my favorite devices of late has been a HP 11 Chromebook. I originally bought it for a new employee and wanted to check myself how this thing stacks up to do day-to-day computing tasks more efficiently than a standard laptop without all the headaches of running Windows (viruses, endless driver installs, bloatware, malware, …). We already have several people at work working exclusively from Chromebooks and they absolutely love them. Long story short – I ended up keeping the Chromebook for myself as it’s an absolutely great secondary device for me. I can carry it with me everywhere (doesn’t weigh much more than a tablet, roughly the same size as a tablet & has a keyboard and is so much more useful than a tablet).

Initially I was using it more as a secondary device, but lately I have been thinking that I will not even take my main notebook at all for travels. The problem with this is that I do (sometimes – very infrequently) need access to software not available on such a limited device.

Accessing your Cloud Desktop via SSH (I know there seem to be people allowing direct VNC access – but that is just asking for trouble) is highly recommended. I also use RSA keys instead of password authentication.

Copy SSH Private Key (generated on desktop and public key added to authorized_keys on the cloud-server) to the Chromebook,

Unfortunately (unless you want to set you Chromebook into developer mode which has all sorts of other downsides) the inbuilt CROSH shell is very limited. However it gives you enough to securely connect to a cloud-server and you can use the whole tool-set from there

crosh> ssh
ssh> host example.com
ssh> user <username>
ssh> key <rsa_key_filename>
ssh> forward 8000:localhost:5901
ssh> connect

You can now use the RealVNC Chrome App to connect to your cloud desktop.

RealVNC

EDIT (2014-11-10): Found a better Chrome Extension which can handle the port forwarding and RSA certificate authentication which will save the config without having to type the commands each time.

Chrome Secure Shell

ChormeOS - Secure Shell

Vodafone LTE mobile data on Cyanogen Mod

I have had some issues recently with getting LTE (4G) connectivity on the Vodafone Australia Network using CyanogenMod 11 on multiple devices (http://forum.cyanogenmod.org/topic/92919-no-4g-signal-on-vodafone-au/). Turns out that it was an APN issue after all.

The APN provisioned by default when the Voda SIM card is inserted (vfinternet.au) does not work for the LTE Data Network. It works with GPRS & WCDMA, but fails to connect when the phone is set to prefer LTE (4G) Networks and they are actually available. It means that the handset will loose mobile data connectivity altogether. There are various APN Settings floating around on the interwebs, but any I tried previously did not fix the issue.

Ater needing to call Vodafone support for another device (on GPE Stock Android) that was experiencing the same issue I got given these APN Settings:

Settings –> Mobile Networks –> Access Point Names

APN Name: Vodafone AU
APN URI: live.vodafone.com

Leave all other settings at default (for MMS settings see the link to VF Support below).

image

I have tested this for 2 days and works beautifully. The correct APN settings can be found here: http://support.vodafone.com.au/articles/FAQ/APN-Settings

Sony Xperia Z2 upgrading to CyanogenMod 11

Contrary to my normal inclinations not to buy anything but Stock Android phones I ended up with a Sony Xperia Z2 in a hurry over the weekend (it’s a long story…). It appears to be quite a decent handset (with a pretty good camera actually) and one of the main reason to choose this over the other options was that is was one of the few high-end devices which already had a CM snapshot rather than just nightly releases. However similar to their colleagues at Samsung the Sony people also opted to stuff all sorts of crap-ware bloat onto the Android base OS. It appears not to be as bad as the Samsung (who are the kings of crap) mods, but for somebody used to the clean Android experience it’s just very annoying. So I opted to flash it straight to CyanogenMod.

Sony Xperia Z2 2 by epct414, on Flickr
Creative Commons Creative Commons Attribution-No Derivative Works 2.0 Generic License   by  epct414 

Prerequisites

You need the Android SDK installed and on your Path – see one of my other posts on how to do this.

Get Bootloader Unlock Code

Another annoying step which is not required with Google Nexus series.

http://unlockbootloader.sonyericsson.com/instructions

You will need to enter and confirm your email (WTF?) and need your IMEI number and at the end of the process you will get an update key that is required below.

Put phone into bootloader (fastboot) mode

Insert one end of the USB cable into your PC. Turn off the device and wait at least 5 seconds. Press and hold the Volume Down button and plug the other end of the Micro-USB cable in to your device.

fastboot devices
#should display the ID of the connected phone
fastboot -i 0x0fce oem unlock 0xKEY

Download CyanogenMod Release

Extract the boot.img file from the downloaded ZIP file via https://download.cyanogenmod.org/?device=sirius

fastboot -i 0xfce flash boot boot.img
fastboot -i 0xfce reboot

This should boot into Clockwork Mod Recovery and you can use the Volume +/- to navigate and On/Off button to choose.

Select the “Wipe data/factory reset” option

Note: this part was not in the CM Wiki or anywhere else and took me a while to get past. If you see an error “Error Mounting /sdcard/.android_Secure!” during the factory reset procedure you need to format the data partition manually. If you do not do this step the CM install will still work but you will not be able to boot the phone (it gets stuck at the Boot Animation).

Mount /data
Format /data

After the manual format procedure do the “Factory reset” again.

Install CyanogenMod

Choose the “Install zip from sdcard –> Install from sideload” option

adb sideload cm-11-20140804-SNAPSHOT-M9-sirius.zip

After the install has finished choose the “Reboot system now” option.

CM Wiki Entry: http://wiki.cyanogenmod.org/w/Install_CM_for_sirius

Finding a private location check-in service

Foursquare decided that it was too hard for them to compete with location services like Yelp and split their app into two separate apps. Whilst that might make sense to the 4Square CEO and his VC masters, it makes no sense from a users perspective. Foursquare can be a bit of a battery hog already, and having 2 apps to open and “annoy” you with notifications is not an improvement by any means. And if I wanted Foursquare to be Yelp – I would have used Yelp in the first place. So no – I do not want to install another separate check-in App (called Swarm). One battery hogging location app was enough.

no checkins here by leogaggl, on Flickr
Creative Commons Creative Commons Attribution-Noncommercial-Share Alike 2.0 Generic License   by  leogaggl 

The other argument used by 4Square’s CEO is that he didn’t want users confused about the “gamification” aspects of 4Square. I personally think that this is highly patronising to the Foursquare user base. I am sure most users would be able to work out what it is useful for.

Since I have always used 4Square mainly as a means to get some analytics of my movements and historic record of where I was at what time (I always downloaded my checkins to Thinkup on my own server) I was trying to find something that would fit the same use case. Meet Ushahidi (http://www.ushahidi.com/) – an excellent geo-coded “reporting” service developed in Kenya. I have been following this project for years already.

Dynamic Timeline

Track your reports on the map and over time, filter your data by time, and see when things happened and where.

Interactive Mapping

One of the most powerful ways to visualize information is to display it on a map. The Ushahidi platform give you rich information mapping tools.

Multiple Data Streams

The Ushahidi Platform allows you to easily collect information via text messages, email, twitter and web-forms.

Free & Open Source

The Ushahidi Platform is free for you to download and use. It is released under the GNU Lesser General Public License (LGPL).

Installation information for your own Ushahidi Server can be found on GitHub – or you can use their hosted service called Crowdmap.

Whilst this is obviously not an option for everybody it works for me. I will miss some the social aspect of 4Square as I had a small number of people I was sharing my check-ins with and it did bring about some by-chance meetups & conversation about other people’s check-ins. But the Ushahidi instance can be shared between multiple people. Maybe some will come along for the ride.

So long Foursquare – it was nice while it lasted ! If you treat your users like sheep – all you will be left with is sheep…

And for those who want to delete their Foursquare account: https://support.foursquare.com/hc/en-us/articles/201065530-How-do-I-delete-my-account-.

Upgrading Nokia X to CyanogenMod 11 (via Ubuntu)

The Nokia X seems to be a nice piece of hardware for just around $125 AUD. Nothing spectacular in terms of computing power, but much better build quality than your average cheap Chinese Android clone. I have always been a fan of Nokia hardware until they decided to commit suicide by firstly adding CEO Stephen Elop and ditching all of their software for Windows Mobile.

The problem with the device out of the box is that is has a horribly butchered version of Android. And by horribly I mean way worse than the usual bloat and crapware that poor Samsung, HTC or Sony users are normally subjected to. Hopefully this is only Nokia’s first step to a more open platform, but I wouldn’t hold my breath on that one.

Before committing to buy this device I made sure that I could flash it to CyanogenMod as soon as it arrives. Sidenote: I purchased from Mobicity AU – which turned out to be a big mistake. Do yourself a favour and go somewhere else unless you have weeks to wait.

Nokia X - CyanogenMod 11

Boot Mode – Nokia X

Nokia Recovery Mode:

1. Turn off your device
2. Press Volume + and Power Button 15 seconds

Dependencies

If you haven’t got the Android SDK or tools yet you need to install

sudo apt-get install android-tools-adb android-tools-fastboot

USB Configuration

sudo vim /etc/udev/rules.d/51-android.rules
#add the following line
SUBSYSTEMS=="usb", ATTR{idVendor}=="0421", MODE="0666", OWNER="plugdev"
sudo service udev restart

vim ~/.android/adb_usb.ini
#add at the end of the file
0x0421

sudo adb kill-server
sudo adb devices

Rooting the device

Download ClockWorkMod Recovery (or TWRP if you prefer).

http://forum.xda-developers.com/showthread.php?t=2703708

Check USB debugging in “Settings –> Developer Options” (it seems that the NokiaX has debugging enabled out of the box)

Boot into Recovery (see above)

sudo adb reboot bootloader
sudo fastboot -i 0×0421 flash recovery cwm-6028-normandy.img
sudo fastboot reboot

Installing CyanogenMod 11

Please note that currently this is not an official CM release but an unofficial port, however CM has already committed to taking this device onboard as an officially supported one in the near future.

EDIT 2014-06-17: WIFI is currently not working which should be a showstopper for day-to-day use.

Boot into Recovery (see above) – this should now be CWM Recovery rather than the previous Android Recovery.

Download files:
CM 11 ROM for Nokia X (Android 4.4.2)
Google Apps for CM 11

EDIT (2014-09-29): There seems to be a more complete version of CM11 here: http://forum.xda-developers.com/nokia-x/development/rom-cyanogenmod-11-m8-4-4-4-t2838336

In CWM recovery, select “Data Wipeout / Factory reset” option and wipe the data.
Select “Wipe Dalvik cache” from the Advanced Option
Select “Install ZIP –> Install ZIP from sideload”

sudo adb sideload cm-11-20140426-UNOFFICIAL-normandy.zip

Select “Reboot system now”

Note: the reboot can take about 1 minute to get started due to a bug in the current CWM Recovery.

Enjoy !

EDIT 2014-07-22: Since there doesn’t seem to be any active development on the CM port for Nokia X (which seems a shame since they are so cheap) I found an AOSP ROM (based on Android 4.1.2) which seems to be workable as a day-to-day phone.
ROM Download: http://loki.rombitch.com/Devs/Dhacker29/NokiaX/msm8625-ota-eng.dhacker29-custom.zip
Discussion: http://forum.xda-developers.com/showthread.php?t=2710107

Apache Cordova development environment install on Ubuntu

Apache Cordova has very nice documentation, however as so many projects it is focused on the Windows/MacOS duopolies only. Fortunately it’s not too hard to work out the differences.

Apache Cordova Logo

Installing dependencies

Thanks to: https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

sudo apt-get install python-software-properties python g++ make ant openjdk-7-jre openjdk-7-jdk

Installing Android SDK

Please note: one of the problems I found was that I had some Android tools from the Ubuntu repos that were conflicting with the SDK install. It’s probably a good idea to remove them first. That might save you from a lot of headaches down the line (and time to troubleshoot).

sudo apt-get remove android-tools-adb android-tools-fastboot

Download as per http://developer.android.com/sdk/index.html

wget http://dl.google.com/android/android-sdk_r22.6.2-linux.tgz

Note: check for updated link version obviously

vim ~/.bashrc

Add the PATH variables to the top of the file

#AndroidDev PATH
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools

Reload bash variables without reboot / logout

source ~/.bashrc

Testing SDK

android

This command should now bring up the SDK manager.

Installing Eclipse IDE

This is obviously an optional step depending on the IDE you want to use. I have previously covered a manual Eclipse install (as opposed to the Ubuntu repositories).

Install Eclipse ADT Plugin

As per: http://developer.android.com/sdk/installing/installing-adt.html

Node.js Install

The main difficulty on Ubuntu (as with so many development tools – see Eclipse above) is that the included node.js version in the Ubuntu repositories is outdated (remove the Ubuntu version with ‘sudo apt-get remove node’).

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install python-software-properties python g++ make nodejs

Install Cordova

sudo npm install -g cordova

Check Cordova Requirements

This will check for Android SDK installation, Ant and other dependencies – saving you going through error messages later.

~/.cordova/lib/android/cordova/3.4.0/bin/check_reqs

Create Cordova Project

mkdir ~/projects/PROJECTNAME
cd ~/projects/PROJECTNAME
cordova create ~/projects/PROJECTNAME com.COMPANYNAME.PROJECTNAME PROJECTNAME
cordova -d platform add android
cordova build

Create Eclipse Project

Open Eclipse
Create New Android project from existing sources
Import ~/projects/PROJECTNAME/platforms/android
Test in emulator by right clicking the project and selecting “Run As –> Android App”