Android
Setting up a development environment for Android devices
First you'll need to download the android SDK. It can be found here. Extract the contents of the archive to your desired location.
Next you'll need to configure the usb driver via udev. To do this we'll need to create the file /etc/udev/rules.d/51-android.rules.
$ sudo nano -w /etc/udev/rules.d/51-android.rules
Add the following directive:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
Use Ctrl-X to exit nano. In order to use the tools in the sdk you will need to add it to your path. Substitute /path/to with your path.
$ export PATH="/path/to/android-sdk-linux_x86/tools/:$PATH"
On your device, make sure you turn ON USB debugging. Go to Settings -> Applications -> Development -> USB debugging and make sure you have ticked the box. The adb tool is no longer installed by default, so in order to install it, you need to add it via the android sdk interface.
$ android
In the interface, choose available packages, then "Android SDK Platform-tools". Allow the components to download. Check where the adb binary has been installed. You'll then need to add the new path as well.
$ export PATH="/path/to/android-sdk-linux_x86/platform-tools/:$PATH"
Once the proper path has been added, you should be able to execute the adb command. Plug in your device via usb, then run the command to see if it has connected properly.
$ adb devices
You should see something along the lines of
List of devices attached <serial number here> device
We'll now need to download the android source. First make a folder called bin in the location of your choice and add it to your path.
$ mkdir bin $ export PATH="/path/to/bin/:$PATH"
Go to the folder you've created, download the repo manifest and set its permissions.
$ cd bin $ curl https://android.git.kernel.org/repo > repo $ chmod a+x repo
Create a working directory to download the source files.
$ mkdir WORKING_DIRECTORY $ cd WORKING_DIRECTORY
If you haven't before, you'll need to set your identity in git to sync the repository. Once done,
$ repo init -u git://android.git.kernel.org/platform/manifest.git
After the files have downloaded, verify your git tags.
$ gpg --import
Copy and paste the public key found at http://source.android.com/source/building.html . Press ctrl-D to close the file. Next, initialize the build.
$ source build/envsetup.sh $ . build/envsetup.sh
Choose a target
$ lunch full-eng
Make the source
$ make -j4
Given your version of make is the intended target for the android source you downloaded, this compilation will create tools (such as fastboot) allowing you to access emulated or physical android devices.