[Sony Ericsson XPERIA X10 Mini] slade87:
Dear Community,

Please read the following before starting on reading on.After lots of requests I decided its time to provide every oncoming developer with a short guide on how to start developing for our beloved Mimmi (most stuff applies also for Robyn or other Android devices).

I'd also like to get a few words passed on what actually in most cases developing is, so let's start with the basics:

There is different ways of developing there is people like Cyanogen Mod which provide you with a bunch of changes to the original Android source code which enables new features, adds hardware support or make things easier for specific device developers. However these people at Cyanogen are often not fully recognized so please make sure to thank these people as well. Besides that there are ports of similiar devices which will not be explained in this tutorial but also these developers usually put a lot of effort into their roms however since the source is already compiled changes are usually of a cosmetic nature. In this tutorial however you will find the basics on how to compile kernel or android from source in order to build your own changes into your own rom, which btw would have never been possible without the developers porting xrecovery or cwm to our devices so please give these people a big thumbs up as well after reading on.

What do I need/Environment set up

Most people have issues on setting up a the heart of your Developer Carreer, the Environment. What I strongly advise is to have at least a bit knowledge of the main usuage of Linux Distributions and also programming languages. Without these you will most likely fail at one stage or another to make a successful build.

So lets evaluate what you need :

Linux Distro (i.e. any Ubuntu should do well)

a VM or native Linux

quite a bit of Linux skills and programing skills

Time and a high tolerance of frustration

Sufficent RAM (at least 4 GB, more is advised otherwise use native Linux)

If you know how to install a native Linux Distribution you can probably skip this part, I will explain how to use a VM to fill the basic needs and keep your development area seperated from you most likely otherwise needed productive platform.

The following Steps are just keywords, if you want to develop you will need to inform yourself how to achieve all this yourself, there's lots of tutorials out there.

Step 1: Download a VM and a Linux Distro

Step 2: Install VM Software (i.e. VirtualBox or VMWare Server)

Step 3: Install the Linux Distro in VM (you'll need at least 6 GB Swap and 50 GB or More HD space to have enough room for experiments/seperate syncs/etc...)

Step 4: Figure out if you installed 32 Bit or 64 Bit (you'll need this later)

Step 5: Boot your new VM based Linux Distro

Step 6: Set up a Share Mount between your host and your VM

Step 7: download the Android Source/Cyanogen Source of your desire (i.e. : repo http://**** -b gingerbread) into a folder for you desire (the folder should represent your ROM's/Kernel name)

Building a Kernel

Building a Kernel is one of the easier parts considering the full source code is available for download. Sony Erricson Open Source Dev Website is providing fully funtional Kernel sources usually in the tar.gz format. Download the source code and extract it, or if you use a git based repository clone or checkout the project into a folder of your desire.

The next step, is not mandatory but advised to sync the entire Android repo/CyanogenRepo as the repo also provides the Cross Compiler toolchain which is needed to compile for your device.

Once everything is finished downloading you should check the following path in the Android repo : platform/linux-x86(orx64)/prebuilt/toolchain/arm-eabi-4.4.3/bin/ this is the cross compiler we will use to build the kernel itself, its vital to have the compiler present, the version number maybe different though.

Lets start with the building process itself:

cd kernelfolder
cp arch/arm/configs/semc_mimmi_defconfig .config (the command maybe change to copy another default config file, it creates a file in the root of the kernel folder called ".config"
ARCH=arm make menuconfig (this will bring up the kernel configuration menu for arm devices)

In the Menu Config you can change/add features to the Kernel once you are done safe the kernel config. Now your Kernel is ready to be compiled:

ARCH=arm CROSS_COMPILE=/pathtoandroid_source/platform/linux-x86(x64)/prebuilt/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make -j4

This will start a compile with 4 Jobs using the Architecture ARM and the Cross Compiler arm-eabi from the Android Source Repo. Once finished you'll find your Image in your kernel folder under arch/arm/boot/Image. Now you'll need to build your own ramdisk this is covered here at xda as well azuzu has also build a tool available to download.

Follow the instructions to create the kernel.sin which now can be flashed with Flashtool. Changes to Kernel source will now be available to your compiled Kernel. How to change the Kernel source is beyond this tutorial but programmers in C will have fun there.