Android Studio 1.0.2 Project-Learn about Android studio from an app development process

Source: Internet
Author: User

Shortly after the launch of Android Studio 1.0.1, Google released the Android Studio 1.0.2 version, which, like 1.0.0, is a bug fix version. In the previous Android Studio 1.0.1 + genymotion Android Simulator to create a high-performance Android development environment, we introduced the Android development environment to build, today first of all asked a lot of questions in the previous article, and then said some Android Tips for using studio.

I. Problems encountered in building development environment and Solutions

1. Genymotion Simulator Network error

We successfully installed the genymotion, downloaded a device, when the boot, found that some people will encounter the following error:

See this error, first of all do not panic, to see what is said, probably means that the VirtualBox network configuration error. Here's a look at the solution:

Win7 above the system, click on the Network icon, open the network and Sharing Center, change the adapter settings,

When open, select the VirtualBox host-only network--Property--Double-click: Internet protocol version 4 (TCP/IPV4)--Modify to obtain IP and DNS automatically to resolve this issue.

Of course, if you find that this does not solve the error, perhaps your computer IP is static, you need to manually set the IP.

2. Errors encountered in running the project

We run the project and sometimes encounter the following error,

This is believed to have developed Android friends have encountered, the way is to restart the Adb.exe. Let's see how it operates.

Win + R, enter cmd, open the Windows Command window, enter the command,

This command is to list the network occupies 5037 ports of the program, showing a bit more, yes, we just need to see the first row, is the last column is not 0 of the one. We look at the first line, see PID 8356 of this program occupies 5037 port, dare to occupy the port, must "kill" it, below to see, How to "kill" it,

See success, has terminated the PID 8356 process, indicating that we have successfully "killed" the privately occupied 5037 port process, then run the Android project will no longer error.

We recommend that you do not start the emulator, first run, if there is no error, and then start the simulator, sometimes you start the simulator, found that the error, after processing, will not recognize our Android simulator.

second, the use of Android studio skills

Below we briefly say some of the use of Android studio skills, hoping to help you get started quickly. First of all, the new project, all the same, there is no say, you can create a new project on their own.

1. Update for Android Studio

Click on the Help menu, Check for update ...,

2. Open and close preview columns

The most powerful thing about Android studio is the real-time preview of the interface editing, but everyone's computer screen resolution is different, sometimes show preview, the code will appear incomplete, we can choose to close it:

3. Quick Management SDK and simulator

  We can see the following in the toolbar, the specific which corresponds to what, we can put the mouse on the top to see, I write one by one, but we have to remember.

third, some features in Android studio

1. Automatically save the document

Everyone using Android Studio is not found file modification and has not been modified, all the same. This is because Android Studio automatically saves the document and doesn't have to press CTRL + S to save it every time we finish editing it.

2. Automatically register activity

Before we developed an Android app with Eclipse, we added a new activity to manifest.xml, and now that we've added new activity, Android Studio will automatically register the activity for us.

3, some similar functions of resharper

Using the ReSharper will find that there are some similar resharper shortcuts in Android studio, such as ALT + Enter, to solve some problems, can automatically guide the package, display solutions and so on.

This time we press ALT + ENTER key combination, will automatically guide the package.

Double-click behind the curly brace to select the code block,

Some corrections about the GIT version controller:

In Android Studio, the file name after submission turns white, while the modified uncommitted is light blue, and mainactivity is modified.

4. Open the file directory in the project

In Android Studio, we can open the directory where the project files are located,

Select Show in Explorer to open the directory where the file is located.

Iv. Android Studio Package build apk

When we write the code, test number application, need to test in the real environment, this time to generate the APK, the following steps:

, click Build > Generate signed APK ... menu, open the Configuration interface,

We can see the following interface:

I configured here, so there is information, the first time you configure, click Create New ..., fill in the following interface to save the configuration information, the next time you can open the saved key, you do not need to configure each time.

This configuration information believe that the development of Android should be clearer than me, I am also smattering, specific people can find some information online to see. Once configured, click Next, click Finish, and then Android Studio will start to build the APK, when finished, the following window pops up:

See this, click on the show in Explorer, open the folder we will see the generated apk,

At this point, an app is generated, and the process of developing an app in Android studio is roughly the case.

If we update the app later, to publish a new version, we will find out where the version number is changed. In fact, Android Studio put the configuration in the Gradle, we open build.gradle to modify,

An app's build and upgrade updates, version changes, all finished. More about the content of Android studio, you can join the following QQ group, together to exchange learning.

Cloud drizzling

QQ Exchange Group: 243633526

Blog Address: http://www.cnblogs.com/yunfeifei/

Disclaimer: The original text of this blog only represents my work in a certain time to summarize the views or conclusions, and my unit does not have a direct interest in the relationship. Non-commercial, unauthorized, post please keep the status quo, reprint must retain this paragraph statement, and in the article page obvious location to the original connection.

If you feel that my blog is helpful to everyone, please recommend supporting one, give me the motivation to write.

Android Studio 1.0.2 Project-Learn about Android studio from an app development process

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.