[Android Software Development] 3ndymion:
Hello all. I have written a guide to setting up & using Android ADB, & building Android, with Fedora KDE. Almost every guide that I've ever seen for setting up ADB, & a build environment for building Android, is always written for Ubuntu, & ONLY Ubuntu. But I choose to work with Fedora KDE. Why Fedora with KDE??? Because I hate Ubuntu. !!!HATE!!! I also can't stand gnome 3.X. I'm sure I'm not the only one who feels this way, so that's why I'm writing this guide. I've tried different linux distros, & I've found Fedora to be the best of all. It is my favorite now. They also seem to be one of the few distros that stays on top of the linux kernel updates. As of 03/20/13, they're already on kernel 3.8.3!!! Other distros stay way behind. Also, with KDE, you can keep the "windoze" traditional desktop look & feel, especially when you use the "folder view" activity. It's great!!! Well, let's get started. :D :D :D

!!!WARNING!!! Before anything else, I will mention this right now. The Dolphin file manager can destroy your Android build with hidden ".directory" files. Please keep this in mind. I will explain this at the end of the guide.

INSTALL JDK6

-I guess I'll mention this 1st, since this can actually be one of the most painful & confusing parts of all. You'll need to install the java jdk6. As far as I know, Android stuff won't work with the newer jdk7. You can find it on oracle's page here:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

-Scroll down & you'll see it. Get the "rpm.bin" version. If your working with 64bit, it should look like this:

jdk-6u43-linux-x64-rpm.bin

-Someone by the name of JR already made a very good guide on how to do this. It is what I followed, & you should too. You can find it here:

http://www.if-not-true-then-false.c...java-jdk-jre-6-on-fedora-centos-red-hat-rhel/

NOTE: When following this guide, be sure to go through only steps 3a & 4a when you reach them. Steps 3b & 4b are for the "non-jdk" jre.

NOTE: The "alternatives" listed in step 4 seems to be some kind of program that creates symlinks for whatever you want, & labels them. When you install, or create the symlinks, you can then use "alternatives" to switch back & forth between the different programs that you make the symlinks for. For example, you can make links for java in jdk6 & jdk7, & then switch to either one or the other, as you please. That way, you can have them both installed, while using only one at a time. You can type "alternatives --config java" to switch, or whatever name you used for the link. For help, type "alternatives --help".

INSTALL SDK

-You can follow these:

http://developer.android.com/sdk/index.html

http://fedoraproject.org/wiki/HOWTO_Setup_Android_Development

SETTING UP ADB

-Download the sdk & unpack it somewhere in your home directory. For example, I like to put mine in "~/Android-Development/sdk" (the ~ symbol is short for your Home folder).

-cd to your sdk tools location. For example, from my Home folder, I would type this:

$ cd Android-Development/sdk/tools

-NOTE: DON'T TYPE THE DOLLAR SIGN!!! I put it there because that's what you see in the terminal. It's only there for reference.

-NOTE: At any time, you can type "ls", or "ls -l" to see everything in the folder you're currently in.

-Now, execute the android program.

$ ./android

-Install Android SDK Tools & Platform-tools.

-Install 32bit packages. Since Android is a 32bit OS, you must install the 32bit packages regardless if whether your computer is 64bit or not.

$ sudo yum install glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686

NOTE: In order to install packages with yum, you must do it as su. You can either type sudo before the command, or you can just type "su" & enter your password to become superuser. If you're new to the command line, it's probably better to use "sudo" instead, that way you won't stay logged in as superuser & potentially mess things up.

-Now, it's time to install the udev rules. Basically, they are the rules that govern whatever device you plug in with USB. You can find all the info on this page:

http://developer.android.com/tools/device.html

-Create an empty file named 51-android.rules to write in. We will create it in /etc/udev/rules.d/

$ sudo touch /etc/udev/rules.d/51-android.rules

NOTE: "Touch" is a linux command that you can use to create a new, empty file. To see more info on it, type "touch --help", or "man touch" to see the manual page for it. Of course, you can always google it, & anything else as well. Google "linux commands touch".

NOTE: Since this file is in the root user's directories, you will need to enter commands as superuser, or else it won't save. Either type "sudo" before the command, or, if you're comfortable with the command line, log in as superuser by typing "su" & entering your password.

-Now, you can use any text editor to write inside that file you just created. I like to use nano from the command line, so let's use that. ("nano --help", "man nano", google "linux commands nano")

$ sudo nano /etc/udev/rules.d/51-android.rules

NOTE: In linux, you can copy & paste without even "right-clicking" & selecting copy or paste from the menu. Instead, you can just highlight some text, & go somewhere else & press the mouse middle button to paste it. Highlighting text will automatically copy it, & pressing the mouse middle button will automatically paste whatever you highlighted. No need for "right-clicking" anything. You can do this for the next step.

-Now, from the webpage listed above, just copy & paste the lines with the USB Vendor IDs that you want to use. For example, for Asus, HTC, & Samsung, write these:

SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"

-Save & exit the file.

NOTE: In nano, you can always see important commands at the bottom of the screen. For example, to exit, you hold in the "control" button & press "x".

-Now, check the permissions of the file & make sure everyone can read it.

$ ls -l /etc/udev/rules.d/

-You should see something like this:

$ -rw-r--r--. 1 root root 639 Feb 5 14:08 51-android.rules

NOTE: The 1st line indicates whether it's a directory or not. The next 3 lines indicate Read, Write, & eXecute permissions for the user. The next 3 lines indicate Read, Write, & eXecute permissions for the group. The last 3 lines indicate Read, Write, & eXecute permissions for others. The 1st "root" means that root is the user. Root owns that file. The 2nd "root" means that the file belongs to the group root.

-If for some reason you don't see the "r" letters (meaning that it's readable) to the left of the file name, then just change the permissions. Add "read" permissions for all.

$ sudo chmod a+r /etc/udev/rules.d/51-android.rules

-Finally, if you didn't do it earlier, now's a good time to do this. Make sure the ADB folders are in your global PATH. This is so that you can use the ADB commands anywhere in the system, no matter what folder you're currently in.

-Return to your home folder.

$ cd

NOTE: In the linux command line, simply typing "cd" & pressing enter will bring you right back to your Home folder.

-There's a hidden file called ".bash_profile" in your home folder. You can see it if you LIST ALL:

$ ls -a

-Your global PATH is defined in there. Let's edit it to add the ADB folders.

$ nano .bash_profile

-You'll see that there's already one line in there with 2 entries that look like this:

PATH=$PATH:$HOME/.local/bin:$HOME/bin

You can use that as your example as to what the format should look like. The line begins with

PATH=$PATH:

Then there are 2 entries, with each entry separated by a colon. Each entry must be separated by a colon and NO space.

$HOME/.local/bin

is one entry, &

$HOME/bin

is the other entry. Now, we want to add our 2 ADB folders to the list. You can either add each path to your folder separated by a colon & no space, like the example, or you can start your own line. I always like to start my own line underneath that one. So, for example, here's what my new line looks like:

PATH=$PATH:$HOME/Android-Development/sdk/platform-tools:$HOME/Android-Development/sdk/tools

-Everyone likes to use different folder names. Remember to use the proper path of where you put your folders in.

-Save & exit the file. That's it. Now, reboot your computer, plug in your android device, & test it out. You should be able to type "adb devices" from any folder, & the computer should be able to see it now.