简体   繁体   English

Android Private Libraries,Dependencies和libs文件夹之间有什么区别?

[英]What is the difference between Android Private Libraries, Dependencies and the libs folder?

I am new to Android Programming. 我是Android编程的新手。 I am using Eclipse as the IDE for development. 我使用Eclipse作为开发的IDE。 I have started a new project and some jar files were automatically added to the project. 我已经开始了一个新项目,并且一些jar文件被自动添加到项目中。 Could you explain what each of these jar files mean? 你能解释一下这些jar文件的含义吗?

  • Android 4.4.2 Android 4.4.2
    • android.jar 的android.jar
  • Android Private Libraries Android私人图书馆
    • android-support-v7-appcompat.jar Android的支持-V7-appcompat.jar
    • android-support-v4.jar Android的支持,v4.jar
  • Android Dependencies Android依赖项
    • appcompat_v7_2.jar appcompat_v7_2.jar
  • libs
    • android-support-v4.jar Android的支持,v4.jar

Also, apart from these, there is a folder generated named "appcompat_v7_2" which can be seen in the Project Explorer. 此外,除了这些之外,还有一个名为“appcompat_v7_2”的文件夹,可以在Project Explorer中看到。 It also contains Android Private Libraries and libs folder. 它还包含Android私有库和libs文件夹。

I feel that there is some sort of redundancy involved here. 我觉得这里有一些冗余。 Do clear the confusion. 清除混乱。

  • Android 4.4.2 Android 4.4.2
    • android.jar 的android.jar

This is the native API library for Android 4.4 (if you go to Android Package Manager, you can see many files ranging from Android 2.* - Android 4.*) 这是Android 4.4的原生API库(如果你去Android Package Manager,你可以看到许多来自Android 2的文件。* - Android 4. *)

So, when you create a new project in Eclipse, it will automatically use that library which was specified in the property for Android API level. 因此,当您在Eclipse中创建一个新项目时,它将自动使用该属性中为Android API级别指定的库。

  • Android Private Libraries Android私人图书馆
    • android-support-v7-appcompat.jar Android的支持-V7-appcompat.jar
    • android_support-v4 android_support-V4

These are the support libraries used for your application when it is run on lower Android versions. 这些是在较低的Android版本上运行时用于应用程序的支持库。 For example if you are using Android API 19 as the targeted library to compile, you will need the android_support-v4 library the application is to run on lower Android API devices. 例如,如果您使用Android API 19作为目标库进行编译,则需要android_support-v4库,该应用程序将在较低的Android API设备上运行。

The difference between v7 and v4 is that v7 supports Android v3.0 and above and v4 supports Android v2.0 and above. v7和v4的区别在于v7支持Android v3.0及更高版本,v4支持Android v2.0及更高版本。

I feel that there is some sort of redundancy involved here. 我觉得这里有一些冗余。

The Android Private Libraries and the Android Dependencies are not actual folders. Android私有库和Android依赖项不是实际文件夹。 They are created by Eclipse for user convenience. 它们由Eclipse创建,以方便用户使用。

When the project is created, the support libraries for both v4 and v7 are created in the appcompat_v7_x/libs folder. 创建项目时,将在appcompat_v7_x / libs文件夹中创建v4和v7的支持库。

Android Private Libraries just has references to the support libraries. Android私有库只是对支持库的引用。 And Android Dependencies tells us which appcompat_v7_x the project referencing or using. Android Dependencies告诉我们项目引用或使用的appcompat_v7_x。

If you look at the icon in the Eclipse, libs icon and Android Private Libraries are different icons. 如果查看Eclipse中的图标,libs图标和Android私有库是不同的图标。 It is because Android Private Libraries is not an actual folder. 这是因为Android私有库不是实际的文件夹。 You do not find it on the disk. 你没有在磁盘上找到它。

So, there isn't any redundancy, in the sense that no files are being copied or duplicated. 因此,没有任何冗余,因为没有文件被复制或复制。

Enjoy your Android development! 享受您的Android开发! :) Try Android Studio, it is way better than Eclipse!! :)尝试Android Studio,它比Eclipse更好!

These are just libraries that contain content for your application. 这些只是包含应用程序内容的库。 When you do "import android.blah.blah.blah" you are getting that functionality added to your code. 当你执行“import android.blah.blah.blah”时,你会将这个功能添加到你的代码中。 And to list all the library contents would be too much work. 并列出所有库内容将是太多的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Eclipse中的Maven依赖项和引用库有什么区别? - What is the difference between Maven Dependencies and Referenced Libraries in Eclipse? IntelliJ IDEA中“模块依赖关系”和“库”之间有什么区别? - What is the difference between “Module Dependencies” and “Libraries” in IntelliJ IDEA? Android eclipse-在libs文件夹和参考库中重复的android.jar - Android eclipse - android.jar duplicated in libs folder and Referenced Libraries 源文件夹和(普通)文件夹之间有什么区别 - What is the difference between a source folder and a (normal) folder 项目依赖和其他依赖之间有什么区别 - What is the difference between a project dependency and other dependencies Gradle:类路径和编译依赖有什么区别? - Gradle: What is the difference between classpath and compile dependencies? Java中的公共接口和私有接口有什么区别 - What is the difference between a public and private interface in Java Java中public、protected、package-private和private有什么区别? - What is the difference between public, protected, package-private and private in Java? android内部存储和外部私有存储有什么区别? - what's the difference between android internal storage and external-private storage? Android对库的依赖 - Android dependencies with libraries
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM