Upgrading My Nexus 5 to Lollipop

I love a clean start. There’s nothing like the feel of a smartphone (or PC) after a factory reset.

I’m using my Nexus 5 for almost a year now. For a while, I’ve been wanting to do a factory reset and start clean. The upcoming Lollipop upgrade is exactly the push I needed to do it.

My game plan:

  1. Before upgrading:
    1. Perform general app cleanup, so I upgrade only with the apps I want.
    2. Document my settings and configuration (system and apps), so I can re-apply it if needed.
    3. Backup data.
  2. Upgrade.
  3. After upgrading:
    1. Restore apps, data, settings and configuration, as needed.
    2. Explore what new built-in features can replace 3rd party apps I’m using. I always prefer built-in over 3rd party.

Initially, I planned to wait for the OTA update. I figured it would simplify the process, and should reach my device soon enough. Google started rolling out the OTA on November 12th 2014. Like most Android updates, this rollout was in “waves”. 3 days later, the waves still didn’t reach my Nexus 5.

With the factory images already available, I started wondering why I’m waiting for the OTA over going manual. I figured that the only downside of going manual with the factory image is having to perform full wipe to unlock the bootloader. That doesn’t bother me, since I want to factory reset any way!

I decided to pursue the manual upgrade route, which I describe in this post.

Warning: This process requires using the fastboot tool over USB from a terminal. While not too complicated, it does require being comfortable with doing such things. Also, enabling USB debugging and unlocking the bootloader exposes your device to extra security risks (even if for a short time). Proceed with caution, or prefer going the OTA route.

Preparing My Nexus 5 For Lollipop: Data Backup

I love a clean start. There’s nothing like the feel of a smartphone (or PC) after a factory reset.

I’m using my Nexus 5 for almost a year now. For a while, I’ve been wanting to do a factory reset and start clean. The upcoming Lollipop upgrade is exactly the push I needed to do it.

My game plan:

  1. Before upgrading:
    1. Perform general app cleanup, so I upgrade only with the apps I want.
    2. Document my settings and configuration (system and apps), so I can re-apply it if needed.
    3. Backup data.
  2. Upgrade.
  3. After upgrading:
    1. Restore apps, data, settings and configuration, as needed.
    2. Explore what new built-in features can replace 3rd party apps I’m using. I always prefer built-in over 3rd party.

I have lots of data on the sdcard. My Nexus 5 is the 32GB model, and before going through with factory reset & upgrade, I have about 24GB used. In this post, I describe what I backup, and how I get it off the sdcard over to my MacBook.

I performed this backup procedure right before going through with the upgrade, so the backup is as up-to-date as possible.

Weekly Review, November 22

By Saturday, November 22, 2014 0 Permalink 1

Last week I got tired of waiting for the Android Lollipop OTA update to reach my Nexus 5. I went through manually flashing the Nexus 5 Lollipop factory image. You can read all about my upgrade process in the upgrade mini-project posts (which is practically finished, but some of the planned posts are still pending).

Some initial thoughts on Android Lollipop:

  1. It’s pretty.
  2. It’s smooth.
  3. I experienced some really bad cellular reception on the first day. It seems the issue went away though.
  4. Battery drain is somewhat higher on average. This is not based on benchmarking, just on hunch. The difference is not significant enough to be a real issue, at least for me.
  5. The new lock screen behavior with notifications is interesting. I haven’t restored my DashClock lock screen configuration, so I can see how I like this one.
  6. The most notable change is probably the task switcher. It’s completely different. As long as I keep it clean, I like it. The problem is that it’s hard to keep it clean…
  7. Still haven’t figured out the new share menu. Is it sorted? By what? Can I control it?
  8. A nasty bug that I ran into 3-4 times so far: some activity gets “stuck” in the foreground. pressing “back”, “home”, or trying to switch away doesn’t work. after several seconds, I can lock, unlock, and then “home” will bring back the home screen. I couldn’t recognize any specific pattern that led to this bug yet.
  9. The Tasker task I have for disabling the PIN code lock stopped working. When I run it, the screen lock setting is changed to “Swipe” as expected, but the PIN is still active…
  10. SmartLock is nice! I heard an upcoming update adds “trusted locations” to it, which will be very useful for me!
  11. Long pressing the power button is a bit confusing now. It offers only “Power off”. No more silent / vibrate mode.
  12. The volume control now contains also “Interruptions control”. This can be set to “All”, “Priority” or “None”. “None” is like silent mode, but also for alarms! Seems that “Priority” is equivalent to the “standard silent mode”. Not sure where I can choose between “silent” and “vibrate” though…
  13. “Priority” mode can be enabled “indefinitely”, or for “N hours”. It also allows configuring “Downtime”, that automatically sets priority mode on schedule. This is similar to the Silence Premium app that I use for “downtime” and auto-priority-mode during calendar events, but without the calendar-awareness feature.

