Archive

Posts Tagged ‘Android’

Root Access on Ouya

May 31, 2013 7 comments

Today I received my Ouya. For the ones who don’t know what an Ouya is, check out this link. The Ouya device has already the ‘su’ binary installed, so there is no actual ‘rooting’ necessary. But in order to get root access you still have to take some things into account.

ADB (Android Debug Bridge)
First we need a copy of ADB (Android Debug Bridge). ADB ist part of the Android SDK, which can be downloaded from here. Download the package according to your OS. On Linux just do the following steps

$ wget http://dl.google.com/android/adt/adt-bundle-linux-x86-20130522.zip
$ unzip adt-bundle-linux-x86-20130522.zip
$ cd adt-bundle-linux-x86-20130522/sdk/platform-tools
$ sudo cp adb /usr/local/bin

The ADB binary is self contained, so it can just be copied to somewhere else (e.g. /usr/local/bin).

adb_usb.ini
The second thing we need is an entry for the Ouya in our usb devices list. First we need to connect the Ouya to our PC with a micro-usb/usb-cable. Then call

$ dmesg

The output should look something like the following

[289053.442387] usb 1-1.5.6: new high-speed USB device number 25 using ehci_hcd
[289053.564585] usb 1-1.5.6: New USB device found, idVendor=2836, idProduct=0010
[289053.564595] usb 1-1.5.6: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[289053.564601] usb 1-1.5.6: Product: OUYA
[289053.564606] usb 1-1.5.6: Manufacturer: OUYA
[289053.564610] usb 1-1.5.6: SerialNumber: 00000000000000

If you haven’t upgraded the Ouya’s firmware yet the vendor ID (idVendor) might be different. If you have installed the latest firmware the ID should be ‘2836’, like the one from above. Now we have to add the vendor ID to our ‘adb_usb.ini’. Just do the following steps to add the device

cd ~
mkdir .android
echo “0x2836” >> ~/.android/adb_usb.ini

It is important to add a ‘0x’ in front of the actual number (its hexadecimal).

Connecting to the Ouya
Now we should be able to connect to our Ouya using ADB

$ sudo killall adb
$ sudo adb devices

The ‘devices’ command should list the Ouya

List of devices attached
00000000000000        device

If it does not list your device make sure to kill all ADB instances on your machine, and the start ADB (with ‘sudo’) again.

sudo killall adb
ps -e | grep adb

The second command shouldn’t output anything. If it lists

 6680 pts/1 00:00:00 adb
15926 ?      00:01:31 adb

then there are still instances of ADB running.

When everything is cleaned up, and the ‘adb devices’ lists our Ouya we can connect to it using

$ sudo adb shell

This gives us a shell on the Ouya (we can even be super user).

Advertisements
Categories: tech foo Tags: , ,

Debian on Android/Atrix with Debootstrap (Part II)

July 16, 2012 7 comments

When running Debian on Android in a chroot, you are bind to a Shell, but if you want a graphical user-interface to have a more comfortable usage experience you can also install a VNC server in the chroot and connect to it from the Android host system. This tutorial is an extension to my already published tutorial because someone asked me if I can write a little bit more on how to get the VNC Server to run. Here it is:

  • Follow my first tutorial (here)
  • Start the chroot environment
  • Before you execute the commands below keep the following things in mind,
    • You need around 38MBytes of free storage in your chroot
    • When first starting the vncserver you need to specify a password (Remember it!)
  • Now execute the commands to install the vnc server and a lightweight X-Window setup

    aptitude install –without-recommends lxde tightvncserver xfonts-base
    export USER=root
    vncserver -geometry 960×540

  • Switch back to Android and install the android-vnc-viewer
  • Start the app and put in the following settings:

    Nickname: *Whatever*
    Password: -the-vncserver-password-you-defined-before-
    Address: localhost
    Port: 5901
    Username: -empty-
    Color Format: 24-bit color (4bpp)

  • Make sure you set the port to 5901 not the default (5900).
  • You are done. With these steps you should be able to connect to the running VNC server inside the chroot.

Finally, here is a photo of my Atrix running LXDE:
20090101_001

Thank you, and have fun.

Google Music

April 5, 2012 1 comment

The Story

Every time I have new music on my PC (bought from a prestigious online music store of course), I forget to put it on my Phone as well. Then the next day when I go to work, I want to listen to my music. Just when I leave the door I realize that (again) I forgot to copy the new tracks to my phone. So I was searching for a service/application that synchronizes the music from my computer with my phone and laptop over night.

The Problem

