public class DefaultSdkProvider.DefaultSdk extends Sdk
Represents an Android SDK stored at Maven Central.
| Constructor and Description |
|---|
DefaultSdk(int apiLevel,
String androidVersion,
String robolectricVersion,
String codeName,
int requiredJavaVersion) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAndroidCodeName()
Returns the Android codename for this SDK.
|
String |
getAndroidVersion()
Returns the Android Version for this SDK.
|
Path |
getJarPath()
Returns the path to jar for this SDK.
|
String |
getUnsupportedMessage()
Returns a human-readable message explaining why this SDK isn’t supported.
|
boolean |
isSupported()
Determines if this SDK is supported in the running Robolectric environment.
|
public String getAndroidVersion()
SdkReturns the Android Version for this SDK.
It should match the version reported by android.os.Build.VERSION.RELEASE provided within.
If this is an expensive operation, the implementation should cache the return value.
getAndroidVersion in class Sdkpublic String getAndroidCodeName()
SdkReturns the Android codename for this SDK.
It should match the version reported by android.os.Build.VERSION.CODENAME provided within.
If this is an expensive operation, the implementation should cache the return value.
getAndroidCodeName in class Sdkpublic Path getJarPath()
SdkReturns the path to jar for this SDK.
getJarPath in class Sdkpublic boolean isSupported()
SdkDetermines if this SDK is supported in the running Robolectric environment.
An SDK might be unsupported if e.g. it requires a newer version of the JVM than is currently running.
Unsupported SDKs should throw some explanatory exception when Sdk.getJarPath() is invoked.
If this is an expensive operation, the implementation should cache the return value.
isSupported in class Sdkpublic String getUnsupportedMessage()
SdkReturns a human-readable message explaining why this SDK isn’t supported.
If this is an expensive operation, the implementation should cache the return value.
getUnsupportedMessage in class Sdk