Updating my Nexus 5 from stock ROM to Lineage OS

It doesn’t seem like much, but it definitely requires some preparation and knowledge. I won’t detail all the steps in here, there are many tutorials on the internet. But it’s just a little recap with useful links and info.

I’ve mainly followed this guide (but it’s in french).

Backup your files

Many ways to do that. There are apps like Helium or Titanium Backup.

Google can save your data too.

You can also use the adb command to create backups from your computer (tutorial in french, easy to follow, it’s just command lines).

Connect your phone to USB and check all folders, especially the Pictures folder as everything will be wiped.

Unlock your phone

This will wipe the data of your phone. No other solution here, just do it. Tutorials are easy to find on the internet. I used this one.

I would recommend to reboot the device completely. It might have avoid my bootloop issue (see next part).

Install custom recovery

TWRP is the most famous one, so I chose this one. Go to the official page to download the img file (this is specific for the Nexus 5, the list of other devices is there). Instructions for the Nexus 5 are available on the site too.

I had an issue with the install, not sure if it’s because of the version (3.1.0 at that time) or my install file which was corrupted. But I ended up with a bootloop, but with fastboot still available.

After some research, it’s actually easy to fix that up. I found that thread in XDA forums, where a member says he followed that other guide to put his device back on the road (just replace stuff with Nexus 5 files and you’re all good).

Phew… I must say I was a bit stressed after seeing my Nexus 5 in a bootloop !

Boot to TWRP

Boot to fastboot (hold volume down + power buttons). Choose recovery with the volume button and press power to choose recovery.

Wipe those partitions:

  • Dalvik / ART Cache
  • System
  • Data
  • Cache

Install Lineage

Download the ROM file from the official Lineage OS site.

When in TWRP, the USB storage of your device should be available from your computer. You can copy the Lineage OS zip file to your phone.

I also put the md5 check file so TWRP can check the integrity of the file before installing it. If your rom filename is lineage-14.1-20170328-nightly-hammerhead-signed.zip, create a text file named lineage-14.1-20170328-nightly-hammerhead-signed.zip.md5,  open it with a text editor and put the MD5 hash inside it. Be sure to copy it alongside the Lineage OS rom file on your phone.

Install it using the Install option in TWRP. Once done, wipe the cache as recommended by TWRP. Tap TWRP icon on the top left to go back to TWRP menu.

Install Google Apps via Open GApps

Go to http://opengapps.org/ to download the Google Apps package. The Nexus 5 is using an ARM processor. Note that I tried to install the Stock package, but it failed because of the size of the System partition being too small. I had to go down to the Micro package to be able to install the apps.

Same thing as above, put the zip file on your device, along with the md5 file (you can download that file directly from the open GApps site). Install it using TWRP, wipe the cache, and you’re done.

Reboot and enjoy

Reboot the phone and let LineageOS boot. It will take some time to boot at first.

Restore the files using whatever method you chose. I personally just restored things from my Google account. I don’t mind loosing some data as I didn’t have anything important.

Android Lollipop Recyclerview touch effect on items

The new Recyclerview in Android Lollipop is nice. And it’s even more neat if you can get the “touch effect” on each item of your list.

I had troubles to find how to do that so here is a little reminder.

Simply add

into your list item root layout.

And you should have this nice touch animation.

Android : Use your device to debug your app

Because this should be really easy, but it’s a real PAIN, here are steps you have to go through to use your own device to debug your app. Useless to say that as the emulator is crap very slow, this is really necessary to develop in good conditions.

This is for windows, but some steps are the same for each OS.

Get you device into developer mode

Go to parameters, about the phone/tablet/whatever, tap several times on Build number. This will activate the developer mode.

Activate USB Debug mode

Now in your device parameters, you have a developer menu at the bottom. Go there and simply activate the USB debug mode.

Install drivers on your computer

Download the ADB USB drivers from Google page. Extract it somewhere safe.

Plug your device on your computer. On your computer, go to the device manager. Right click on your device which should have a yellow icon on it. Install the driver from a location. Select the ADB USB driver location. All should install fine.

Verify your environment variables

You need to have the ANDROID_SDK_HOME variable on your computer in order to make this work.

This variable value should point on C:\Users\LouWii\.android. Of course, replace LouWii by your windows account.

Make your PC to detect the device

Open up cmd.exe. Go to your Android SDK folder. I don’t remember the default path; I installed mine separately. Here are the command I needed to enter : (the first two are to go inside my Android SDK folder)

This made a popup appeared on my phone to accept the debug apps from the computer.

If not, try to change the USB mode of your device : go to parameters, stockage and tap on the three dots on the top right on your screen. Change from MTP to PTP.

You’re done

That’s the steps I made to get this work. This is a real pain compared to iOS dev, but whatever…

J’ai tweeté : #Appmethod – Développez pour #Android et #iOs simultanément

#Appmethod – Développez pour #Android et #iOs simultanément
http://t.co/DwxOEiDO0E mouais, je me demande comment ça sera à l’utilisation