Sdílet prostřednictvím


Package.IsCompatibleWith(String) Method

Definition

Compare this package's specification version with a desired version.

[Android.Runtime.Register("isCompatibleWith", "(Ljava/lang/String;)Z", "GetIsCompatibleWith_Ljava_lang_String_Handler")]
public virtual bool IsCompatibleWith (string? desired);
[<Android.Runtime.Register("isCompatibleWith", "(Ljava/lang/String;)Z", "GetIsCompatibleWith_Ljava_lang_String_Handler")>]
abstract member IsCompatibleWith : string -> bool
override this.IsCompatibleWith : string -> bool

Parameters

desired
String

the version string of the desired version.

Returns

true if this package's version number is greater than or equal to the desired version number

Attributes

Exceptions

if this package's version string or the one provided are not in the correct format.

Remarks

Compare this package's specification version with a desired version. It returns true if this packages specification version number is greater than or equal to the desired version number.

Version numbers are compared by sequentially comparing corresponding components of the desired and specification strings. Each component is converted as a decimal integer and the values compared. If the specification value is greater than the desired value true is returned. If the value is less false is returned. If the values are equal the period is skipped and the next pair of components is compared.

Java documentation for java.lang.Package.isCompatibleWith(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to