Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#constants) \| [Inherited Constants](https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#inhconstants) \| [Fields](https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#lfields) \| [Methods](https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#inhmethods)

# SharedLibraryInfo

*** ** * ** ***

` public final class SharedLibraryInfo `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.content.pm.SharedLibraryInfo |

<br />

*** ** * ** ***

This class provides information for a shared library. There are four types of shared libraries: builtin - non-updatable part of the OS; dynamic - updatable backwards-compatible dynamically linked; static - non backwards-compatible emulating static linking; SDK - updatable backwards-incompatible dynamically loaded.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#TYPE_BUILTIN` Shared library type: this library is a part of the OS and cannot be updated or uninstalled. |
| `int` | `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#TYPE_DYNAMIC` Shared library type: this library is backwards-compatible, can be updated, and updates can be uninstalled. |
| `int` | `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#TYPE_SDK_PACKAGE` SDK package shared library type: this library is **not** compatible between versions, can be updated and updates can be uninstalled. |
| `int` | `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#TYPE_STATIC` Shared library type: this library is **not** backwards -compatible, can be updated and updates can be uninstalled. |
| `int` | `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#VERSION_UNDEFINED` Constant for referring to an undefined version. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`".

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/content/pm/SharedLibraryInfo>` | `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#CREATOR` <br /> |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String>` | ` https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#getCertDigests()() ` Gets the list of certificate digests for the shared library. |
| ` https://developer.android.com/reference/android/content/pm/VersionedPackage` | ` https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#getDeclaringPackage()() ` Gets the package that declares the library. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/content/pm/VersionedPackage>` | ` https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#getDependentPackages()() ` Gets the packages that depend on the library. |
| ` long` | ` https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#getLongVersion()() ` Gets the version of the library. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#getName()() ` Gets the library name an app defines in its manifest to depend on the library. |
| ` int` | ` https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#getType()() ` Gets the type of this library. |
| ` int` | ` https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#getVersion()() ` *This method was deprecated in API level 28. Use `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#getLongVersion()` instead.* |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel parcel, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/os/Parcelable ` ` abstract int` ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() `

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
` abstract void` ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) `

Flatten this object in to a Parcel.

## Constants

### TYPE_BUILTIN

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_BUILTIN
```

Shared library type: this library is a part of the OS and cannot be updated or uninstalled.

<br />

Constant Value: 0 (0x00000000)

### TYPE_DYNAMIC

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_DYNAMIC
```

Shared library type: this library is backwards-compatible, can be updated, and updates can be uninstalled. Clients link against the latest version of the library.

<br />

Constant Value: 1 (0x00000001)

### TYPE_SDK_PACKAGE

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_SDK_PACKAGE
```

SDK package shared library type: this library is **not** compatible between versions, can be updated and updates can be uninstalled. Clients depend on a specific version of the library. SDK packages are not loaded automatically by the OS and rely e.g. on 3P libraries to make them available for the clients.

<br />

Constant Value: 3 (0x00000003)

### TYPE_STATIC

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_STATIC
```

Shared library type: this library is **not** backwards -compatible, can be updated and updates can be uninstalled. Clients link against a specific version of the library. Static shared libraries simulate static linking while allowing for multiple clients to reuse the same instance of the library.

<br />

Constant Value: 2 (0x00000002)

### VERSION_UNDEFINED

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int VERSION_UNDEFINED
```

Constant for referring to an undefined version.

<br />

Constant Value: -1 (0xffffffff)

## Fields

### CREATOR

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<SharedLibraryInfo> CREATOR
```

<br />

<br />

## Public methods

### describeContents

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`, the return value of this method must include the `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getCertDigests

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<String> getCertDigests ()
```

Gets the list of certificate digests for the shared library.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String>` | The list of certificate digests. This value cannot be `null`. <br /> |

### getDeclaringPackage

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public VersionedPackage getDeclaringPackage ()
```

Gets the package that declares the library.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/pm/VersionedPackage` | The package declaring the library. This value cannot be `null`. <br /> |

### getDependentPackages

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<VersionedPackage> getDependentPackages ()
```

Gets the packages that depend on the library. NOTE: the list also contains the result of `https://developer.android.com/`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/content/pm/VersionedPackage>` | The dependent packages. This value cannot be `null`. <br /> |

### getLongVersion

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getLongVersion ()
```

Gets the version of the library. For `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#TYPE_STATIC` libraries this is the declared version and for `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#TYPE_DYNAMIC` and `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#TYPE_BUILTIN` it is `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#VERSION_UNDEFINED` as these are not versioned.

<br />

| Returns ||
|---|---|
| `long` | The version. Value is -1 or greater <br /> |

### getName

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getName ()
```

Gets the library name an app defines in its manifest to depend on the library.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The name. <br /> |

### getType

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getType ()
```

Gets the type of this library.

<br />

| Returns ||
|---|---|
| `int` | The library type. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#TYPE_BUILTIN` - `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#TYPE_DYNAMIC` - `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#TYPE_STATIC` - `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#TYPE_SDK_PACKAGE` |

### getVersion

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getVersion ()
```

<br />

**This method was deprecated in API level 28.**   

Use `https://developer.android.com/reference/android/content/pm/SharedLibraryInfo#getLongVersion()` instead.

<br />

<br />

| Returns ||
|---|---|
| `int` | Value is -1 or greater <br /> |

### toString

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel parcel, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `parcel` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |