Install Ubuntu 13 and Android ADT in Win7 for 64 bits PC

Step1: Install Ubuntu to real disk

What ever, we need to install Ubuntu into disk. I use EasyBCD 2.2 to help install Ubuntu.

The configure file in EasyBCD:

title Install Ubuntu
root (hd0,1)
kernel (hd0,1)/vmlinuz.efi boot=casper iso-scan/filename=/ubuntu-13.04-desktop-amd64.iso
quiet splash locale=zh_CN.UTF-8
initrd (hd0,1)/initrd.lz

Notice that we need to change (hd0,1) to the real target drive index, for example, I'm going to install Ubunut in drive E: and it's my 2nd drive from C:. So I use (hd0, 1) as my Ubuntu drive. Don't forget tocopyubuntu-13.04-desktop-amd64.isoto C:/ and extract vmlinuz.efiand initrd.lz from Ubuntu ISO to C:/ , too! Then, restart Windows7.

By the way, when you are using Ubuntu ISO to install Ubuntu system, don't forget to: 

1. Remove the formated disk
2. Add new partition for /, /home as well as swap. If the disk size is 100G, then assign 50G to /, 42G to/homeas well as 8G toswap. Don't forget to boot system from/dev/sda, not any other one. If you choose anything else, then you may mostly meet an issue of booting Ubuntu system when reboot.

After the installation, we may meet an issue of booting for Ubuntu system. Then we can do the following scripts during fixing:

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb409c2cc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848  1486458469   743125811    7  HPFS/NTFS/exFAT
/dev/sda3      1909880832  1953521663    21820416    7  HPFS/NTFS/exFAT
/dev/sda4      1486458878  1909880831   211710977    5  Extended
/dev/sda5      1486458880  1686458367    99999744   83  Linux
/dev/sda6      1686460416  1866145791    89842688   83  Linux
/dev/sda7      1866147840  1909880831    21866496   82  Linux swap / Solaris

Partition table entries are not in disk order

Disk /dev/sdc: 15.7 GB, 15707668480 bytes
255 heads, 63 sectors/track, 1909 cylinders, total 30679040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            8192    30679039    15335424    c  W95 FAT32 (LBA)

ubuntu@ubuntu:~$ sudo -i
root@ubuntu:~# mkdir /media/tempdir
root@ubuntu:~# mount /dev/sda5 /media/tempdir
root@ubuntu:~# grub-install --root-directory=/media/tempdir /dev/sda
Installation finished. No error reported.
root@ubuntu:~# reboot
xiwang@ERIC-PC:~$ sudo update-grub2
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.8.0-19-generic
Found initrd image: /boot/initrd.img-3.8.0-19-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
Found Windows 7 (loader) on /dev/sda2
Found Windows Recovery Environment (loader) on /dev/sda3
done

Step2: Install JDK (Java Development Kits)

I'm using a tarball in binary jdk-7u25-linux-x64.tar.gz, and unpakcage it and configure ~/.bashrc as the following environment:

# -----------------------------------------------------------------------------
# Customized by ERIC
# -----------------------------------------------------------------------------
# for JAVA
JAVA_HOME=$HOME/tool/jdk1.7.0_25    # Change it to the real path of you extract JDK.
export JAVA_HOME

JRE_HOME=$JAVA_HOME/jre
export JRE_HOME

CLASSPATH=.:$JAVA_HOME/jre:$JAVA_HOME/jre/lib
export CLASSPATH

PATH=$JAVA_HOME/bin:$PATH
export PATH



Step3: Install Android ADT

I'm using a zip package which download from Android official site as adt-bundle-linux-x86_64-20130717.zip, unpackage it as well and configure ~/.bashrc like the following:

# for Android ADT
ANDROID_SDK_HOME=$HOME/tool/adt-bundle-linux-x86_64-20130717/sdk    # Change it to the real path of the location of Android SDK.
export ANDROID_SDK_HOME

CLASSPATH=$CLASSPATH:$ANDROID_SDK_HOME/tools:$ANDROID_SDK_HOME/platform-tools
export CLASSPATH


FAQ:

What if I met of missing file sdk/platform-tools/adb?

Don't worry, I run the command to install 32 bit libraries as well to fix the issue. After doing so, we can use eclipse and create a new virtual device using it.

sudo apt-get install ia32-libs



Where can I get Android SDK source code?

To download SDK source code into local. 

> git clone http://android.googlesource.com/platform/frameworks/base.git 



Will fill some more features when I got time on it. And I'm now going to develop with Android system base development together with C++.

Have fun! :)


Will fill some more features when I got time on it. And I'm now going to develop with Android system base development together with C++.

Have fun! :)

你可能感兴趣的:(linux,android,ubuntu,adt)