Configure the Android development environment in Ubuntu

Source: Internet
Author: User

. Changed Ubuntu. Ubuntu has poor performance. You cannot set shadow...


Author:The dust of the world

Reprinted please indicate the source: Http://blog.csdn.net/shulianghan/article/details/20855541.


1. Install Android Studio


(1) download the Android Studio development environment


: Http://developer.android.com/sdk/installing/studio.html, Windows and Linux 32-bit and 64-bit;

--Windows: Https://dl.google.com/android/studio/install/0.4.2/android-studio-bundle-133.970939-windows.exe.

--Linux: Https://dl.google.com/android/studio/install/0.4.2/android-studio-bundle-133.970939-linux.tgz.

--MAC OS: Https://dl.google.com/android/studio/install/0.4.2/android-studio-bundle-133.970939-mac.dmg.


Install jdk: You must install the jdk of oracle to start Android Studio;


Install and start Android Studio: Decompress Android Studio to the directory, execute the studio. sh file in the bin directory, and start Android Studio;


The system prompts that some files in the bin directory do not have permission.: Modify the permissions of the execution file and sh file;

--Modification result:

Octopus @ octopus-Vostro-270s :~ /Android-studio/bin $ ll total usage 132drwx ------ 2 octopus 4096 January 18 14:38. /drwx ------ 7 octopus 4096 January 18 14:38 .. /-rw ------- 1 octopus 136 January 9 09:22 appletviewer. policy-rwx ------ 1 octopus 22791 January 9 09:22 fsnotifier *-rwx ------ 1 octopus 29155 January 9 09:22 workshop *-rw ------- 1 octopus 4176 January 9 09:22 idea.png-rw ------- 1 octopus 6870 january 9 09:23 idea. properties-rwx ------ 1 octopus 278 January 9 09:22 inspect. sh *-rw ------- 1 octopus 8531 January 9 09:22 libbreakgen64.so-rw ------- 1 octopus 6807 January 9 09:22 libbreakgen. so-rw ------- 1 octopus 2275 January 9 09:22 log. xml-rw ------- 1 octopus 282 January 9 09:22 studio64.vmoptions-rwx ------ 1 octopus 5630 January 9 09:22 studio. sh *-rw ------- 1 octopus 290 January 9 09:22 studio. vmoptions-rwx ------ 1 octopus 4049 January 9 09:22 update_studio.sh *


(2) download the SDK


Download SDK: Go to Android Studio, go to Settings, and use SDK Manager to download the SDK;


If the refresh fails, it indicates the firewall has been refreshed;


(3) Configure gradle


Configure gradle: When creating a project for the first time, you need to download gradle. After the project is downloaded, you can enter the familiar interface for development;

--Manual download: Online download time is particularly long, provides a gradle-1.9-all.zip package;

--: Http://pan.baidu.com/s/1jGgGaTS.

--Configuration process: Decompress gradle-1.9-all.zip to the android-studio/plugins/gradle directory;

-- Copy the zip file: copy the zip file to the/home/octopus/. gradle/wrapper/dists directory, that is ~ /. Gradle/wrapper/dists directory;

--Configure Environment Variables: Configure the bin directory of gradle to path;

export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_51export JRE_HOME=${JAVA_HOME}/jre  export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  export PATH=${JAVA_HOME}/bin:$PATH:/home/octopus/android-studio/plugins/gradle/bin

--Verify: Close the terminal. When you enable a terminal, run the gradle-v command;

octopus@octopus-Vostro-270s:~$ gradle -v------------------------------------------------------------Gradle 1.9------------------------------------------------------------Build time:   2013-11-19 08:20:02 UTCBuild number: noneRevision:     7970ec3503b4f5767ee1c1c69f8b4186c4763e3dGroovy:       1.8.6Ant:          Apache Ant(TM) version 1.9.2 compiled on July 8 2013Ivy:          2.2.0JVM:          1.7.0_51 (Oracle Corporation 24.51-b03)OS:           Linux 3.11.0-12-generic i386


(4) run Android Studio


Enable Android Studio:

--Run the studio. sh command: Use commands

octopus@octopus-Vostro-270s:~$ /home/octopus/android-studio/bin/studio.sh
-- Welcome Page:

--Enter the configuration page:




(5) Configure GitHub


Click the Settings icon to go to the Settings page.:

-- Setting icon:


