JSONArray Class
Definition
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A dense indexed sequence of values.
Remarks
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.
Constructors
Creates a JSONArray with no values.
Creates a JSONArray with no values.
A constructor used when creating managed representations of JNI objects; called by the runtime.
Creates a JSONArray with no values.
Creates a JSONArray with no values.
Creates a JSONArray with no values.
Properties
Returns the runtime class of this Object .
(Inherited from Object)
The handle to the underlying Android instance.
(Inherited from Object)
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
Methods
Creates and returns a copy of this object.
(Inherited from Object)
Indicates whether some other object is «equal to» this one.
(Inherited from Object)
Returns the value at index .
Returns the value at index if it exists and is a boolean or can be coerced to a boolean.
Returns the value at index if it exists and is a double or can be coerced to a double.
Returns a hash code value for the object.
(Inherited from Object)
Returns the value at index if it exists and is an int or can be coerced to an int.
Returns the value at index if it exists and is a JSONArray .
Returns the value at index if it exists and is a JSONObject .
Returns the value at index if it exists and is a long or can be coerced to a long.
Returns the value at index if it exists, coercing it if necessary.
Returns true if this array has no value at index , or if its value is the null reference or JSONObject#NULL .
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
(Inherited from Object)
Returns a new string by alternating this array’s values with separator .
Returns the number of values in this array.
Wakes up a single thread that is waiting on this object’s monitor.
(Inherited from Object)
Wakes up all threads that are waiting on this object’s monitor.
(Inherited from Object)
Returns the value at index , or null if the array has no value at index .
Returns the value at index if it exists and is a boolean or can be coerced to a boolean.
Returns the value at index if it exists and is a boolean or can be coerced to a boolean.
Returns the value at index if it exists and is a double or can be coerced to a double.
Returns the value at index if it exists and is a double or can be coerced to a double.
Returns the value at index if it exists and is an int or can be coerced to an int.
Returns the value at index if it exists and is an int or can be coerced to an int.
Returns the value at index if it exists and is a JSONArray .
Returns the value at index if it exists and is a JSONObject .
Returns the value at index if it exists and is a long or can be coerced to a long.
Returns the value at index if it exists and is a long or can be coerced to a long.
Returns the value at index if it exists, coercing it if necessary.
Returns the value at index if it exists, coercing it if necessary.
Appends value to the end of this array.
Appends value to the end of this array.
Appends value to the end of this array.
Appends value to the end of this array.
Appends value to the end of this array.
Appends value to the end of this array.
Appends value to the end of this array.
Appends value to the end of this array.
Appends value to the end of this array.
Appends value to the end of this array.
Removes and returns the value at index , or null if the array has no value at index .
Sets the Handle property.
(Inherited from Object)
Returns a new object whose values are the values in this array, and whose names are the values in names .
Returns a string representation of the object.
(Inherited from Object)
Encodes this array as a compact JSON string, such as:
Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.
(Inherited from Object)
Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.
(Inherited from Object)
Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.
(Inherited from Object)
Explicit Interface Implementations
IJavaPeerable.Disposed() | (Inherited from Object) |
IJavaPeerable.DisposeUnlessReferenced() | (Inherited from Object) |
IJavaPeerable.Finalized() | (Inherited from Object) |
IJavaPeerable.JniManagedPeerState | (Inherited from Object) |
IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from Object) |
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from Object) |
IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from Object) |
Extension Methods
Performs an Android runtime-checked type conversion.
Источник
Учебник по JSON для Android: создание и анализ данных JSON
В этом руководстве описывается, как использовать JSON с Android . JSON расшифровывается как (Java Script Object Notation). Это простой и легкий формат обмена данными, который может быть легко прочитан людьми и машинами. JSON — это текстовый формат, не зависящий от языка. Он представляет данные в текстовом формате, чтобы их можно было легко проанализировать.
Введение в JSON
JSON использует две разные структуры:
- Коллекция пары имя / значение
- массив
Первую структуру можно использовать для моделирования объекта, поскольку объект представляет собой набор атрибутов, которые содержат некоторые значения. Массив может использоваться для моделирования списка, массива объектов и так далее. Таким образом, используя эти две структуры, мы можем передавать данные между двумя машинами простым и эффективным способом. В последнее время JSON пользуется большим успехом, и большинство доступных API поддерживает формат JSON. Давайте посмотрим, как мы можем представлять данные в формате JSON.
Объект в JSON моделируется с помощью , а его атрибуты можно моделировать с помощью name: value pair.Value, в свою очередь, может быть объектом, массивом или «простым» значением, например, примитивным значением (int, Строка, логическое значение и т. Д.).
Так что если у нас есть, например, класс Java, как:
Источник