Difference between revisions of "Sony Xperia tipo"

From Random Projects
Jump to: navigation, search
m (Android SDK setup on Debian/Linux: adb setup)
Line 238: Line 238:
  
 
== Android SDK setup on Debian/Linux ==
 
== Android SDK setup on Debian/Linux ==
 +
 +
=== SDK ===
  
 
Download and extract the [http://developer.android.com/sdk/index.html Android SDK] (for Linux, in this case).
 
Download and extract the [http://developer.android.com/sdk/index.html Android SDK] (for Linux, in this case).
Line 250: Line 252:
  
 
Select/enable "Android SDK Platform-tools" and "Android Support Library" additionally to the already selected components, then click "Install packages" to download and install the respective SDK components. You can use the same GUI later to upgrade components as needed.
 
Select/enable "Android SDK Platform-tools" and "Android Support Library" additionally to the already selected components, then click "Install packages" to download and install the respective SDK components. You can use the same GUI later to upgrade components as needed.
 +
 +
=== Eclipse ===
 +
 +
You can use Eclipse as IDE for Android development together with the SDK and the [http://developer.android.com/sdk/installing/installing-adt.html ADT plugin]. This is not a strict requirement though, you can also use the SDK tools from the command-line and work without Eclipse if you want.
 +
 +
==== Eclipse via Debian package ====
 +
 +
This is the simplest method, but you need Eclipse >= 3.6 (older versions won't work). If your distro has a recent enough version:
 +
 +
$ '''apt-get install eclipse'''
 +
 +
 +
On 64-Bit Linux you might need to install the '''ia32-libs''' package:
 +
 +
$ '''apt-get install ia32-libs'''
 +
 +
=== Manual Eclipse download ===
 +
 +
If your distro has an Eclipse version that's too old, you can download a recent tarball from the upstream developers.
  
 
Download the [http://www.eclipse.org/downloads/ Eclipse] IDE >= 3.6 (the "Eclipse IDE for Java Developers" variant), then extract it somewhere:
 
Download the [http://www.eclipse.org/downloads/ Eclipse] IDE >= 3.6 (the "Eclipse IDE for Java Developers" variant), then extract it somewhere:
Line 264: Line 285:
  
 
  $ '''apt-get install ia32-libs'''
 
  $ '''apt-get install ia32-libs'''
 +
 +
=== Eclipse setup ===
  
 
Start Eclipse and [http://developer.android.com/sdk/installing/installing-adt.html configure it for Android development use]:
 
Start Eclipse and [http://developer.android.com/sdk/installing/installing-adt.html configure it for Android development use]:
Line 269: Line 292:
 
  $ '''cd eclipse'''
 
  $ '''cd eclipse'''
 
  $ '''./eclipse'''
 
  $ '''./eclipse'''
 +
 +
== adb setup ==
 +
 +
See [http://developer.android.com/tools/device.html here].
 +
 +
For the Sony Xperia tipo you can use a file like this (on recent Debian distros):
 +
 +
$ '''cat /lib/udev/rules.d/51-android.rules'''
 +
ACTION!="add|change", GOTO="android_rules_end"
 +
SUBSYSTEM!="usb|usb_device", GOTO="android_rules_end"
 +
 +
# "Sony Ericsson Mobile Communications AB" (e.g. Sony Xperia tipo)
 +
ATTRS{idVendor}=="0fce", ATTRS{idProduct}=="5170", MODE="664", GROUP="plugdev"
 +
 +
LABEL="android_rules_end"

Revision as of 01:01, 8 October 2012

The Sony Xperia tipo is an Android smartphone.

Overview

TODO.

Android info

  • Model number: ST21i
  • Android version: 4.0.4
  • Baseband version: 7x25A_M:2045.40.00.60.001.002_A: 2045.40.00.60.001.039
  • Kernel version: 3.0.8-perf user@PC2-desktop #1
  • Build number: 11.0.A.0.16

Hardware

TODO.

lsusb

The device enumerates under two different USB vendor/device IDs, depending on the mode that is configured on the device (MTP mode, or mass storage mode):

MTP mode

$ lsusb -vvv
Bus 002 Device 101: ID 0fce:5170 Sony Ericsson Mobile Communications AB
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0fce Sony Ericsson Mobile Communications AB
  idProduct          0x5170 
  bcdDevice            2.31
  iManufacturer           2 Android
  iProduct                3 Android
  iSerial                 4 xxxxxxxxxx
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           62
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol      0 
      iInterface              5 MTP
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x001c  1x 28 bytes
        bInterval               6
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass     66
      bInterfaceProtocol      1 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

Mass storage mode

$ lsusb -vvv
Bus 001 Device 043: ID 0fce:6170 Sony Ericsson Mobile Communications AB
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0fce Sony Ericsson Mobile Communications AB
  idProduct          0x6170 
  bcdDevice            2.31
  iManufacturer           2 Android
  iProduct                3 Android
  iSerial                 4 xxxxxxxxxx
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           55
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface              1 Mass Storage
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass     66
      bInterfaceProtocol      1 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

Android SDK setup on Debian/Linux

SDK

Download and extract the Android SDK (for Linux, in this case).

$ wget http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz
$ tar xfvz android-sdk_r20.0.3-linux.tgz

Start the Android "SDK Manager" tool, which allows you to download the rest of the SDK components:

$ cd android-sdk-linux
$ tools/android update sdk

Select/enable "Android SDK Platform-tools" and "Android Support Library" additionally to the already selected components, then click "Install packages" to download and install the respective SDK components. You can use the same GUI later to upgrade components as needed.

Eclipse

You can use Eclipse as IDE for Android development together with the SDK and the ADT plugin. This is not a strict requirement though, you can also use the SDK tools from the command-line and work without Eclipse if you want.

Eclipse via Debian package

This is the simplest method, but you need Eclipse >= 3.6 (older versions won't work). If your distro has a recent enough version:

$ apt-get install eclipse


On 64-Bit Linux you might need to install the ia32-libs package:

$ apt-get install ia32-libs

Manual Eclipse download

If your distro has an Eclipse version that's too old, you can download a recent tarball from the upstream developers.

Download the Eclipse IDE >= 3.6 (the "Eclipse IDE for Java Developers" variant), then extract it somewhere:

$ tar xfvz eclipse-java-juno-SR1-linux-gtk.tar.gz

If you haven't already installed the Java JDK (>= 6.x) and ant (>= 1.8), you can do that now, e.g. like this (on Debian):

§ apt-get install openjdk-7-jdk ant

Note: According to the Android docs, the "GNU Compiler for Java" (gcj) does not work for Android development, use the Sun/Oracle JDK.

On 64-Bit Linux you'll also need to install the ia32-libs package:

$ apt-get install ia32-libs

Eclipse setup

Start Eclipse and configure it for Android development use:

$ cd eclipse
$ ./eclipse

adb setup

See here.

For the Sony Xperia tipo you can use a file like this (on recent Debian distros):

$ cat /lib/udev/rules.d/51-android.rules
ACTION!="add|change", GOTO="android_rules_end"
SUBSYSTEM!="usb|usb_device", GOTO="android_rules_end"

# "Sony Ericsson Mobile Communications AB" (e.g. Sony Xperia tipo)
ATTRS{idVendor}=="0fce", ATTRS{idProduct}=="5170", MODE="664", GROUP="plugdev"

LABEL="android_rules_end"