Select Version Control-> GitHub on the left.:



Enter the GitHub domain name, account, password, and the corresponding location on the right, and test to check whether the connection is successful.:



(6) configure the font


Configure routes: Settings-> Editor-> Color & Fonts-> Font;



Configuration content:



(6) configure the SDK directory


An error occurred while creating a project or project page.: When you create a Project or Module, the interface is not properly created because the SDK is not properly configured;

--Configure routes: Close the current Project and enter the Android Studio environment interface,Configure->Project Defaults->Project Structure->Android SDK;










.

2. Install Oracle JDK


Download Oracle JDK: Download Page-http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html.


JDK Mismatch: OpenJDK is installed on Ubuntu by default. To run Android Studio, you must use Oracle JDK;


View jdk version: Use the java-version command;

root@bt:/opt# java -vesionUnrecognized option: -vesionCould not create the Java virtual machine.root@bt:/opt# java -versionjava version "1.6.0_20"OpenJDK Runtime Environment (IcedTea6 1.9.13) (6b20-1.9.13-0ubuntu1~10.04.1)OpenJDK Server VM (build 19.0-b09, mixed mode)

Jdk installation address:/Usr/lib/jvm;


Install jdk:

--Decompress the tar package: Copy the tar package to the/usr/lib/jvm directory and use tar xzvfJdk-7u51-linux-i586.gzCommand to decompress the package. The decompressed directory isJdk1.7.0 _ 51;

--Configure Environment Variables: Environment variables in ~ /. Bashrc configuration;

export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_51export JRE_HOME=${JAVA_HOME}/jre  export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  export PATH=${JAVA_HOME}/bin:$PATH

Add this jdk to the current usage: Update-alternatives -- install/usr/bin/java/usr/lib/jvm/java/Jdk1.7.0 _ 51/Bin/java 300;


3. Configure the terminal


Lock the terminal to the initiator: In the search, search for Terminal, open the Terminal, right-click the Terminal icon on the left, select "lock to starter", and then enter the Terminal from the left;


Configuration Terminal: Edit-> Configuration File preferences. The terminal configuration page is displayed;

--Configure the number of terminal cache lines:


--Configure terminal background:


--Font configuration:



4. Configure the vim Editor


Install vim: Use the sudo apt-get install vim command to install the vim editor;


Vim configuration file: Download vimrc configuration file: http://download.csdn.net/detail/han1202012/6684437.

--Baidu cloud Disk: Http://pan.baidu.com/s/1ntsfqgp;


Copy the configuration file ~ Directory to view the vim Effect:



Execution result:

octopus@octopus-Vostro-270s:~$ gcc main.c octopus@octopus-Vostro-270s:~$ ./a.out Hello World !!!


5. Configure apt-get Source


Backup source list:

sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup


Refresh after update:
sudo apt-get update


Netease 163 Update Server:
deb http://mirrors.163.com/ubuntu/ raring main restricted universe multiversedeb http://mirrors.163.com/ubuntu/ raring-security main restricted universe multiversedeb http://mirrors.163.com/ubuntu/ raring-updates main restricted universe multiversedeb http://mirrors.163.com/ubuntu/ raring-proposed main restricted universe multiversedeb http://mirrors.163.com/ubuntu/ raring-backports main restricted universe multiversedeb-src http://mirrors.163.com/ubuntu/ raring main restricted universe multiversedeb-src http://mirrors.163.com/ubuntu/ raring-security main restricted universe multiversedeb-src http://mirrors.163.com/ubuntu/ raring-updates main restricted universe multiversedeb-src http://mirrors.163.com/ubuntu/ raring-proposed main restricted universe multiversedeb-src http://mirrors.163.com/ubuntu/ raring-backports main restricted universe multiverse




Sohu Update Server:
deb http://mirrors.sohu.com/ubuntu/ raring main restricted universe multiversedeb http://mirrors.sohu.com/ubuntu/ raring-security main restricted universe multiversedeb http://mirrors.sohu.com/ubuntu/ raring-updates main restricted universe multiversedeb http://mirrors.sohu.com/ubuntu/ raring-proposed main restricted universe multiversedeb http://mirrors.sohu.com/ubuntu/ raring-backports main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ raring main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ raring-security main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ raring-updates main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ raring-proposed main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ raring-backports main restricted universe multiverse


6. Install Git