Most online services only provide “full” sync (e.g. Dropbox, Ubuntu One), but I was looking for a service that intelligently synchronizes my files. By ‘intelligent’ I mean I want to define which files to sync according to simple patterns, like

  • Newest/Oldest first
  • Only defined amounts of data (e.g. 4Gb)
  • First a defined set of files, then newest/oldest first

Why I want this? My phone only has 16Gb of storage and I only have about 8Gb free for music. But my music collection at home is about 35Gb. So I want to have a basic set of tracks on my Phone (Tracks I always want to have on the device) and Tracks I recently added to my music collection.
I have to say, that I haven’t found a service/application that provides such a flexibility. But I found something else that comes, lets say close to my needs.

Google Music

I think most people have already heard about Google Music, but only a few have really tested it, because its only available in the USA. But in this post I will explain how to use Google Music from Everywhere.

Sign-in
First of all you need a Google Mail Account. When you have one go to music.google.com. When you access this Website from the US you are good to go and you can just click the button to accept the License Agreement. But when you live outside the US, you are faced with a page saying that this service is only available to residents of the United States. But no problem, go to hidemyass and type in the URL of Google Music again. Now the whole communication with the Google Website goes over a Web Proxy located in the USA. When the page is loaded you should face the License Agreement page as well. Just hit ‘accept’, and your account is activated for Google Music. After accepting the License Agreement you can go to music.google.com without the Proxy.

Google Music Manager
When you are logged in you are faced with the ‘Google Music Player’. First thing to do is uploading music to your player. This is done with the ‘Google Music Manager’. A desktop application available for all big Operating systems (Linux/Mac/Windows). To get the download link hit the ‘Upload Music’ button

Google Music

or follow my links:

I’m sorry I can’t provide the Windows links, because I don’t have a Windows Computer around. But as I explained when you visit the ‘Upload Music’ page with a Windows Computer you are provided with the according link.
Install the application and let it guide you through the steps of uploading your music to the Google servers. You are allowed to upload up to 20.000 songs. I think this is more then enough for most of us.
Tip: Most of us have an ADSL connection at home, means fast, download slow upload. But if you are a University student, go there and upload the tracks over the University network, because most Universities have a high capacity upload of about 10-100Mbit/s (against 1-3.3Mbit/s). Otherwise the upload of your tracks will take a looooong time.

Google Play Music
The next step is to install the Android app to access the music from your phone. Again when you are a resident of the United States just go to the play.google.com store and install ‘Google Play Music’. But when you are outside of the US, you have to get the app from somewhere else. Here is the link to the latest version (4.1.513). Download the *.apk file and install it to your phone. When you open the App it takes a few seconds, but then it should show all your uploaded music. When you click a track it will get streamed from the Google Servers to your phone.
But you don’t want to stream the music when you only have a volume contract (e.g. 500Mb) or are in a rural area. You can hit the ‘Offline Available’ button, then select the tracks that should be available offline and the app will download these tracks to a local folder. You can playback these tracks without an Internet connection. The app also allows to filter only tracks that are available offline, to see whats stored on your phone.

Google Play Music + Atrix
Here is a small hint for the Google Play Music app on the Motorola Atrix. Since Google Music is still in beta phase, there aren’t many settings. E.g. you can not decide where ‘Google Play Music’ puts the offline available music. The app stores the music under

/sdcard/Android/data/com.google.android.music/cache/music

When you have a lot of apps, your internal sdcard might already be full, and it would be useful to store all the music on your external sdcard. But both the sdcard and sdcard-ext are fat formated so you can’t create a softlink from your external memory to the internal to trick the app into storing the cached music on the external sdcard. But luckily we have the mount command to mount a folder into another folder, and this exactly what we are going to do. Just follow the steps below.
!!!You will lose all the music already made available offline!!!

su
rm -rf /sdcard/Android/data/com.google.android.music/cache/music
mkdir /sdcard-ext/music
busybox mount --bind /sdcard-ext/music \
/sdcard/Android/data/com.google.android.music/cache/music 

Now when the ‘Google Play Music’ stores music on your device for offline playback it will be stored on the external sdcard (sdcard-ext) and not the internal memory (sdcard). !!!But remember each time you restart your device you have to call the mount command again!!!

Nuvola Player

When you use Ubuntu (like me) you can use the Nuvola Music player to access the Google Music website in a more comfortable way. Just call the following commands to add the repository to your system and install the player

sudo apt-add-repistory ppa:nuvola-player-builders/stable
sudo apt-get update
sudo apt-get install nuvolaplayer

The player integrates into your system like a desktop application and is accessible via Ubuntu’s sound menu.

Screenshot at 2012-04-05 16:22:15

And for the Last.FM fanboys like me there is even a scrobbler script. Follow the tutorial from here to get it.

Have Fun!