Some thoughts on the Android upgrade process:

  • When preparing for an upgrade, it’s hard to predict what gets automatically restored and what doesn’t.
  • The way different apps handle customization, settings, and app-related data is pretty inconsistent. From an end-user point of view, I’d expect Android to offer some kind of “synchronized app configuration and data storage service” API, that I can connect with my Google account. This way, my personalization can follow me across different devices and device-upgrades without all the hassle. Am I missing something here?
  • Overall, despite taking the factory image flashing route, the upgrade process was straight forward and smooth.

The Weekly Review is a recurring (so-far-)weekly summary, reviewing highlights from the last week.

Preparing My Nexus 5 For Lollipop: Settings and Configuration

I love a clean start. There’s nothing like the feel of a smartphone (or PC) after a factory reset.

I’m using my Nexus 5 for almost a year now. For a while, I’ve been wanting to do a factory reset and start clean. The upcoming Lollipop upgrade is exactly the push I needed to do it.

My game plan:

  1. Before upgrading:
    1. Perform general app cleanup, so I upgrade only with the apps I want.
    2. Document my settings and configuration (system and apps), so I can re-apply it if needed.
    3. Backup data.
  2. Upgrade.
  3. After upgrading:
    1. Restore apps, data, settings and configuration, as needed.
    2. Explore what new built-in features can replace 3rd party apps I’m using. I always prefer built-in over 3rd party.

In order to be able to restore all of my set up, layout, customization, etc., I want to document in detail my starting state. This documentation should include anything that I might need to re-apply after factory reset & upgrade. It’s OK to skip things that are restored automatically (cloud-based, etc.). If I’m not sure about something, better be safe than sorry…

The method: Go over everything, and write down and/or take screenshots of anything I want to document.

This process generated a lot of data. Some of it includes sensitive stuff that I don’t want to document publicly (like account names on various services). All of it is highly personalized, and is probably of little interest to most readers. So instead of writing a post with 425 screenshots (really!) (and pixelating out many of them), I decided to just keep a few highlights, and describe the method. Feel free to ask for more details if you’re interested in something specific.

Shell Foo: Printing the Nth Line of a File

You’re running a Python script from the command line, and it throws some exception in your face. You want to take a quick look at the line that raised the exception (say, 42). How would you print that line?

My favorite way (minimal typing):

$ sed -n 42p myscript.py

Shell-Foo credit for this one: Eyal Fink.

Shell-Foo is a series of fun ways to take advantage of the powers of the shell. In the series, I highlight shell one-liners that I found useful or interesting. Most of the entries should work on bash on Linux, OS X and other UNIX-variants. Some probably work with other shells as well. Your mileage may vary.

Feel free to suggest your own Shell-Foo one-liners!

Sort Your Include Files!

The Google C++ Style Guide defines a guideline for names and order of includes. It occurred to me that grouping and sorting include files is tedious and error prone, and a computer can do it much better. So I wrote a script that does exactly that :-) .

The nitpick script is available on my GitHub cpplint fork.

If you’re comfortable with Python, you can figure out the script straight from nitpick.py source code and the accompanying unit tests. You can also read the rest of the post for some plain English review :-) .

