Resources
Comment:
- Object for accessing application or system resources.
http://developer.android.com/reference/android/content/res/Resources.html
Locale
Fields:
- CHINA As Locale
Locale constant for zh_CN.
- CHINESE As Locale
Locale constant for zh.
- ENGLISH As Locale
Locale constant for en.
- JAPAN As Locale
Locale constant for ja_JP.
- JAPANESE As Locale
Locale constant for ja.
- KOREAN As Locale
Locale constant for ko.
Methods:
- GetAvailableLocales As Locale[]
Returns the system's installed locales.
- GetCountry As String
Returns the country code for this locale, or an empty string if this locale doesn't correspond to a specific country.
- GetDefault As Locale
Returns the user's preferred locale.
- GetDisplayCountry As String
Equivalent to GetDisplayCountry(Locale.GetDefault).
- GetDisplayCountry1 (Locale1 As Locale) As String
Returns the name of this locale's country, localized to Locale1.
- GetDisplayLanguage As String
Equivalent to GetDisplayLanguage(Locale.GetDefault).
- GetDisplayLanguage2 (Locale1 As Locale) As String
Returns the name of this locale's language, localized to Locale1.
- GetDisplayName As String
Equivalent to GetDisplayName(Locale.GetDefault).
- GetDisplayName2 (Locale1 As Locale) As String
Returns this locale's language name, country name, and variant, localized to Locale1.
- GetDisplayVariant As String
Returns the full variant name in the default Locale for the variant code of this Locale.
- GetISO3Country As String
Returns the three-letter ISO 3166 country code which corresponds to the country code for this Locale.
- GetISO3Language As String
Returns the three-letter ISO 639-2/T language code which corresponds to the language code for this Locale.
- GetISOCountries As String[]
Returns an array of strings containing all the two-letter ISO 3166 country codes that can be used as the country code when constructing a Locale.
- GetISOLanguages As String[]
Returns an array of strings containing all the two-letter ISO 639-1 language codes that can be used as the language code when constructing a Locale.
- GetLanguage As String
Returns the language code for this Locale or an empty string if no language was set.
- GetVariant As String
Returns the variant code for this Locale or an empty String if no variant was set.
- Initialize (Language As String)
- Initialize2 (Language As String, Country As String)
- Initialize3 (Language As String, Country As String, Variant As String)
- IsInitialized As Boolean
- SetDefault (Locale1 As Locale)
Overrides the default locale.
This does not affect system configuration, and attempts to override the system-provided default locale may themselves be overridden by actual changes to the system configuration.
Code that calls this method is usually incorrect, and should be fixed by passing the appropriate locale to each locale-sensitive method that's called.
Resources
Fields:
- RESOURCE_SOURCE_APPLICATION As ResourceSource
Constant field used to reference the application's resources.
- RESOURCE_SOURCE_SYSTEM As ResourceSource
Constant field used to reference the system's resources.
Methods:
- GetBoolean (ResourceId As Int) As Boolean
Return a boolean associated with the resource ID.
- GetColor (ResourceId As Int) As Int
Return a color integer associated with the resource ID.
- GetDimension (ResourceId As Int) As Float
Retrieve a dimensional for the resource ID.
- GetDimensionPixelOffset (ResourceId As Int) As Int
Retrieve a dimensional for the resource ID for use as an offset in raw pixels.
- GetDimensionPixelSize (ResourceId As Int) As Int
Retrieve a dimensional for the resource ID for use as a size in raw pixels.
- GetDrawable (ResourceId As Int) As Drawable
Return a drawable object associated with the resource ID.
- GetDrawableForDensity (ResourceId As Int, Density As Int) As Drawable
Return a drawable object associated with the resource ID for the given screen density in DPI.
- GetIdentifier (ResourceName As String, ResourceType As String, DefaultPackage As String) As Int
Returns an integer resource identifier for the given resource name.
A fully qualified resource name is of the form "package:type/entry".
The first two components (package and type) are optional if ResourceType and DefaultPackage, respectively, are specified here.
ResourceName - The name of the desired resource.
ResourceType - Optional resource type to find, if "type/" is not included in the name.
DefaultPackage - Optional default package to find, if "package:" is not included in the name.
Returns 0 if no such resource was found. (0 is not a valid resource ID).
- GetIntArray (ResourceId As Int) As Int[]
Return the int array associated with the resource ID.
- GetInteger (ResourceId As Int) As Int
Return an integer associated with the resource ID.
- GetQuantityString (ResourceId As Int, Quantity As Int) As String
Returns the string necessary for grammatically correct pluralization of the resource ID for the quantity.
- GetResourceEntryName (ResourceId As Int) As String
Return the entry name for the resource identifier.
- GetResourceName (ResourceId As Int) As String
Return the full name for the resource identifier.
- GetResourceNames (ResourceSource1 As ResourceSource, ResourceType As String) As List
Returns a List containing resource names.
ResourceSource1 - Either RESOURCE_SOURCE_APPLICATION or RESOURCE_SOURCE_SYSTEM.
ResourceType - The type of resources to return resource names for, eg "string" or "drawable".
- GetResourcePackageName (ResourceId As Int) As String
Return the package name for the resource identifier.
- GetResourceTypeName (ResourceId As Int) As String
Return the type name for the resource identifier.
- GetString (ResourceId As Int) As String
Return the string value associated with the resource ID.
It will be stripped of any styled text information.
- GetStringArray (ResourceId As Int) As String[]
Return the string array associated with the resource ID.
- Initialize (ResourceSource1 As ResourceSource)
Initialize the Resources object.
ResourceSource1 - Either RESOURCE_SOURCE_APPLICATION or RESOURCE_SOURCE_SYSTEM.
- IsInitialized As Boolean
- OpenRawResource (ResourceId As Int) As InputStreamWrapper
Open a data stream for reading a raw resource.
- SetDefaultLocale (Locale1 As Locale)
Set the default Locale used to get resources.
Properties:
- PackageName As String [read only]
Returns the application package name.