Run the sudo apt-get install git-core Command.: Install the Git version control tool;

Octopus @ octopus-Vostro-270s :~ $ Sudo apt-get install git-core [sudo] password for octopus: Reading the package list... the dependency tree of the software package being analyzed is reading status information... the following additional software packages are installed: git-man liberror-perl: git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-bzr git-cvs git-svn the following [new] the software package will be installed: git-core git-man liberror-perl has upgraded 0 software packages, 4 new software packages are installed, 0 software packages are to be uninstalled, and 0 software packages are not upgraded. Download the 8,488 kB software package. After decompression, 19.7 MB of extra space is consumed. Do you want to continue? [Y/n] y get: 1 http://cn.archive.ubuntu.com/ubuntu/ saucy/main liberror-perl all 0.17-1 [23.8 kB] Get: 2 http://cn.archive.ubuntu.com/ubuntu/ saucy/main git-man all. 8.3.2-1 [670 kB] Get: 3 http://cn.archive.ubuntu.com/ubuntu/ saucy/main git i386. 8.3.2-1 [7,793 kB] Get: 4 http://cn.archive.ubuntu.com/ubuntu/ saucy/main git-core all. 8.3.2-1 [1,386 B] Download 8,488 kB, time elapsed 1 minute 20 seconds (105 kB/s) Selecting previou Sly unselected package liberror-perl. (reading the database... the system currently has 168109 files and directories installed .) Extracting liberror-perl (from... /liberror-perl_0.17-1_all.deb )... selecting previusly unselected package git-man. extracting git-man (from... git-man_1 % 3a1. 8.3.2-policall.deb )... selecting previusly unselected package git. extracting git (from... /git_1% 3a1. 8.3.2-polici386.deb )... selecting previusly unselected package git-core. extracting git-core (from... git-core_1 % 3a1. 8.3.2-policall.deb )... processing the trigger for man-db... setting liberror-perl (0.17-1 )... setting git-man (1:1. 8.3.2-1 )... setting git (1:1. 8.3.2-1 )... setting git-core. 8.3.2-1 )...


7. Install sogou PinYin Input Method


Add Data Source: There is no sogou PinYin Input Method in the apt-get source of Ubuntu;

--Use commands: Sudo add-apt-repository ppa: fcitx-team/nightly, add source;

Octopus @ octopus-Vostro-270s :~ $ Sudo add-apt-repository ppa: fcitx-team/nightly [sudo] password for octopus: Experimental releases of Fcitx, use with caution. More information: https://launchpad.net /~ Press enter to continue or press Ctrl + c to cancel adding gpg: Key Ring '/tmp/tmpr2skz6/secring. gpg' gpg: key ring created '/tmp/tmpr2skz6/pubring. gpg' created gpg: Download key '7e5fa1ee 'from hkp server keyserver. ubuntu. comgpg:/tmp/tmpr2skz6/trustdb. gpg: Build a trust database gpg: Key 7E5FA1EE: Public Key "Launchpad PPA for Fcitx Team PPA" imported gpg: Total number of processed: 1gpg: imported: 1 (RSA: 1) OK

Update source information: Run sudo apt-get update to update the source information;

Octopus @ octopus-Vostro-270s :~ $ Sudo apt-get update ignore http://cn.archive.ubuntu.com saucy InRelease hit http://cn.archive.ubuntu.com saucy Release. gpg hit http://cn.archive.ubuntu.com saucy Release hit http://cn.archive.ubuntu.com saucy/main Sources hit http://cn.archive.ubuntu.com saucy/restricted Sources
... ...
Hit http://cn.archive.ubuntu.com saucy/universe Sources hit http://cn.archive.ubuntu.com saucy/multiverse Sources hit http://cn.archive.ubuntu.com saucy/main i386 Packages ignore http://ppa.launchpad.net saucy/main Translation-en download 22.6 kB, took 15 seconds (1,491 B/s) reading the package list... complete

Install related packages: Use the following command:

sudo apt-get install fcitx fcitx-config-gtk fcitx-sunpinyin fcitx-googlepinyin fcitx-module-cloudpinyin  fcitx-sogoupinyin  im-switch

Restart: Restart. You can see that the sogou Pinyin input method has been installed;


Configure sogou PinYin Input Method:




.

Author:The dust of the world

Reprinted please indicate the source: Http://blog.csdn.net/shulianghan/article/details/20855541.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.