Build an Android development environment in Linux

Source: Internet
Author: User

Build an Android development environment in Linux

Recently, I am tossing linux. Because we are engaged in Android development, we need to build an Android development environment. In this case, I want to help developers like me! Start it!

1. Install JDK

  • Download the JDK package to the compressed jdk-8u65-linux-x64.tar.gz package. After downloading the package, decompress the package;
  • Decompress the JDK package:
    1 tar -xvzf jdk-8u65-linux-x64.tar.gz
    (Tar -- extract command,-x -- Extract,-v -- check the decompression process,-z -- check whether the gzip attribute exists,-f -- archive file name, and then the parameter cannot be followed, only file names). The extracted file is jdk1.8.0 _ 65;
  • Start Installation
    1 sudo mkdir/usr/java # create installation path 2 sudo mv jdk1.8.0 _ 65/usr/java # Move the file to the installation directory
  • Configure Environment Variables
    • Open the configuration file
      1 sudo gedit /etc/profile
    • Add the following statement at the end of the file to complete environment variable configuration. In many tutorials, three parameters are configured. Here we only configure two parameters. Is this affected? In fact, it has been officially stated that jdk 1.6 and later do not need to configure CLASS_PATH. The official team has already done this for us. Although we can also set it on our own, we have to reset it if we are not careful and the setting is incorrect, Which is laborious. So there are ready-made products. Why don't we use them?
      1 export JAVA_HOME=/usr/java/jdk1.8.0_652 export PATH=$JAVA_HOME/bin:$PATH
  • Make the configuration take effect: log out and log on again;
  • Verify: java-version. If the output is as follows, the JDK is successfully installed and configured.

2. Install Android Studio

  • Download. (later, upload the file named android-studio-ide-141.2422023-linux.zip;
  • Unzip: unzip android-studio-ide-141.2422023-linux.zip. Get the android-studio folder.
  • Install: sudo mv android-studio/opt

3. Install the sdk

  • Android Studio is only a development tool without the SDK. You must download and install it yourself.
  • Download the SDK to get the android-sdk_r24.3.4-linux.tgz File
  • Unzip: tar-zxvf android-sdk_r24.3.4-linux.tgz to get the android-sdk-linux folder
  • Update: installation path/tools/android. the SDK Manager will pop up to update the required components. However, Google cannot access the site in China, so we need to set up a domestic image site. The method is as follows:
    • Select Options in the Tools menu of SDK Manager. The following dialog box is displayed.

To be filled in: HTTP Proxy Server, HTTP Proxy Port, tick the Force https://...sources to be fetched using http.

Then you can update it happily.

4. Start Using

/Opt/android-studio/bin/studio. sh. Well, there is a familiar startup interface, Binggo. You can have fun!

5. Download Related Files

Baidu: http://pan.baidu.com/s/1dDUrfnr

Extraction code: cf4w

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.