When it comes to creating an Android project with Eclipse, there is a appcompat_v7 problem "go"

Source: Internet
Author: User

Transferred from: http://blog.csdn.net/crazykbc/article/details/21553699

Problem Description:

When you create an Android project using Eclipse, you find that you create an APPCOMPAT_V7 project in the project list, and then you create an Android project, and then one more appcompat_v7_2, and if you create it again, The "Extra items" in the appcompat_v7_x format are then created (this situation occurs after ADT is upgraded to 22.6.x, not before 22.3.x)

Find out why:

ADT did not appear before the 22.3.x version, and after the upgrade to 22.6.x version, it is not possible to guess that the new version is causing the situation. Guess the reason after you can analyze the next appcompat_v7 is used to do what, expand the APPCOMPAT_V7 project, will find a Readme.txt file, double-click to view, the file is described as follows:

Library Project including compatibility ActionBar.

This can is used by a Android project to provide
Access to ActionBar the applications running on API 7+.

There is technically no source, but the SRC folder is necessary
To ensure that the build system works. The content is actually
Located in Libs/android-support-v7-appcompat.jar.
The accompanying resources must also is included in the application.

The literal meaning probably can be seen that the project is a library project, the role is to get your Android project in the API 7+ The SDK version (i.e. the Android2.1 version) can access the Actionbar Api,actionbar equivalent to the user interface of the action bar, the specific Actionbar explanation can be consulted: http://developer.android.com/ Guide/topics/ui/actionbar.html. So you can see that this project is more compatible with the lower version of the SDK, so how do we create an Android project that references this class library project? By right-clicking on the Android project---->properties-->android, you can see that the class Library project has been referenced.

The reason has been identified and can be verified:

First create an Android project, in the selection of the Android version of the interface, if you choose the minimum Android version of the "big version" is less than the version of the Android version of the large number, you need to consider compatibility issues, Creating a project like this will naturally result in a APPCOMPAT_V7 class library project. For example, if you compile with version 4.3, selecting the minimum required version number of 2.x or 3.x will create the APPCOMPAT_V7 support library automatically.

Questions:

Can I not generate APPCOMPAT_V7 This class library project? The answer is yes, as long as the version number is selected when the minimum required version and compile-time version of the same choice, but it is not recommended to do so, the development of Android programs need to consider compatibility with multiple versions

Add:

For more information about the library project, you can see the official documentation for details: HTTP://DEVELOPER.ANDROID.COM/TOOLS/SUPPORT-LIBRARY/FEATURES.HTML#V4

Find the explanation for the V7 AppCompat Library: The following:

This library adds support for the Action Bar user interface design pattern.

Note: This library is depends on the V4 support library. If you're using Ant or Eclipse, make sure your include the V4 support Library as part of this library ' s classpath.

Here is a few of the key classes included in the V7 AppCompat library:

    • ActionBar-Provides an implementation of the Action Bar user interface pattern. For more information on using the action Bar, see the Action Bar Developer Guide.
    • ActionBarActivity-Adds An application activity class that must is used as a base class for activities this uses the support Library action Bar implementation.
    • ShareActionProvider-Adds support for a standardized sharing action (such as e-mail or posting to social applications) that can is included in An action bar.

This library was located in the <sdk>/extras/android/support/v7/appcompat/ directory after you download the Android support Libraries. This library contains user interface resources. To include it in your application project, follow the instructions for adding libraries with resources.

The Gradle build script dependency identifier for this library is as follows:

The above is a personal problem-solving process to find some of the data to draw some conclusions, there may be wrong place, I hope to see the problem of the person pointing twos. Just started to learn Android development, some knowledge is too weak, in order to record some of the problems encountered at ordinary times, but also have to understand some of their own things to write out, and so more familiar with Android, and then come back to check these articles < ( ̄︶ ̄) >

When it comes to creating an Android project with Eclipse, there is a appcompat_v7 problem "go"

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.