Android Quick Start Guide (top)

Source: Internet
Author: User

Objective

Many students want to learn Android application development, but have not started to encounter a lot of problems, such as resources can not be downloaded, the environment to build a problem, the code does not know where to write from. The process from 0 to 1 makes the novice mad.

So I want to write a simple, highly operational quick guide to help prepare students to start learning Android app development. Everything starts hard, the first obstacle to the beginning of the solution, the future of the road is wider.

This article begins with a practical example, " Calculator " Application, to introduce the entire process of Android application development to beginners who are ready to learn about Android development – including the building of development environments, the deployment of programs, interface design, functional implementation, and so on.

When this " Calculator " Application was completed, beginners learned to develop a simple Android application.


The reader for this article is:

    1. Novice who needs guidance for Android development;
    2. Build developers with problems in the development environment;

Before you start, let's say you're ready to do the following:

    • A computer (desktop or notebook) of a Windows system (Win7 Win8 Win10);
    • An Android device (mobile or tablet);
    • A data cable (usually a micro USB cable) connecting the computer and the Android device;
    • Day time.
    • Java programming language (slightly understood);
    • Patience and curiosity.

This article will be divided into 3 parts.

    1. Build the development environment: we will build the development environment on the most widely used Windows operating system;
    2. Deploy the app: Create an empty Project project and deploy it to the device to run;
    3. Development of the Calculator app: Start with an empty project, step-by-step, and realize the full functionality of the calculator.

The code for this article can be downloaded from the example code of the Bean network.

1th Section Development Environment Construction

For Android Development, the first step is to build a development environment. On a Windows system, we need to install:

    1. Jdk:java Development Kit, because Android uses Java development, and other parts of the Android application development tools also rely on the Java development environment, so must install JDK;
    2. Android SDK: Google offers Android app development Kit.
    3. Android Studio: Google offers an Android development environment.
Download and installation of the 1.1 JDK

The JDK can be downloaded from the official website.

It can also be downloaded via the download page provided by the Bean network.

* When downloading, please select according to the type and number of digits of the operating system.

After downloading to local, double-click the installation package to install it.

After the installation is complete,

    1. By Win+R starting the Windows operating system 运行 panel;
    2. Enter in the panel cmd , start the Command line window;
    3. In the Command Line window, enter java -version ;

If you can see something like this at this point, the JDK installation is successful.

C:\Users\XXX>-version"1.8.0_66"1.8.0_66-b1864-Bit25.66-b18, mixed mode)                 
1.2 Android SDK and Android studio for download and installation

It is convenient to build a development environment on Windows systems. Google packaged the Android SDK and Android studio together to provide us with the download.

We can download it through the official website of Android app development.

It can also be downloaded via the download page provided by the Bean network.

When the download is complete, double-click the installation package to install it.

When the installation is complete, start Android Studio :

    1. For the first time, Android Studio will connect to Google's network and check for software updates. Because of network reasons, the connection will always fail, the direct choice 取消 is possible;
    2. Since we installed the Android SDK and Android Studio package for installation, there is no need to download the Android SDK separately or to configure the Android SDK separately.

So far, the Android development environment under the window platform has been built.

Section 2nd creation and deployment of applications

In this section we will create a brand new project project, compile it and let it run to the device.

2.1 Creating an Application project

Start Android Studio and select Start a new Android Projcet .

Enter the project settings interface one:

    1. In the Application name bar, take a name for the application Calculator ;
    2. In the Company Domain column, according to the form of the URL anddle.com --of course, you can also fill in according to their preferences of other domains;
    3. In the Project location column, fill in the location of the application, you can choose any directory you want to store project projects.

下一步after selecting, enter the project Settings Interface II:

    1. Tick on Phone and Tablet ;
    2. Minimum SDKOption to match the Android version of the debug device as much as possible.

      * The corresponding relationship between mobile version and API level is as follows:

下一步after selecting, enter the project settings interface three:

    1. Select Empty Activity .

下一步after selecting, enter the project Settings screen four:

    1. In the Activity Name column, activity uses the default name MainActivity ;
    2. In the Layout Name column, the layout file also uses the default name activity_main ;

完成once selected, project creation is complete.

* Because Android Studio is the first time to create project projects, you need to connect to the network to download some components that need to wait a little longer. Once the download is successful, it will not take much time to create the project later.

2.2 Deployment of applications to equipment

To verify the project we created, we needed to build the project, compile it into an apk, and then deploy it to the device to run.

To debug on the device, first open the device's developer options, different brands of Android device interface, although not the same, but the use of a similar way:

    1. Launch the " settings " app on your Android device and go to the " about Mobile " tab;
    2. Click the " version number " continuously until 您现在处于开发者模式! the prompt message appears;


    3. Return to the parent menu, go to "developer Options", 开启 debug mode, hook up USB调试 ;

Connect your phone and computer with a USB cable.

On Windows systems, you need to install ADB drivers for the devices on the connection:

    1. Download ADB's Windows driver to PC locally by downloading the resources on the Bean network;
    2. Right click on " My Computer ", select " Manage ", open " Device Manager ", you can see the device without installing the driver;
    3. To update the driver for it, select Browse computer Find ,


    4. To specify the location of the downloaded ADB driver directory, click OK and the driver will install successfully.

    5. Click on the windows of Android studio to Android Monitor see the device on this connection, and this window also outputs the running information of the mobile-side printing.

To deploy your app to your device:

    1. Click the small green triangle in the menu bar;

      or use Debug shortcut keys shift+F10 ;

    2. Double-click on the selected device,

      At this point you can see it on the device and our program is running.

At this point, we have successfully created an empty project project that can be run on the device.

Android Quick Start Guide (top)

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.