Saturday, February 16, 2013

Introducing YouTuPi, a YouTube (mobile) web frontend for your Raspberry Pi

I've been the proud owner of a Raspberry Pi for several months now. Since I bought it, I've looking for ways of replacing all the functionalities my old TV-attached laptop had, which basically were: torrent downloader, DLNA server and YouTube player. This device has a very low power consumption so this would be great news.

My first approach was to install Raspbmc which is an XBMC optimized for this hardware. In spite of  XBMC is a great piece of software, in my case it was quite unresponsive, and made my Raspberry Pi hang several times.

This made me try Raspbian which is a very lightweight distribution. As it's based on Debian, I installed Transmission and MiniDLNA with no much trouble using apt-get since they are in the repositories. At this point I was quite happy with the result: I had a torrent daemon I was able to control through its web-interface or even with an android application, and the downloaded media was played in my DLNA-capable TV.

The hard-part: playing YouTube videos on the TV

Since flash has so little performance in linux playing YouTube videos from an internet browser was out of the question. Searching the web I found YT: a command-line application written in python for searching YouTube videos and play them without flash thanks to youtube-dl. This was pretty cool, but I was looking for a more user-friendly solution. Inspired by YT's approach I wrote YouTuPi which has a web interface that can be used in any modern tablet/phone and allow us to search and create a playlist of YouTube videos.

You can find the installation instructions (and the code itself) in YouTuPi's GitHub repository.

Wednesday, January 2, 2013

Moving your android apps to the external storage

Since recently I've been playing more with my modest android smartphone, I started suffering from his lack of internal storage memory. His 150 MBs quickly become insufficient since it comes with plenty of pre-installed applications that can't be erased unless you root your phone.

I was looking for an easier way to make more room for applications when I found this excellent howto. You will need to setup your phone to store by default in the external storage, and then suddenly almost any installed application can be moved to the external storage, and the newly installed applications will go there by default.

I'll describe the process that I made in order to configure my phone. I used a laptop with an Ubuntu Linux distribution installed.

First, we need to install the Android SDK Manager in the computer. In Ubuntu, we can use a PPA repository:

sudo add-apt-repository ppa:upubuntu-com/sdk
sudo apt-get update
sudo apt-get install ia32-libs android-sdk

Now we can open the Android SDK Manager and install the SDK Platform-Tools if we don't already have it.

Then, we need to connect our phone to one of the laptop's USB. We allow USB debugging on our phone in Setup > Applications > Development.

Finally, we reconfigure the storage defaults:

cd ~/android-sdk-linux/platform-tools
./adb kill-server
sudo ./adb start-server
./adb devices
./adb shell pm setInstallLocation 2