Weekly Review, November 15

By Saturday, November 15, 2014 2 Permalink 1

Yesterday was Oogis birthday! She’s 30 years old! That’s old!

A couple of weeks ago I wrote about using Bitnami to set up a local WordPress sandbox. I was surprised (and delighted) to hear from Daniel from Bitnami shortly after, thanking me for the post, and asking to send me a T-shirt! I definitely did not expect such a nice experience when writing the post. Kudos to the Bitnami team for engaging with their users like that. I can only assume that they are as responsive to complaints as well.

The OTA update for Lollipop started on Wednesday, Nov.12. It includes Nexus 5, 7 & 10. As with most Android updates, this update is rolled out in waves. Unfortunately for me, it seems I’m on a “late wave”, and haven’t gotten my update yet, 3 days later… :-(

The wait is too long for me! With the factory image available for download, I see no reason to keep waiting! I’m not afraid of a little adb-ing and fastboot-ing. As I see it, the only advantage of waiting for the OTA is avoiding a full data wipe. But I want to start clean, so I don’t mind doing a full wipe. As I write these words, I’m backing up the Nexus sdcard to my MacBook, before performing the manual Lollipop flashing. You can expect a detailed post on this process soon, if I don’t fuck it up on the way… :-) (update: as I publish this post, a couple of hours after, I finished the manual upgrade, and working on restoring all my settings)

The Weekly Review is a recurring (so-far-)weekly summary, reviewing highlights from the last week.

Teaching cpplint About External Libraries h-Files

The Google C++ Style Guide defines a guideline for names and order of includes. Unfortunately, the cpplint tool that automates style-guide checking isn’t consistent with that guideline, as far as “other libraries h files” are concerned.

In this post, I demonstrate the claimed inconsistency, and suggest an enhancement to cpplint to fix the inconsistent behavior.

The enhancement is available on my GitHub cpplint fork (including addition unit tests).

Use cpplint to Check Your C++ Code Against Google’s Style Guide

By Wednesday, November 12, 2014 0 , , Permalink 1

cpplint is an automated checker for C++ code. It checks the style of an input C++ source file against Google’s C++ style guide.

If you’re writing C++ code, and trying to follow the said style guide, I strongly recommend using this tool!

Endless rants can be written on programming style and style-guides. This is not one of them :-) .

At the end of the day, my personal opinion is that it doesn’t really matter what conventions you choose to follow. What does matter is that if you collaborate with a team on a common codebase, it’s extremely important to obtain and sustain consistency. To that goal, as long as one consistent style guide is followed by all collaborators – the specifics of the style guide are not too important.

When choosing a style guide to follow, having an automated tool available for collaborators to check themselves has great value. Without it, code reviews end up revolving around style issues instead of the logic being reviewed (you are practicing code reviews, right?). This is the main reason that I default to Google’s C++ style guide.

One of the things I like most about Google’s cpplint tool is that it prefers false negatives over false positives. This means that, while it misses some “style issues”, it usually doesn’t mistakenly produce warnings for compliant code. From my experience, developers are quick to ditch tools that generate lots of cruft. It’s much better that the developer fixes some reported issues instead of ignoring all.

The cpplint tool is available on this official Subversion repository, as well as from my GitHub fork of it. I forked it to make some changes. They might be specific to how I work, but maybe others may benefit from them. Checkout the cpplint tag for more on my changes and other cpplint-related stuff. See also the google-styleguide project.

How To Migrate a WordPress Blog

By Monday, November 10, 2014 0 , Permalink 1

One of things I love about WordPress it that it’s an open content platform. Being open, the platform understands that the user owns the content within. Truly owning your content means you should be able to take it out of the platform, and do whatever you want with it. WordPress makes it easy!

This post is a how-to guide on migrating a WordPress site. It covers:

  1. Exporting all your content from a hosted WordPress.com site.
  2. Importing the content to a self hosted WordPress site.

The export part applies also to self-hosted WordPress sites. I write specifically about a WordPress.com-hosted site because this is what I use for the example.