Android Util

android-util.png
import android.util.*;

で使うことのできる、Android専用のお便利なクラスである!

インタフェース

AttributeSet A collection of attributes, as found associated with a tag in an XML document.
Printer Simple interface for printing text, allowing redirection to various targets.

クラス

ArrayMap<K, V> ArrayMap is a generic key->value mapping data structure that is designed javaの元からあるHashMapよりもメモリが効率的に使うことができる。 Android 4.4 以降
AtomicFile Helper class for performing atomic operations on a file by creating a backup file until a write has successfully completed.
Base64 バイナリデータをエンコードするための便利クラス。64進数ってこと
Base64InputStream An InputStream that does Base64 decoding on the data read through it.
Base64OutputStream An OutputStream that does Base64 encoding on the data written to it, writing the resulting data to another OutputStream.
Config API level 14.以降非推奨。このクラスは便利じゃない。 it just returns the same value for all constants, and has always done this. Do not use it.

デバッグのための便利クラス

DisplayMetrics A structure describing general information about a display, such as its size, density, and font scaling.
EventLog Access to the system diagnostic event record.
EventLog.Event A previously logged event read from the logs.
EventLogTags このクラスはAPI level 8. 以降非推奨。非効率的である。変わりに Use EventLog を使おう
EventLogTags.Description
FloatMath javaにあるdoubleのMathと同じ機能をfloat型で提供したもの。現在はMathでも十分速いので非推奨
JsonReader Reads a JSON (RFC 4627) encoded value as a stream of tokens.
JsonWriter Writes a JSON (RFC 4627) encoded value to a stream, one token at a time.
LayoutDirection A class for defining layout directions.
Log logcatに好きな文字を出力する
LogPrinter Implementation of a Printer that sends its output to the system log.
LongSparseArray<E> HashMap<Long,Object>と同じでそれよりも効率的なもの
LruCache<K, V> A cache that holds strong references to a limited number of values.
MonthDisplayHelper Helps answer common questions that come up when displaying a month in a 6 row calendar grid format.
Pair<F, S> 2つのオブジェクトのペア
Patterns 正規表現のパターンに使う
PrintStreamPrinter Implementation of a Printer that sends its output to a PrintStream.
PrintWriterPrinter Implementation of a Printer that sends its output to a PrintWriter.
Property<T, V> A property is an abstraction that can be used to represent a mutable value that is held in a host object.
SparseArray<E> キーがint,で好きなオブジェクトが入れられる。HashMap<Integer,Object>と同じだけどHashMapよりも効率的。
SparseBooleanArray HashMap<Integer,Boolean>と同じでHashMapよりも効率的。
SparseIntArray HashMap<Integer,Integer>と同じでHashMapよりも効率的。
SparseLongArray HashMap<Integer,Long>と同じでHashMapよりも効率的。 android4.3(API 18)以降
StateSet State sets are arrays of positive ints where each element represents the state of a View (e.g.
StringBuilderPrinter Implementation of a Printer that sends its output to a StringBuilder.
TimeUtils A class containing utility methods related to time zones.
TimingLogger A utility class to help log timings splits throughout a method call.
TypedValue Container for a dynamically typed data value.
Xml XML utility methods.

Enum

JsonToken A structure, name or value type in a JSON-encoded string.
Xml.Encoding Supported character encodings.

Exception

AndroidException Base class for all checked exceptions thrown by the Android frameworks.
AndroidRuntimeException Base class for all unchecked exceptions thrown by the Android frameworks.
Base64DataException This exception is thrown by Base64InputStream or Base64OutputStream when an error is detected in the data being decoded.
MalformedJsonException Thrown when a reader encounters malformed JSON.
NoSuchPropertyException Thrown when code requests a Property on a class that does not expose the appropriate method or field.

TimeFormatException

Bibliography

サポートサイト Wikidot.com