public class Utils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Utils.HorizontallyScrollable
Interface for components that are internally scrollable left-to-right.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
ANIMATION_FADE_IN_TIME |
static java.lang.String |
SCHEME_ANDROID_RESOURCE |
static java.lang.String |
SCHEME_ASSETS |
static java.lang.String |
SCHEME_CONTENT |
static java.lang.String |
SCHEME_FILE |
static java.lang.String |
SCHEME_VIDEO |
static java.nio.charset.Charset |
US_ASCII |
static java.nio.charset.Charset |
UTF_8 |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeQuietly(java.io.Closeable closeable) |
static void |
deleteContents(java.io.File dir)
Deletes the contents of
dir. |
static void |
enableStrictMode() |
static java.io.File |
getDiskCacheDir(android.content.Context context,
java.lang.String uniqueName)
Get a usable cache directory (external if available, internal otherwise).
|
static java.lang.String |
getHeader(org.apache.http.HttpResponse response,
java.lang.String key) |
static java.lang.String |
getSchemeBaseUrl(java.lang.String type,
int id) |
static java.lang.String |
getSchemeBaseUrl(java.lang.String type,
java.lang.String url) |
static long |
getUsableSpace(java.io.File path)
Check how much usable space is available at a given path.
|
static boolean |
hasFroyo() |
static boolean |
hasGingerbread() |
static boolean |
hasGingerbreadMR1() |
static boolean |
hasHoneycomb() |
static boolean |
hasHoneycombMR1() |
static boolean |
hasJellyBean() |
static boolean |
hasJellyBeanMR2() |
static boolean |
hasKitKat() |
static boolean |
isGzipContent(org.apache.http.HttpResponse response) |
static boolean |
isSpecialType(java.lang.String url) |
static boolean |
isSupportRange(org.apache.http.HttpResponse response) |
static java.lang.String |
readFully(java.io.Reader reader) |
public static final int ANIMATION_FADE_IN_TIME
public static final java.lang.String SCHEME_FILE
public static final java.lang.String SCHEME_CONTENT
public static final java.lang.String SCHEME_ANDROID_RESOURCE
public static final java.lang.String SCHEME_VIDEO
public static final java.lang.String SCHEME_ASSETS
public static final java.nio.charset.Charset US_ASCII
public static final java.nio.charset.Charset UTF_8
public static void enableStrictMode()
public static boolean hasFroyo()
public static boolean hasGingerbread()
public static boolean hasGingerbreadMR1()
public static boolean hasHoneycomb()
public static boolean hasHoneycombMR1()
public static boolean hasJellyBean()
public static boolean hasJellyBeanMR2()
public static boolean hasKitKat()
public static long getUsableSpace(java.io.File path)
path - The path to checkpublic static java.io.File getDiskCacheDir(android.content.Context context,
java.lang.String uniqueName)
context - The context to useuniqueName - A unique directory name to append to the cache dirpublic static java.lang.String readFully(java.io.Reader reader)
throws java.io.IOException
java.io.IOExceptionpublic static void deleteContents(java.io.File dir)
throws java.io.IOException
dir. Throws an IOException if any file
could not be deleted, or if dir is not a readable directory.java.io.IOExceptionpublic static void closeQuietly(java.io.Closeable closeable)
public static boolean isSpecialType(java.lang.String url)
public static java.lang.String getSchemeBaseUrl(java.lang.String type,
java.lang.String url)
public static java.lang.String getSchemeBaseUrl(java.lang.String type,
int id)
public static java.lang.String getHeader(org.apache.http.HttpResponse response,
java.lang.String key)
public static boolean isSupportRange(org.apache.http.HttpResponse response)
public static boolean isGzipContent(org.apache.http.HttpResponse response)