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

时间:2021-05-13 13:33:11

I am new to Android Programming. I am using Eclipse as the IDE for development. I have started a new project and some jar files were automatically added to the project. Could you explain what each of these jar files mean?

我是Android编程的新手。我使用Eclipse作为开发的IDE。我已经开始了一个新项目,并且一些jar文件被自动添加到项目中。你能解释一下这些jar文件的含义吗?

  • Android 4.4.2
    • android.jar
    • 的android.jar
  • Android 4.4.2 android.jar
  • Android Private Libraries
    • android-support-v7-appcompat.jar
    • Android的支持-V7-appcompat.jar
    • android-support-v4.jar
    • Android的支持,v4.jar
  • Android私有库android-support-v7-appcompat.jar android-support-v4.jar
  • Android Dependencies
    • appcompat_v7_2.jar
    • appcompat_v7_2.jar
  • Android Dependencies appcompat_v7_2.jar
  • libs
    • android-support-v4.jar
    • Android的支持,v4.jar
  • libs android-support-v4.jar

Also, apart from these, there is a folder generated named "appcompat_v7_2" which can be seen in the Project Explorer. It also contains Android Private Libraries and libs folder.

此外,除了这些之外,还有一个名为“appcompat_v7_2”的文件夹,可以在Project Explorer中看到。它还包含Android Private Libraries和libs文件夹。

I feel that there is some sort of redundancy involved here. Do clear the confusion.

我觉得这里涉及某种冗余。清除混乱。

2 个解决方案

#1


7  

  • Android 4.4.2
    • android.jar
    • 的android.jar
  • Android 4.4.2 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-support-v7-appcompat.jar
    • Android的支持-V7-appcompat.jar
    • android_support-v4
    • android_support-V4
  • Android私有库android-support-v7-appcompat.jar android_support-v4

These are the support libraries used for your application when it is run on lower Android versions. 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版本上运行时用于应用程序的支持库。例如,如果您使用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. They are created by Eclipse for user convenience.

Android私有库和Android依赖项不是实际文件夹。它们由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. And Android Dependencies tells us which appcompat_v7_x the project referencing or using.

Android私有库只是对支持库的引用。 Android Dependencies告诉我们项目引用或使用的appcompat_v7_x。

If you look at the icon in the Eclipse, libs icon and Android Private Libraries are different icons. It is because Android Private Libraries is not an actual folder. You do not find it on the disk.

如果查看Eclipse中的图标,libs图标和Android私有库是不同的图标。这是因为Android私有库不是一个实际的文件夹。你没有在磁盘上找到它。

So, there isn't any redundancy, in the sense that no files are being copied or duplicated.

因此,没有任何冗余,因为没有文件被复制或复制。

Enjoy your Android development! :) Try Android Studio, it is way better than Eclipse!!

享受您的Android开发! :)尝试Android Studio,它比Eclipse更好!

#2


0  

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. And to list all the library contents would be too much work.

这些只是包含应用程序内容的库。当你执行“import android.blah.blah.blah”时,你会将这个功能添加到你的代码中。并列出所有库内容将是太多的工作。

#1


7  

  • Android 4.4.2
    • android.jar
    • 的android.jar
  • Android 4.4.2 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-support-v7-appcompat.jar
    • Android的支持-V7-appcompat.jar
    • android_support-v4
    • android_support-V4
  • Android私有库android-support-v7-appcompat.jar android_support-v4

These are the support libraries used for your application when it is run on lower Android versions. 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版本上运行时用于应用程序的支持库。例如,如果您使用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. They are created by Eclipse for user convenience.

Android私有库和Android依赖项不是实际文件夹。它们由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. And Android Dependencies tells us which appcompat_v7_x the project referencing or using.

Android私有库只是对支持库的引用。 Android Dependencies告诉我们项目引用或使用的appcompat_v7_x。

If you look at the icon in the Eclipse, libs icon and Android Private Libraries are different icons. It is because Android Private Libraries is not an actual folder. You do not find it on the disk.

如果查看Eclipse中的图标,libs图标和Android私有库是不同的图标。这是因为Android私有库不是一个实际的文件夹。你没有在磁盘上找到它。

So, there isn't any redundancy, in the sense that no files are being copied or duplicated.

因此,没有任何冗余,因为没有文件被复制或复制。

Enjoy your Android development! :) Try Android Studio, it is way better than Eclipse!!

享受您的Android开发! :)尝试Android Studio,它比Eclipse更好!

#2


0  

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. And to list all the library contents would be too much work.

这些只是包含应用程序内容的库。当你执行“import android.blah.blah.blah”时,你会将这个功能添加到你的代码中。并列出所有库内容将是太多的工作。