Section I. Installing Android Studio (Ubuntu)

Source: Internet
Author: User
Tags android sdk manager java se

Android Development Series Tutorial--Catalogue

Last edited on 2016-04-21

This section describes installing Android Studio 2.0 under Ubuntu 14.04 LTS. If your development environment is Windows 7, go to ——————。

This program is recorded:
    1. Installing the JDK
    2. Installing the Android SDK
    3. Install Android Studio
    4. Create a new project and run the first Android app on the virtual device AVD
1. Install and configure JDK1.1 download the latest version of the JDK from Oracle website
Downloads -> Popular Downloads. Java SE -> Java Platform, Standard Edition. JDK Download ->  Accept License Agreement -> jdk-8u92-linux-x64.tar.gz(应选择一个最新的版本)



1.2 Unpacking the JDK

After the decompression is complete, you will get the jdk1.8.0_92 (different versions may vary) folder to any directory, the author chooses the/opt directory.
Use Terminal to move files because normal users do not have access to the/OPT directory

sudo mv /home/xxx/Downloads/jdk1.8.0_92(因版本不同可能有所差别)/opt
1.3 Configuring the JDK environment variables

Because the normal user does not have access to the Ect/profile, open the terminal execution

sudo gedit /etc/profile

Add at the end of the file

export JAVA_HOME=/opt/jdk1.8.0_92 (此处为第二步中的目录)export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/libexport PATH=$PATH:$JAVA_HOME/bin:$JAVA_HONE/jre/bin

Save, restart the system

Split Line ———————————— The system restarts ————————————

Now open the terminal terminal and execute

java

Should get a similar result

Perform

javac

Should get a similar result

2. Install android SDK2.1 download Android SDK

Because the network communication is not smooth, we suggest to download from the android-studio.org of the network condition better

Click ANDROID-SDK_R24.4.1-LINUX.TGZ (different versions may vary)

2.2 Unzip the Android SDK

After the decompression is complete, you will get the Android-sdk-linux (different versions may vary) folder to any directory, the author chooses the/opt directory.
Use Terminal to move files because normal users do not have access to the/OPT directory

sudo mv /home/xxx/Downloads/android-sdk-linux(因版本不同可能有所差别)/opt
2.3 Running Android SDK Manager

Open Terminal Terminal, enter

cd /opt/android-sdk-linux/tools (此处为第二步中的目录)./android

Should get a similar result

In general, you should install

    • Latest version of Anroid SDK Tools (note not preview channel)
    • Latest version of Android SDK Platform-tools (note not preview channel)
    • Latest version of Android SDK Build-tools (note not preview channel)
    • Latest API version (non-Preview) SDK Platform and one system image
    • Extra-> Android Support Repository
    • Extra-> Android Support Library
    • Google Repository Extra
    • -
3. Install Android Studio

(This article was last modified in 2016-04-21 version of Android Studio 2.0)

3.1 Download Android Studio

Because the network communication is not smooth, we suggest to download from the android-studio.org of the network condition better

Click Android-studio-ide-143.2739321-linux.zip (different versions may vary)

3.2 Unzip Android Studio

After the decompression is complete, you will get the Android-studio (different versions may vary) folder to any directory, the author chooses the/opt directory.
Use Terminal to move files because normal users do not have access to the/OPT directory

sudo mv /home/xxx/Downloads/android-studio(因版本不同可能有所差别)/opt
3.3 Running Android Studio

Fix for ' Unable to run Mksdcard SDK tool '

Open Terminal Terminal, enter

sudo apt-get install lib32stdc++6

Fix for ' Android Studio stuck backgroundtask background task show Gradel:build information:gradle tasks [: App:generatedebugsources,: App: Mockableandroidjar, App:preparedebugunittestdependencies,: app:generatedebugandroidtestsources] '

Open Terminal Terminal, enter

sudo apt-get install lib32z1

Open Terminal Terminal, enter

cd /opt/android-studio/bin (此处为第二步中的目录)./android

Should get a similar result

Click OK

Click Next

Click Custom, click Next

Choose one of your favorite colors (you can change it in the future)

Change the SDK location to the installation directory above, Next

All the way Next until

Finish

(optional) 3.4 Create desktop Icon

Click Configure-Create Desktop Icon-OK

Sometimes creating desktop icons will fail, so we can create desktop icons manually
Create a new file on the desktop, named Android Studio, open and enter

[Desktop Entry]Name = Android StudioComment= android studioExec=/opt/android-studio/bin/studio.sh(安装目录)Icon=/opt/android-studio/bin/idea.png (安装目录)Terminal=falseType=Application

Save, rename to Android Studio.desktop
Right-click, open the Property Properties menu, Permission Permissions tab, check execute execution.

4. Create a new project and run the first Android APP4.1 new project on the virtual appliance AVD

Start Android Studio

Click Start a new Android Studio Project

Change company Domain and application Name, click Next

Select Platform target platform and Minimun SDK Minimum SDK version
Here for the convenience of learning, we only select phone and tablet phone and tablet

Note that apps cannot be installed on systems with versions below the Minimun SDK, so you should try to choose a lower Minimun SDK version here. However, many new features will not be supported if the Minimun SDK selected is too low.
After selecting the Minimun SDK, click Next


Here is a pre-designed template like PowerPoint, and if a template is selected, Android Studio will generate layouts and code based on the Minimun SDK. But experienced developers can also write from the Add No activity themselves.
Note that if you choose to create activity here, this activity will be automatically set to launcher activity


Click Finish to finish creating the activity

4.2 Creating a virtual appliance AVD

Click the AVD Manager on the toolbar

Click Create Virtual Device

Select a hardware and click Next

Switch to the x86 Image tab, select the image downloaded in SDK Manager, click Next

Click Finish to finish

That's the whole process of creating an AVD.

4.3 Building a project

Click Build on the menu bar to make Project

When you're done, click on the toolbar's Run ' App ' (varies by Module name)

The results obtained

With an AVD device selected, clicking Ok,android Studio will automatically start the device, connect to the device, and install and run the app on the device.

As shown in.

The following section describes the techniques for installing and using a more efficient virtual machine KVM, debugging via a USB cable, and debugging via a wireless network.

Section I. Installing Android Studio (Ubuntu)

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.