Android Studio Usage Summary

Source: Internet
Author: User

Android Studio was installed to see the source of a project, because now the company is still using Elipse development ... However, I found that Android studio is still great to use. For the use of these days, I made a record for myself to see ... It should be noted that the SDK used by your elipse and the SDK in Android studio must be open, otherwise, you use as to update the SDK, and then the EC inside the GG ...

First, create a new project, run under Hellow world, yes. The general will succeed ... If not generally you'd better see if the SDK used the same directory AH. If the XML file is an error, it is because your xxxactivity default inherits from Appcompatactivity. Appcompatactivity is a resource in the V7 package, and you have not imported the V7 package, so you will not find the resources.
Method One: Let your xxxactivity inherit from the activity and then change the theme
Method Two: Right-click your module and then openmodulesetting-–>dependency ——— > Dot + to introduce the V7 Compatibility pack

Second, the import of other people's project error ...
Excitedly importing someone else's project doesn't work out. This is the reason why I abandoned as a year ago, and think back, this may be a stumbling block. I regret, I only tears ran ... See the next error, which is usually the error

android {    ....    "23.0.1"    ....}

The build tool is officially provided by Android and is generally backwards compatible (but not absolutely)
When the project is built, the build tool version is the version of that time, so change to the build tool version you now have, generally as long as this version is larger than the original line.

1. Before you fix this, you need to know how Android studio looks at the local build tools version?

Right-select your project, then

Select your Bulid tools version above and you will see that the version in the Build.gradle file is changed as well. Run, it's a success.

2. The android-24 version requires more than 1.8 JDK support

This means that the android-24 version requires more than 1.8 JDK support, the solution is simply to install JDK 1.8 or more version number, or we do not need to android-24 the package on it, change the configuration in Build.gradle.

Third, their own project when the Claw machine shortcut keys ...
Then I wanted to write some code in the Hellow World project ... Under the transformation, 1, the first is to change the activity inherits the class, inherits the activity, realizes the View.onclicklistener ... Then the pit daddy found that the implementation method cannot be added automatically ... Press Alt+enter to be able to prompt, this is the auto-complete code shortcut key

2. After entering if, press SHIFT + CTRL + ENTER shortcut key to complete, Swich can also fill all points (only brackets)

3, for loop, can be solved by fori and then enter.

4. Forced conversion of view ... Note the position of the cursor, the cursor moves to the position to be complete, press Alt+enter can appear prompt

5, there is a comparison pit daddy is. We place the drawable icon ... The default interface is this

In fact, just switch to project and you can

As for the mipmap and Drawable folder placed in the icon of the problem, the source said, Mipmap is put system start icon, drawable How to use or how to use.

Iv. importing third-party jar packages and class libraries to Android Studio projects

1, import the jar package, copy your jar package to the Lib folder, then right-click "Add as Library" to open your Build.gradle folder can see compile files (' libs/ Fastjson-1.2.5.jar ') This package has been imported.

2. Import third-party dependent projects

This imports the third-party class library into the project. The next step is to add dependencies:

See this also success, see the next build.gradle in the configuration file, will automatically add

Summary: After these levels, I really feel that we should be able to accept Android studio. Let's explore the magic of it in development ... Just a few of my experiences, please correct me.

Android Studio Usage Summary

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.